Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, it is necessary to accurately issue virtual resources to users, so as to meet shopping demands of the users. Therefore, the application provides a virtual resource generation method, a virtual resource generation device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present application provides a method for generating a virtual resource, including:
acquiring a data processing request, wherein the data processing request carries first resource data;
analyzing the first resource data through a pre-trained analysis model to obtain target resource data;
generating a first virtual resource according to the target resource data;
and issuing the first virtual resource to a requester.
Optionally, before the acquiring the data processing request, the method further includes:
determining first resource data according to the received triggering operation, and generating corresponding tag content;
receiving voice content;
and when the voice information is matched with the tag content, generating the data processing request according to the first resource data.
Optionally, before the target resource data is obtained according to the first resource data analysis through a pre-trained analysis model, the method further includes:
obtaining a virtual resource obtaining record associated with the requestor;
determining acquisition failure times according to the virtual resource acquisition record;
calculating the acquisition probability according to the acquisition failure times;
and when the acquisition probability is smaller than or equal to the preset threshold value, inputting the first resource data into a pre-trained analysis model.
Optionally, the analyzing, by the pre-trained analysis model, the target resource data according to the first resource data includes:
acquiring a pre-trained analysis model;
inputting the first resource data into a pre-trained analysis model, and calculating by the analysis model according to the first resource data to obtain second resource data;
determining attribute information of the requester and third resource data corresponding to the attribute information;
and weighting according to the second resource data and the third resource data to obtain the target resource data.
Optionally, the method further comprises:
acquiring sample resource data and labeling contents corresponding to the sample resource data, wherein the labeling contents comprise: a weight value corresponding to the sample resource data;
training a preset neural network model by adopting sample data and labeling content, and learning the corresponding relation between the sample resource data and the use willingness value by the preset neural network model to obtain an analysis model.
Optionally, the generating a first virtual resource according to the target resource data includes:
generating task options according to the target resource data;
determining a target task according to a trigger operation acting on the task option;
acquiring operation data of the target task;
and when the operation data meet the preset conditions, generating a first virtual resource according to the target resource data.
Optionally, the method further comprises:
receiving a selected operation acting on a plurality of candidate first virtual resources;
determining at least two first virtual resources of the same type based on the selected operation;
calculating according to the resource data of the at least two first virtual resources and the preset probability to obtain fourth resource data;
and generating a second virtual resource according to the fourth resource data, and sending the second virtual resource to the requester.
In a second aspect, the present application provides a virtual resource generating apparatus, including:
the acquisition module is used for acquiring a data processing request, wherein the data processing request carries first resource data;
the analysis module is used for obtaining target resource data through analysis of the first resource data through a pre-trained analysis model;
the generation module is used for generating a first virtual resource according to the target resource data;
and the sending module is used for sending the first virtual resource to a requester.
In a third aspect, the present application provides an electronic device, including: the device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the above-mentioned method steps when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the above-mentioned method steps.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: on one hand, virtual resources can be more accurately issued according to the demands of users by acquiring the demands of the users, so that the shopping demands of the users are met, the participation of the users is improved, the access quantity of a platform is also improved, and therefore loss of the users is avoided.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present application based on the embodiments herein.
The embodiment of the application provides a virtual resource generation method, a device, electronic equipment and a storage medium. The method provided by the embodiment of the invention can be applied to any needed electronic equipment, for example, the electronic equipment can be a server, a terminal and the like, is not particularly limited, and is convenient to describe and is called as the electronic equipment for short hereinafter.
The following first describes a method for generating virtual resources according to an embodiment of the present invention.
Fig. 1 is a flowchart of a method for generating virtual resources according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S11, a data processing request is acquired, wherein the data processing request carries first resource data;
step S12, analyzing and obtaining target resource data according to the first resource data through a pre-trained analysis model;
step S13, generating a first virtual resource according to the target resource data;
step S14, the first virtual resource is issued to the requester.
According to the method provided by the embodiment, on one hand, the actual demands of the users can be positioned according to the received processing requests, and meanwhile, more accurate virtual resources can be generated for the users according to the resource data carried in the processing requests by adopting an analysis model, on the other hand, the addition of human judgment factors is avoided by automatically determining the resource data, and meanwhile, the labor cost is reduced.
In this embodiment, before acquiring the data processing request, the method further includes: and acquiring triggering operation acting on the registration interface, determining first resource data according to the triggering operation, generating corresponding tag content, receiving voice content, and generating a data processing request according to the first resource data when the voice information is matched with the tag content.
As one example, when a user logs into the electronic marketplace into the pickup interface, the domain interface includes: the plurality of resource data options receive triggering operation of the user based on the virtual resource options, determine first resource data according to the triggering operation, and generate tag content after determining the first resource data, for example: and receiving voice contents, analyzing the voice contents, and generating a data processing request according to the first resource data when the voice contents are matched with the tag contents.
It can be understood that when the voice content matches the tag content in this embodiment, the method includes: the voice content is the same as the tag content, for example, the tag content and the voice content are: 987987. or the voice content and the tag content conform to a preset relationship, for example: the label content is as follows: the solar incense burner generates purple smoke, and the voice content is as follows: the front river of the waterfall hanging is seen remotely.
In this embodiment, before the target resource data is obtained by analyzing the first resource data through the pre-trained analysis model, the method further includes: and acquiring a virtual resource acquisition record associated with the requesting party, determining acquisition failure times according to the virtual resource acquisition record, calculating acquisition probability according to the acquisition failure times, and inputting the first resource data into a pre-trained analysis model when the acquisition probability is smaller than or equal to a preset threshold value.
As an example, a user ID of a user may be first acquired, a virtual resource acquisition record associated with the user ID is acquired, and the number of acquisition failures is determined to be x, where the acquisition probability is: and x/(1+x), and inputting the first resource data into a pre-trained analysis model when the acquisition probability is smaller than or equal to a preset threshold value.
In this embodiment, obtaining target resource data by analyzing the first resource data through a pre-trained analysis model includes: the method comprises the steps of obtaining a pre-trained analysis model, inputting first resource data into the pre-trained analysis model, calculating by the analysis model according to the first resource data to obtain second resource data, determining attribute information of a user associated with a requester and third resource data corresponding to the attribute information, and weighting according to the second resource data and the third resource data to obtain target resource data. The attribute information of the user may be member information, consumption level, browsing duration, and the like.
In the prior art, functions of fitting each expense reduction value and corresponding transaction probability are adopted, user groups are divided into a plurality of classes based on the fitting functions and a plurality of preset parameters, and push virtual resources corresponding to each class of users are determined. However, the granularity of the model is larger, so that prediction and virtual resource release cannot be truly performed for each user, and the accuracy of generating virtual resources is lower. In addition, the cost of pushing the virtual resource also comprises a cost reduction value of the virtual resource in use. However, in the prior art, the cost caused by the actual use of the virtual resource is not considered, and the cost of pushing the virtual resource is easily too high.
Therefore, the target resource data is obtained by weighting the second resource data and the third resource data, so that the resource data which meets the requirements of the user can be more accurately calculated.
The training process of the analysis model in this embodiment is as follows: acquiring sample resource data and labeling contents corresponding to the sample resource data, wherein the labeling contents comprise: the weight value corresponding to the sample resource data, wherein the weight value can be a use intention value; training a preset neural network model by adopting sample data and labeling content, and learning the corresponding relation between the sample resource data and the weight value by the preset neural network model to obtain an analysis model.
As an example, in the training stage, the sample resource data is the usage data of the preset user, the sample resource data of the preset user is used as the input content of the analysis model, and the weight values of the preset user on various virtual resources are used as the labeling information, so that the supervised training of the analysis model is realized. When sample resource data of a preset user is input to an analysis model, the sample resource data of the sample user can be subjected to vector conversion to obtain a multi-dimensional vector, and each dimension corresponds to one type of specific information. It should be noted that any algorithm capable of converting text into vectors may be applied to the embodiments of the present invention, for example: word2vec algorithm. Here word2vec is a natural language processing algorithm that is characterized by vectorizing all words so that the relationship between words can be quantitatively measured and the relationship between words can be mined.
In addition, auxiliary information can be added to train the model, the auxiliary information can include user characteristics, such as the browsing duration of a user every day, the surfing duration of different users is personalized, and the values are disordered, such as 1 hour, 5 minutes, 45 minutes, 3 hours, 30 minutes and the like, and further assume that one node in a certain decision tree obtained through model training is: if the daily surfing time length exceeds 1 hour, the user characteristic is converted from the daily surfing time length to the user characteristic, if the daily surfing time length exceeds 1 hour, the characteristic value is 1, otherwise, the characteristic value is 0, and the time value of the continuously-changed surfing time length is converted into two characteristic values, namely 0 and 1.
It should be noted that the analysis model may be a decision tree model in a machine learning algorithm model. In addition, in the initial stage of training of the analysis model, an LR (Logistic Regression ) algorithm or an FM (factorization machine, factorizer) algorithm can be adopted; in the subsequent iterative training process, XGBoost (eXtreme Gradient Boosting) algorithm can be adopted. Among them, XGBoost is an existing algorithm library. In the embodiment of the invention, the weight value of the user to be predicted, which is predicted and obtained by using the analysis model realized by the decision tree model, on various sample resource data can be a number between 0 and 1.
Of course, in a specific application, the analysis model is not limited to a decision tree model in a machine learning algorithm model, but may also include other algorithm models in a machine learning algorithm model. For example: clustering algorithm models, bayesian classification models, support vector machine models, and the like. In addition, a deep learning algorithm model may also be employed as the analysis model in the embodiment of the present invention. Here, the deep learning algorithm model may include: convolutional neural networks, recurrent neural networks, multi-layer perceptrons, and the like.
In practical applications, multiple analysis models may be trained and stored, with each prediction model corresponding to a release scenario. Here, the distribution scenario differs mainly in that: different users to be predicted, and/or different types of virtual resources, and/or different numbers of each virtual resource. Therefore, by determining the issuing scene, the user to be predicted can be determined, and the analysis model corresponding to the application scene can be determined accordingly.
In this embodiment, generating the first virtual resource according to the target resource data includes: generating task options according to the target resource data, determining a target task according to triggering operation acting on the task options, acquiring operation data of the target task, and generating first virtual resources according to the target resource data when the operation data meet preset conditions.
As one example, the task options include; send links, voice passwords, etc., for example: when the target task is determined to be a transmission link according to the triggering operation acting on the task option, after the transmission of the transmission link is completed, acquiring a propagation path, acquiring operation data based on the propagation path, wherein the operation data comprises the browsing times of the link, and when the browsing times are greater than or equal to the preset times, generating a first virtual resource according to the target resource stock data.
In this embodiment, after the first virtual resource is obtained, the user lot associated with the virtual resource needs to be queried to determine the lot number. After determining the lot number, logically locking the lot number, wherein locking comprises: and judging whether the target user batch corresponding to the batch number is occupied by other virtual resource issuing tasks or not. If not occupied by other virtual resource issuing tasks, the lot number is locked so that the other virtual resource issuing tasks cannot use the target user lot, i.e., the locking is successful. However, if occupied by other virtual resource issuance tasks, then wait until the other virtual resource issuance tasks release the occupancy of the lot with the target user, i.e., the locking is unsuccessful.
It will be appreciated that an attempt to add a logical lock to a lot number continues with success, indicating that the lot is being occupied by other virtual resource templates and waiting for the release to continue execution. In particular, redis may be employed as a logical lock for different user batches, or by using Redis and MySQL to implement a logical lock. Redis is an open-source, high-performance key-value storage system. All key values of Redis are stored in the memory, and the single-machine read-write performance is high. Redis provides a richer data structure than other cache servers. However, this is merely an example, and a method may be employed to implement a logical lock, and those skilled in the art will recognize that the present invention is not limited thereto
Fig. 2 is a flowchart of a method for generating virtual resources according to another embodiment of the present application. As shown in fig. 2, the method further comprises the steps of:
step S21, receiving a selection operation acting on a plurality of candidate first virtual resources;
step S22, determining at least two first virtual resources of the same type based on the selected operation;
step S23, calculating according to the resource data of at least two first virtual resources and the preset probability to obtain fourth resource data;
and step S24, generating a second virtual resource according to the fourth resource data, and sending the second virtual resource to the requester.
According to the method provided by the embodiment, the selected candidate first virtual resources of the user are fused, and the virtual resources which more meet the user expectations are calculated according to the resource data of the candidate first virtual resources.
It will be appreciated that the same types in this embodiment refer to virtual resources that are both full-scale types or virtual resources that are both discounted types. According to the resource data of at least two first virtual resources and the preset probability, calculating to obtain fourth resource data, wherein the calculation mode is as follows:
D=H*EU+(1-H)*ES
wherein D is fourth resource data, H is a preset factor, EU is first preference data, and ES is target preference data.
In addition, when the virtual resource is issued, the embodiment of the application determines the data item of the virtual resource to be issued, wherein the data item comprises remark information, issuing time or recharging record, and the like, and then derives the corresponding virtual resource issuing record according to the data item, such as: the data item is remark information of the virtual resource issuing record, such as a mobile phone number, and the derived virtual resource issuing record is the virtual resource issuing record including the mobile phone number, and of course, the above is only an example, when the remark information is other information, information corresponding to the other information is also derived, and finally, a report is generated according to the derived virtual resource issuing record.
In this embodiment, when the virtual resource is queried, a corresponding virtual resource release record may be derived according to a user-defined data item, and finally a report is generated according to the derived virtual resource release record, so that the derived virtual resource release record is displayed in a form of a table, and flexibility of viewing the virtual resource release record is improved.
Fig. 3 is a block diagram of a virtual resource generating apparatus according to an embodiment of the present application, where the apparatus may be implemented as part or all of an electronic device by using software, hardware, or a combination of both. As shown in fig. 3, the apparatus includes:
an obtaining module 31, configured to obtain a data processing request, where the data processing request carries first resource data;
an analysis module 32, configured to obtain target resource data according to the first resource data through a pre-trained analysis model;
a generating module 33, configured to generate a first virtual resource according to the target resource data;
and the sending module 34 is configured to issue the first virtual resource to a requester corresponding to the data processing request.
The acquiring module in the embodiment of the present application is specifically configured to acquire a triggering operation acting on a registration interface, determine first resource data according to the triggering operation, generate corresponding tag content, receive voice content, and generate a data processing request according to the first resource data when the voice information matches with the tag content.
The device in the embodiment of the application further comprises a processing module, wherein the processing module is used for acquiring a virtual resource acquisition record associated with the requester; determining acquisition failure times according to the virtual resource acquisition record; calculating acquisition probability according to the acquisition failure times; and when the acquisition probability is smaller than or equal to a preset threshold value, inputting the first resource data into a pre-trained analysis model.
The analysis module is specifically used for acquiring a pre-trained analysis model; inputting the first resource data into a pre-trained analysis model, and calculating by the analysis model according to the first resource data to obtain second resource data; determining attribute information of a requester and third resource data corresponding to the attribute information; and weighting according to the second resource data and the third resource data to obtain target resource data.
The device in the embodiment of the application further comprises a training module, wherein the training module is used for acquiring sample data and labeling content corresponding to the sample data; training a preset neural network model by adopting sample data and labeling content to obtain an analysis model.
The analysis module is specifically configured to generate task options according to the target resource data; determining a target task according to trigger operation acting on task options; acquiring operation data of a target task; and when the operation data meet the preset conditions, generating a first virtual resource according to the target resource data.
Optionally, the apparatus in the embodiment of the present application further includes a synthesizing module, configured to receive a selected operation acting on a plurality of candidate first virtual resources; determining at least two first virtual resources of the same type based on the selected operation; calculating according to the resource data of at least two first virtual resources and the preset probability to obtain fourth resource data; and generating a second virtual resource according to the fourth resource data, and sending the second virtual resource to the requester.
The embodiment of the application further provides an electronic device, as shown in fig. 4, the electronic device may include: the device comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 are in communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501, when executing the computer program stored in the memory 1503, implements the steps of the above embodiments.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also Digital signal processors (Digital SignalProcessing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the following steps.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that, with respect to the apparatus, electronic device, and computer-readable storage medium embodiments described above, since they are substantially similar to the method embodiments, the description is relatively simple, and reference should be made to the description of the method embodiments for relevant points.
It is further noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.