User distribution based strategy recommendation method, device, equipment and medium

文档序号:1889431 发布日期:2021-11-26 浏览:4次 中文

阅读说明:本技术 基于用户分流的策略推荐方法、装置、设备及介质 (User distribution based strategy recommendation method, device, equipment and medium ) 是由 周珍珠 于 2021-08-31 设计创作,主要内容包括:本发明涉及数据处理领域,提供一种基于用户分流的策略推荐方法、装置、设备及介质,能够为构建的实验域配置域ID、实验层的层ID、策略ID,获取用户集中每个用户的用户ID及用户数量,从线程池中获取分流线程,利用分流线程并行处理每个用户的用户ID、域ID、每个层ID,得到至少一个目标数值,利用多线程同时执行任务,提高了任务的执行效率,利用至少一个目标数值在实验域中进行匹配计算得到目标策略,根据目标策略的策略ID生成并分析路径,得到策略推荐结果,进而通过一系列的数据处理自动执行策略推荐,快速识别出每个用户对应的策略。此外,本发明还涉及区块链技术,策略推荐结果可存储于区块链节点中。(The invention relates to the field of data processing, and provides a user shunt-based strategy recommendation method, device, equipment and medium, which can configure a domain ID, a layer ID of an experimental layer and a strategy ID for a constructed experimental domain, acquire a user ID and the number of users of each user in a user set, acquire a shunt thread from a thread pool, process the user ID, the domain ID and the layer ID of each user in parallel by using the shunt thread to obtain at least one target value, execute tasks simultaneously by using multiple threads, improve the execution efficiency of the tasks, perform matching calculation in the experimental domain by using the at least one target value to obtain a target strategy, generate and analyze a path according to the strategy ID of the target strategy to obtain a strategy recommendation result, and further automatically execute the strategy recommendation by a series of data processing to quickly identify the strategy corresponding to each user. In addition, the invention also relates to a block chain technology, and the strategy recommendation result can be stored in the block chain node.)

1. A strategy recommendation method based on user shunting is characterized by comprising the following steps:

constructing an experiment domain, wherein the experiment domain comprises experiment layers and strategies, configuring a domain ID for the experiment domain, configuring a layer ID for each experiment layer, and configuring a strategy ID for each strategy;

acquiring a pre-constructed user set, and acquiring a user ID of each user in the user set and the number of users in the user set;

creating a thread pool, and acquiring threads from the thread pool as shunting threads, wherein the number of the shunting threads is the same as that of the users;

the shunting thread is started in parallel, and the user ID, the domain ID and the layer ID of each user are processed by the shunting thread to obtain at least one target numerical value;

performing matching calculation in the experimental domain by using the at least one target value, and determining a matched strategy as at least one target strategy;

acquiring a strategy ID of the at least one target strategy, and generating at least one path according to the strategy ID of the at least one target strategy;

and analyzing the at least one path to obtain a strategy recommendation result.

2. The user offload-based policy recommendation method according to claim 1, wherein the constructing the experimental domain comprises:

creating at least one of the experimental layers for the experimental domain;

at least one policy is created for each experiment layer, wherein each policy corresponds to a bucket range, and the union of the bucket ranges of all policies on each experiment layer belongs to [0,100 ].

3. The user offloading-based policy recommendation method according to claim 1, wherein the obtaining a thread from the thread pool as an offloading thread comprises:

acquiring an idle thread in the thread pool;

acquiring the resource occupancy rate of each idle thread;

sequencing the idle threads according to the sequence of the resource occupancy rates from low to high to obtain a thread sequence;

and acquiring threads from the thread sequence as the shunting threads according to the sequence from front to back.

4. The user offloading-based policy recommendation method according to claim 1, wherein the processing the user ID, the domain ID, and each layer ID of each user by using the offloading thread to obtain at least one target value comprises:

randomly distributing the shunting thread to each user to obtain the thread of each user;

performing hash operation on the user ID, the domain ID and each layer ID of each user through the thread of each user to obtain a hash value of each user;

and calculating the quotient of the hash value of each user and a preset threshold value to obtain the at least one target value.

5. The user diversion-based policy recommendation method according to claim 2, wherein the performing matching calculation in the experimental domain using the at least one target value and determining the matched policy as the at least one target policy comprises:

acquiring a barrel position range of each experimental layer in the experimental domain;

detecting a bucket range of each target value in the at least one target value in each experimental layer, and determining the detected bucket range as a target bucket range of each target value in each experimental layer;

detecting a corresponding strategy of each target bucket position range in each experimental layer;

and combining the detected strategies to obtain the at least one target strategy.

6. The user diversion-based policy recommendation method according to claim 1, wherein the analyzing the at least one path to obtain a policy recommendation result comprises:

acquiring a user ID corresponding to each path;

determining a user corresponding to each path according to the user ID of each path;

calculating the number of users corresponding to each path;

acquiring a strategy ID on each path;

identifying a strategy corresponding to each path according to the strategy ID on each path;

integrating the users corresponding to each path, the number of the users corresponding to each path and the strategy corresponding to each path to obtain a strategy recommendation file corresponding to each path;

and converting the strategy recommendation file corresponding to each path into a specified format to obtain the strategy recommendation result.

7. The user diversion-based policy recommendation method according to claim 1, wherein after obtaining the policy recommendation result, the method further comprises:

when a policy to be verified is obtained, determining a path corresponding to the policy to be verified as a target path;

acquiring a target user corresponding to the target path;

detecting buried point data corresponding to the target user;

when the buried point data corresponding to the target user are matched with the target path, determining that the strategy to be verified passes verification; or

And when data in the buried point data corresponding to the target user is not matched with the target path, determining that the strategy to be verified is not verified.

8. A strategy recommendation device based on user distribution is characterized by comprising:

the system comprises a construction unit, a strategy configuration unit and a control unit, wherein the construction unit is used for constructing an experiment domain, the experiment domain comprises experiment layers and strategies, the experiment domain is configured with a domain ID, each experiment layer is configured with a layer ID, and each strategy is configured with a strategy ID;

the device comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for acquiring a pre-constructed user set and acquiring the user ID of each user in the user set and the user number of the users in the user set;

the creating unit is used for creating a thread pool and acquiring threads from the thread pool as shunting threads, wherein the number of the shunting threads is the same as the number of the users;

the processing unit is used for starting the shunting threads in parallel and processing the user ID, the domain ID and the layer ID of each user by using the shunting threads to obtain at least one target numerical value;

the calculation unit is used for performing matching calculation in the experimental domain by using the at least one target value and determining the matched strategy as at least one target strategy;

the generating unit is used for acquiring the strategy ID of the at least one target strategy and generating at least one path according to the strategy ID of the at least one target strategy;

and the analysis unit is used for analyzing the at least one path to obtain a strategy recommendation result.

9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the user offload based policy recommendation method according to any of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to execute the user offload based policy recommendation method according to any of claims 1 to 7.

Technical Field

The invention relates to the technical field of data processing, in particular to a user distribution-based strategy recommendation method, device, equipment and medium.

Background

The intelligent recommendation is focused on enabling service growth, advanced machine learning algorithms such as deep learning are adopted on the basis of user behavior data, personalized recommendation of 'thousands of people and thousands of faces' of users is achieved, user experience is improved, and core service indexes are continuously improved.

Recommended application scenes are scenes with large flow, such as information recommendation and the like, related workers can usually use an intelligent recommendation experiment platform to conduct various A/B experiments in order to explore the effect of a recommendation strategy on line, different shunting is conducted on users, and then the effects of different strategies are compared.

The above method usually requires a lot of experiments, not only is the efficiency low, but also the error rate is high due to the excessive dependence on manpower.

Disclosure of Invention

The embodiment of the invention provides a user distribution-based strategy recommendation method, device, equipment and medium, and aims to solve the problems of low strategy recommendation efficiency and high error rate.

In a first aspect, an embodiment of the present invention provides a policy recommendation method based on user offloading, including:

constructing an experiment domain, wherein the experiment domain comprises experiment layers and strategies, configuring a domain ID for the experiment domain, configuring a layer ID for each experiment layer, and configuring a strategy ID for each strategy;

acquiring a pre-constructed user set, and acquiring a user ID of each user in the user set and the number of users in the user set;

creating a thread pool, and acquiring threads from the thread pool as shunting threads, wherein the number of the shunting threads is the same as that of the users;

the shunting thread is started in parallel, and the user ID, the domain ID and the layer ID of each user are processed by the shunting thread to obtain at least one target numerical value;

performing matching calculation in the experimental domain by using the at least one target value, and determining a matched strategy as at least one target strategy;

acquiring a strategy ID of the at least one target strategy, and generating at least one path according to the strategy ID of the at least one target strategy;

and analyzing the at least one path to obtain a strategy recommendation result.

According to a preferred embodiment of the present invention, the constructing the experimental domain comprises:

creating at least one of the experimental layers for the experimental domain;

at least one policy is created for each experiment layer, wherein each policy corresponds to a bucket range, and the union of the bucket ranges of all policies on each experiment layer belongs to [0,100 ].

According to a preferred embodiment of the present invention, the obtaining a thread from the thread pool as a shunting thread includes:

acquiring an idle thread in the thread pool;

acquiring the resource occupancy rate of each idle thread;

sequencing the idle threads according to the sequence of the resource occupancy rates from low to high to obtain a thread sequence;

and acquiring threads from the thread sequence as the shunting threads according to the sequence from front to back.

According to a preferred embodiment of the present invention, the processing the user ID, the domain ID, and the layer ID of each user by using the forking thread to obtain at least one target value includes:

randomly distributing the shunting thread to each user to obtain the thread of each user;

performing hash operation on the user ID, the domain ID and each layer ID of each user through the thread of each user to obtain a hash value of each user;

and calculating the quotient of the hash value of each user and a preset threshold value to obtain the at least one target value.

According to a preferred embodiment of the present invention, the performing the matching calculation in the experimental domain by using the at least one target value, and determining the matched policy as the at least one target policy includes:

acquiring a barrel position range of each experimental layer in the experimental domain;

detecting a bucket range of each target value in the at least one target value in each experimental layer, and determining the detected bucket range as a target bucket range of each target value in each experimental layer;

detecting a corresponding strategy of each target bucket position range in each experimental layer;

and combining the detected strategies to obtain the at least one target strategy.

According to a preferred embodiment of the present invention, the analyzing the at least one path to obtain a policy recommendation result includes:

acquiring a user ID corresponding to each path;

determining a user corresponding to each path according to the user ID of each path;

calculating the number of users corresponding to each path;

acquiring a strategy ID on each path;

identifying a strategy corresponding to each path according to the strategy ID on each path;

integrating the users corresponding to each path, the number of the users corresponding to each path and the strategy corresponding to each path to obtain a strategy recommendation file corresponding to each path;

and converting the strategy recommendation file corresponding to each path into a specified format to obtain the strategy recommendation result.

According to a preferred embodiment of the present invention, after obtaining the policy recommendation result, the method further comprises:

when a policy to be verified is obtained, determining a path corresponding to the policy to be verified as a target path;

acquiring a target user corresponding to the target path;

detecting buried point data corresponding to the target user;

when the buried point data corresponding to the target user are matched with the target path, determining that the strategy to be verified passes verification; or

And when data in the buried point data corresponding to the target user is not matched with the target path, determining that the strategy to be verified is not verified.

In a second aspect, an embodiment of the present invention provides a policy recommendation device based on user offloading, including:

the system comprises a construction unit, a strategy configuration unit and a control unit, wherein the construction unit is used for constructing an experiment domain, the experiment domain comprises experiment layers and strategies, the experiment domain is configured with a domain ID, each experiment layer is configured with a layer ID, and each strategy is configured with a strategy ID;

the device comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for acquiring a pre-constructed user set and acquiring the user ID of each user in the user set and the user number of the users in the user set;

the creating unit is used for creating a thread pool and acquiring threads from the thread pool as shunting threads, wherein the number of the shunting threads is the same as the number of the users;

the processing unit is used for starting the shunting threads in parallel and processing the user ID, the domain ID and the layer ID of each user by using the shunting threads to obtain at least one target numerical value;

the calculation unit is used for performing matching calculation in the experimental domain by using the at least one target value and determining the matched strategy as at least one target strategy;

the generating unit is used for acquiring the strategy ID of the at least one target strategy and generating at least one path according to the strategy ID of the at least one target strategy;

and the analysis unit is used for analyzing the at least one path to obtain a strategy recommendation result.

In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the policy recommendation method based on user offloading according to the first aspect when executing the computer program.

In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the policy recommendation method based on user offloading according to the first aspect.

The embodiment of the invention provides a strategy recommendation method, a device, equipment and a medium based on user shunting, which can construct an experimental domain, wherein the experimental domain comprises experimental layers and strategies, a domain ID is configured for the experimental domain, a layer ID is configured for each experimental layer, a strategy ID is configured for each strategy, a pre-constructed user set is obtained, the user ID of each user in the user set and the user number of the users in the user set are obtained, a thread pool is created, threads are obtained from the thread pool as shunting threads, the number of the shunting threads is the same as the user number, the shunting threads are started in parallel, the user ID, the domain ID and the layer ID of each user are processed by the shunting threads to obtain at least one target value, and tasks can be executed simultaneously by multithreading by starting the shunting threads in parallel, the execution efficiency of the task is improved, the at least one target value is used for performing matching calculation in the experimental domain, the matched strategy is determined to be at least one target strategy, the strategy ID of the at least one target strategy is obtained, at least one path is generated according to the strategy ID of the at least one target strategy, the at least one path is analyzed, a strategy recommendation result is obtained, then the strategy recommendation is automatically executed through a series of data processing, and the strategy corresponding to each user is quickly identified.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic flowchart of a policy recommendation method based on user offloading according to an embodiment of the present invention;

fig. 2 is a schematic block diagram of a policy recommendation device based on user offloading according to an embodiment of the present invention;

FIG. 3 is a schematic block diagram of a computer device provided by an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

Fig. 1 is a schematic flow chart of a policy recommendation method based on user offloading according to an embodiment of the present invention.

S10, constructing an experiment domain, wherein the experiment domain comprises experiment layers and strategies, configuring domain IDs (Identity codes) for the experiment domains, configuring layer IDs for each experiment layer, and configuring strategy IDs for each strategy.

In this embodiment, an experimental domain may be constructed for each task field, or an experimental domain may be constructed for each product, such as: an experimental domain may be constructed for the information recommendation task, or an experimental domain may be constructed for a product a, which is not limited in the present invention.

Therefore, when the task field or the execution environment and the like change, the subsequent strategy recommendation or strategy verification can be continuously executed only by updating the domain ID of the experimental domain, and the execution efficiency is improved.

In at least one embodiment of the present invention, the constructing the experimental domain comprises:

creating at least one of the experimental layers for the experimental domain;

at least one policy is created for each experiment layer, wherein each policy corresponds to a bucket range, and the union of the bucket ranges of all policies on each experiment layer belongs to [0,100 ].

For example: the experimental domain may include a recall layer, a rough layer and a fine layer, wherein the recall layer includes a recall policy a and a recall policy B, a bucket range of the recall policy a may be configured as [0,35 ], a bucket range of the recall policy B may be configured as [35,100 ], the rough layer includes a rough policy a and a rough policy B, the bucket range of the rough policy a may be configured as [0,40 ], a bucket range of the recall policy B may be configured as [40,100 ], the fine layer includes a fine policy a and a fine policy B, the bucket range of the fine policy a may be configured as [0,60 ], and the bucket range of the recall policy B may be configured as [60,100 ].

Of course, in other embodiments, a traffic support layer may also be configured in the experimental domain, where the traffic support layer refers to a policy for relevant staff to recommend specified content according to hotspots and the like in specified time.

All the experimental layers have 100% of flow, and the strategy for creating different flow can be created only by adding all the flow in the corresponding experimental layer to no more than 100%, for example: 3 30% recall strategies, such as recall strategy a, recall strategy b and recall strategy c, can be created at the recall layer, which is 90% of the true flow and 10% of the empty flow. It is also possible to create 50% recall policy a, 30% recall policy b, 20% recall policy c, for a total of 100% traffic.

Through the implementation mode, a unified experimental domain is created for recommending the auxiliary strategy, and updating and management are facilitated.

S11, obtaining a user set constructed in advance, and obtaining the user ID of each user in the user set and the user number of the users in the user set.

In at least one embodiment of the invention, before obtaining the pre-constructed set of users, the method further comprises:

connecting to a designated platform at preset time intervals;

acquiring log data from the specified platform;

extracting user data in the log data;

and constructing the user set according to the user data.

The preset time interval may be configured by a user, for example, every 10 days, so as to implement periodic update of the user set.

It can be understood that many policy recommendation algorithms have strong correlation with the interests and behaviors of users, and the distribution of the interests and behaviors of real users cannot be simulated really by using virtual users, so that the logic of the related policy recommendation algorithms cannot be verified effectively.

In the embodiment, the problem that the recommended strategy is not matched with the user is effectively solved by acquiring the real user data as the data basis for the follow-up strategy recommendation.

S12, creating a thread pool, and acquiring threads from the thread pool as shunting threads, wherein the number of the shunting threads is the same as the number of the users.

In at least one embodiment of the present invention, the obtaining a thread from the thread pool as a split thread includes:

acquiring an idle thread in the thread pool;

acquiring the resource occupancy rate of each idle thread;

sequencing the idle threads according to the sequence of the resource occupancy rates from low to high to obtain a thread sequence;

and acquiring threads from the thread sequence as the shunting threads according to the sequence from front to back.

Through the implementation mode, the thread with the best performance can be selected from the created thread pool to execute the subsequent shunting task, and the execution effect of the task is further ensured.

S13, the shunting thread is started in parallel, and the user ID, the domain ID and the layer ID of each user are processed by the shunting thread to obtain at least one target value.

In the above embodiment, by starting the split threads in parallel, a task can be executed simultaneously by using multiple threads, and the execution efficiency of the task is improved.

In at least one embodiment of the present invention, the processing, by using the forking thread, the user ID, the domain ID, and the layer ID of each user to obtain at least one target value includes:

randomly distributing the shunting thread to each user to obtain the thread of each user;

performing hash operation on the user ID, the domain ID and each layer ID of each user through the thread of each user to obtain a hash value of each user;

and calculating the quotient of the hash value of each user and a preset threshold value to obtain the at least one target value.

The preset threshold may be configured by a user, such as 100.

In the above embodiment, the characteristics of the hash algorithm, i.e., infinite input and finite output, are used to make the target value calculated based on the user ID of each user unique.

And S14, performing matching calculation in the experimental domain by using the at least one target value, and determining the matched strategy as at least one target strategy.

Specifically, the performing matching calculation in the experimental domain by using the at least one target value, and determining the matched strategy as the at least one target strategy includes:

acquiring a barrel position range of each experimental layer in the experimental domain;

detecting a bucket range of each target value in the at least one target value in each experimental layer, and determining the detected bucket range as a target bucket range of each target value in each experimental layer;

detecting a corresponding strategy of each target bucket position range in each experimental layer;

and combining the detected strategies to obtain the at least one target strategy.

For example: taking the above example in mind, for the target value 38, matching with the bucket level range of each experimental layer, and determining that the bucket level range on the recall layer is [35,100 ], the method corresponds to the recall policy B; the bucket position range on the coarse exhaust layer is [0,40 ], and the bucket position range corresponds to the coarse exhaust strategy A; and if the bucket position range on the fine-ranking layer is [0,60 ], the fine-ranking strategy A is corresponding to. Further, the target policy corresponding to the target value 38 may be determined as follows: the recall strategy B, the rough ranking strategy A and the fine ranking strategy A.

Through the implementation mode, the corresponding strategy can be automatically matched by combining a hash algorithm.

S15, obtaining the strategy ID of the at least one target strategy, and generating at least one path according to the strategy ID of the at least one target strategy.

Specifically, the generating at least one path according to the policy ID of the at least one target policy includes:

determining the strategy ID belonging to the same user in the strategy ID of the at least one target strategy as a strategy group;

calling a sort function to sort the strategy IDs in each strategy group to obtain a sorting result corresponding to each user;

splicing the strategy IDs in the corresponding strategy groups according to the sequencing result corresponding to each user to obtain a path corresponding to each user;

and integrating the path corresponding to each user to obtain the at least one path.

For example: when a character string X is generated by concatenation, the character string X may be determined as a path and recorded as path _ key.

And S16, analyzing the at least one path to obtain a strategy recommendation result.

In at least one embodiment of the present invention, the analyzing the at least one path to obtain the policy recommendation result includes:

acquiring a user ID corresponding to each path;

determining a user corresponding to each path according to the user ID of each path;

calculating the number of users corresponding to each path;

acquiring a strategy ID on each path;

identifying a strategy corresponding to each path according to the strategy ID on each path;

integrating the users corresponding to each path, the number of the users corresponding to each path and the strategy corresponding to each path to obtain a strategy recommendation file corresponding to each path;

and converting the strategy recommendation file corresponding to each path into a specified format to obtain the strategy recommendation result.

In this embodiment, the specified format may be a txt format.

Of course, in other embodiments, the policy recommendation result may further include a traffic ratio.

For example: for the path '1372482059966201856,1372485205305307136,1372487988066627584', it is determined by analysis that the number of corresponding users is 'count': 4, the user IDs are 'IDs': 1041142818','1046816297','1041239090','1050175706', the policies corresponding to the policy IDs are' name ': all _ a', 'rank _ a', 'rerank _ b', and the traffic ratio is 'rate': 0.04.

Through the implementation mode, the strategy recommendation can be automatically executed through a series of data processing, and the strategy corresponding to each user can be quickly identified.

In at least one embodiment of the present invention, after obtaining the policy recommendation result, the method further includes:

when a policy to be verified is obtained, determining a path corresponding to the policy to be verified as a target path;

acquiring a target user corresponding to the target path;

detecting buried point data corresponding to the target user;

when the buried point data corresponding to the target user are matched with the target path, determining that the strategy to be verified passes verification; or

And when data in the buried point data corresponding to the target user is not matched with the target path, determining that the strategy to be verified is not verified.

The policy to be verified may include a new policy or a common policy.

It can be understood that when testing various types of recommendation strategies, especially for large traffic scenarios (e.g. with more than ten recommendation strategies), in order to verify a strategy, it is often necessary to try dozens of users to hit the strategy to be verified, and even sometimes more users are tried to miss the strategy to be verified. In addition, for newly added strategies, the amount may be only 1% or 5%, in which case it is more difficult to hit the relevant strategy.

In this embodiment, because the user set is continuously updated, when there is a newly added policy, the policy recommendation result is also updated synchronously, so that when there is a policy that needs to be verified, a user corresponding to the policy to be verified can be found by performing reverse-pushing on the policy recommendation result, and then whether data of the corresponding user completely satisfies the policy to be verified is detected in a targeted manner, so that accurate verification of the policy to be verified can be achieved, the verification efficiency is improved, and the problem of resource and time consumption caused by repeated experiments is avoided.

After verification, the strategy is verified in the original mode, and due to the fact that the problem that a user is randomly searched and the specified strategy is difficult to hit exists, verification time is usually 30 minutes, the time consumption can be reduced to 2 seconds by adopting the method for verifying the strategy, namely the user is locked within 2 seconds, whether the user meets the specified strategy is detected, and the verification efficiency of online production is effectively improved.

Therefore, the embodiment can be used for testing or development to assist relevant workers in quickly verifying a specific recommendation strategy.

It should be noted that, in order to further improve the security of the data and avoid malicious tampering of the data, the policy recommendation result may be stored in the blockchain node.

It can be seen from the above technical solutions that, in the present invention, an experimental domain is constructed, where the experimental domain includes experimental layers and policies, a domain ID is configured for the experimental domain, a layer ID is configured for each experimental layer, a policy ID is configured for each policy, a pre-constructed user set is obtained, a user ID of each user in the user set and the number of users in the user set are obtained, a thread pool is created, and a thread is obtained from the thread pool as a shunting thread, where the number of the shunting threads is the same as the number of users, the shunting thread is started in parallel, the user ID of each user, the domain ID, and each layer ID are processed by the shunting thread to obtain at least one target value, and by starting the shunting thread in parallel, a task can be executed simultaneously by using multiple threads, the execution efficiency of the task is improved, and the at least one target value is used for performing matching calculation in the experimental domain, and determining the matched strategy as at least one target strategy, acquiring a strategy ID of the at least one target strategy, generating at least one path according to the strategy ID of the at least one target strategy, analyzing the at least one path to obtain a strategy recommendation result, and then automatically executing strategy recommendation through a series of data processing to quickly identify the strategy corresponding to each user.

The embodiment of the invention also provides a user diversion-based policy recommendation device, which is used for executing any embodiment of the user diversion-based policy recommendation method. Specifically, referring to fig. 2, fig. 2 is a schematic block diagram of a policy recommendation device based on user offloading according to an embodiment of the present invention.

As shown in fig. 2, the policy recommendation apparatus 100 based on user offloading includes: the device comprises a construction unit 101, an acquisition unit 102, a creation unit 103, a processing unit 104, a calculation unit 105, a generation unit 106 and an analysis unit 107.

The construction unit 101 constructs an experiment domain, where the experiment domain includes experiment layers and policies, configures a domain ID (Identity code) for the experiment domain, configures a layer ID for each experiment layer, and configures a policy ID for each policy.

In this embodiment, an experimental domain may be constructed for each task field, or an experimental domain may be constructed for each product, such as: an experimental domain may be constructed for the information recommendation task, or an experimental domain may be constructed for a product a, which is not limited in the present invention.

Therefore, when the task field or the execution environment and the like change, the subsequent strategy recommendation or strategy verification can be continuously executed only by updating the domain ID of the experimental domain, and the execution efficiency is improved.

In at least one embodiment of the present invention, the constructing unit 101 constructs the experimental domain including:

creating at least one of the experimental layers for the experimental domain;

at least one policy is created for each experiment layer, wherein each policy corresponds to a bucket range, and the union of the bucket ranges of all policies on each experiment layer belongs to [0,100 ].

For example: the experimental domain may include a recall layer, a rough layer and a fine layer, wherein the recall layer includes a recall policy a and a recall policy B, a bucket range of the recall policy a may be configured as [0,35 ], a bucket range of the recall policy B may be configured as [35,100 ], the rough layer includes a rough policy a and a rough policy B, the bucket range of the rough policy a may be configured as [0,40 ], a bucket range of the recall policy B may be configured as [40,100 ], the fine layer includes a fine policy a and a fine policy B, the bucket range of the fine policy a may be configured as [0,60 ], and the bucket range of the recall policy B may be configured as [60,100 ].

Of course, in other embodiments, a traffic support layer may also be configured in the experimental domain, where the traffic support layer refers to a policy for relevant staff to recommend specified content according to hotspots and the like in specified time.

All the experimental layers have 100% of flow, and the strategy for creating different flow can be created only by adding all the flow in the corresponding experimental layer to no more than 100%, for example: 3 30% recall strategies, such as recall strategy a, recall strategy b and recall strategy c, can be created at the recall layer, which is 90% of the true flow and 10% of the empty flow. It is also possible to create 50% recall policy a, 30% recall policy b, 20% recall policy c, for a total of 100% traffic.

Through the implementation mode, a unified experimental domain is created for recommending the auxiliary strategy, and updating and management are facilitated.

The obtaining unit 102 obtains a user set constructed in advance, and obtains a user ID of each user in the user set and the number of users in the user set.

In at least one embodiment of the present invention, before a pre-constructed user set is obtained, a connection is made to a designated platform at preset time intervals;

acquiring log data from the specified platform;

extracting user data in the log data;

and constructing the user set according to the user data.

The preset time interval may be configured by a user, for example, every 10 days, so as to implement periodic update of the user set.

It can be understood that many policy recommendation algorithms have strong correlation with the interests and behaviors of users, and the distribution of the interests and behaviors of real users cannot be simulated really by using virtual users, so that the logic of the related policy recommendation algorithms cannot be verified effectively.

In the embodiment, the problem that the recommended strategy is not matched with the user is effectively solved by acquiring the real user data as the data basis for the follow-up strategy recommendation.

The creating unit 103 creates a thread pool, and acquires threads from the thread pool as split threads, where the number of the split threads is the same as the number of the users.

In at least one embodiment of the present invention, the creating unit 103, acquiring a thread from the thread pool as a split thread, includes:

acquiring an idle thread in the thread pool;

acquiring the resource occupancy rate of each idle thread;

sequencing the idle threads according to the sequence of the resource occupancy rates from low to high to obtain a thread sequence;

and acquiring threads from the thread sequence as the shunting threads according to the sequence from front to back.

Through the implementation mode, the thread with the best performance can be selected from the created thread pool to execute the subsequent shunting task, and the execution effect of the task is further ensured.

The processing unit 104 starts the shunting thread in parallel, and processes the user ID, the domain ID, and the layer ID of each user by using the shunting thread to obtain at least one target value.

In the above embodiment, by starting the split threads in parallel, a task can be executed simultaneously by using multiple threads, and the execution efficiency of the task is improved.

In at least one embodiment of the present invention, the processing unit 104 processes the user ID, the domain ID, and each layer ID of each user by using the splitting thread, and obtaining at least one target value includes:

randomly distributing the shunting thread to each user to obtain the thread of each user;

performing hash operation on the user ID, the domain ID and each layer ID of each user through the thread of each user to obtain a hash value of each user;

and calculating the quotient of the hash value of each user and a preset threshold value to obtain the at least one target value.

The preset threshold may be configured by a user, such as 100.

In the above embodiment, the characteristics of the hash algorithm, i.e., infinite input and finite output, are used to make the target value calculated based on the user ID of each user unique.

The calculation unit 105 performs a matching calculation in the experimental domain using the at least one target value, and determines a matched strategy as at least one target strategy.

Specifically, the calculating unit 105 performs matching calculation in the experimental domain by using the at least one target value, and determining the matched strategy as the at least one target strategy includes:

acquiring a barrel position range of each experimental layer in the experimental domain;

detecting a bucket range of each target value in the at least one target value in each experimental layer, and determining the detected bucket range as a target bucket range of each target value in each experimental layer;

detecting a corresponding strategy of each target bucket position range in each experimental layer;

and combining the detected strategies to obtain the at least one target strategy.

For example: taking the above example in mind, for the target value 38, matching with the bucket level range of each experimental layer, and determining that the bucket level range on the recall layer is [35,100 ], the method corresponds to the recall policy B; the bucket position range on the coarse exhaust layer is [0,40 ], and the bucket position range corresponds to the coarse exhaust strategy A; and if the bucket position range on the fine-ranking layer is [0,60 ], the fine-ranking strategy A is corresponding to. Further, the target policy corresponding to the target value 38 may be determined as follows: the recall strategy B, the rough ranking strategy A and the fine ranking strategy A.

Through the implementation mode, the corresponding strategy can be automatically matched by combining a hash algorithm.

The generating unit 106 obtains the policy ID of the at least one target policy, and generates at least one path according to the policy ID of the at least one target policy.

Specifically, the generating unit 106 generates at least one path according to the policy ID of the at least one target policy, including:

determining the strategy ID belonging to the same user in the strategy ID of the at least one target strategy as a strategy group;

calling a sort function to sort the strategy IDs in each strategy group to obtain a sorting result corresponding to each user;

splicing the strategy IDs in the corresponding strategy groups according to the sequencing result corresponding to each user to obtain a path corresponding to each user;

and integrating the path corresponding to each user to obtain the at least one path.

For example: when a character string X is generated by concatenation, the character string X may be determined as a path and recorded as path _ key.

The analyzing unit 107 analyzes the at least one path to obtain a policy recommendation result.

In at least one embodiment of the present invention, the analyzing unit 107 analyzes the at least one path, and obtaining the policy recommendation result includes:

acquiring a user ID corresponding to each path;

determining a user corresponding to each path according to the user ID of each path;

calculating the number of users corresponding to each path;

acquiring a strategy ID on each path;

identifying a strategy corresponding to each path according to the strategy ID on each path;

integrating the users corresponding to each path, the number of the users corresponding to each path and the strategy corresponding to each path to obtain a strategy recommendation file corresponding to each path;

and converting the strategy recommendation file corresponding to each path into a specified format to obtain the strategy recommendation result.

In this embodiment, the specified format may be a txt format.

Of course, in other embodiments, the policy recommendation result may further include a traffic ratio.

For example: for the path '1372482059966201856,1372485205305307136,1372487988066627584', it is determined by analysis that the number of corresponding users is 'count': 4, the user IDs are 'IDs': 1041142818','1046816297','1041239090','1050175706', the policies corresponding to the policy IDs are' name ': all _ a', 'rank _ a', 'rerank _ b', and the traffic ratio is 'rate': 0.04.

Through the implementation mode, the strategy recommendation can be automatically executed through a series of data processing, and the strategy corresponding to each user can be quickly identified.

In at least one embodiment of the invention, after a policy recommendation result is obtained, when a policy to be verified is obtained, a path corresponding to the policy to be verified is determined as a target path;

acquiring a target user corresponding to the target path;

detecting buried point data corresponding to the target user;

when the buried point data corresponding to the target user are matched with the target path, determining that the strategy to be verified passes verification; or

And when data in the buried point data corresponding to the target user is not matched with the target path, determining that the strategy to be verified is not verified.

The policy to be verified may include a new policy or a common policy.

It can be understood that when testing various types of recommendation strategies, especially for large traffic scenarios (e.g. with more than ten recommendation strategies), in order to verify a strategy, it is often necessary to try dozens of users to hit the strategy to be verified, and even sometimes more users are tried to miss the strategy to be verified. In addition, for newly added strategies, the amount may be only 1% or 5%, in which case it is more difficult to hit the relevant strategy.

In this embodiment, because the user set is continuously updated, when there is a newly added policy, the policy recommendation result is also updated synchronously, so that when there is a policy that needs to be verified, a user corresponding to the policy to be verified can be found by performing reverse-pushing on the policy recommendation result, and then whether data of the corresponding user completely satisfies the policy to be verified is detected in a targeted manner, so that accurate verification of the policy to be verified can be achieved, the verification efficiency is improved, and the problem of resource and time consumption caused by repeated experiments is avoided.

After verification, the strategy is verified in the original mode, and due to the fact that the problem that a user is randomly searched and the specified strategy is difficult to hit exists, verification time is usually 30 minutes, the time consumption can be reduced to 2 seconds by adopting the method for verifying the strategy, namely the user is locked within 2 seconds, whether the user meets the specified strategy is detected, and the verification efficiency of online production is effectively improved.

Therefore, the embodiment can be used for testing or development to assist relevant workers in quickly verifying a specific recommendation strategy.

It should be noted that, in order to further improve the security of the data and avoid malicious tampering of the data, the policy recommendation result may be stored in the blockchain node.

It can be seen from the above technical solutions that, in the present invention, an experimental domain is constructed, where the experimental domain includes experimental layers and policies, a domain ID is configured for the experimental domain, a layer ID is configured for each experimental layer, a policy ID is configured for each policy, a pre-constructed user set is obtained, a user ID of each user in the user set and the number of users in the user set are obtained, a thread pool is created, and a thread is obtained from the thread pool as a shunting thread, where the number of the shunting threads is the same as the number of users, the shunting thread is started in parallel, the user ID of each user, the domain ID, and each layer ID are processed by the shunting thread to obtain at least one target value, and by starting the shunting thread in parallel, a task can be executed simultaneously by using multiple threads, the execution efficiency of the task is improved, and the at least one target value is used for performing matching calculation in the experimental domain, and determining the matched strategy as at least one target strategy, acquiring a strategy ID of the at least one target strategy, generating at least one path according to the strategy ID of the at least one target strategy, analyzing the at least one path to obtain a strategy recommendation result, and then automatically executing strategy recommendation through a series of data processing to quickly identify the strategy corresponding to each user.

The above-mentioned policy recommendation apparatus based on user offloading may be implemented in the form of a computer program, which may be run on a computer device as shown in fig. 3.

Referring to fig. 3, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device 500 is a server, and the server may be an independent server or a server cluster composed of a plurality of servers. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.

Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.

The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.

Referring to fig. 3, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a storage medium 503 and an internal memory 504.

The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032, when executed, cause the processor 502 to perform a user diversion based policy recommendation method.

The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.

The internal memory 504 provides an environment for running the computer program 5032 in the storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute the policy recommendation method based on user offloading.

The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 3 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

The processor 502 is configured to run a computer program 5032 stored in the memory, so as to implement the policy recommendation method based on user offloading disclosed in the embodiment of the present invention.

Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 3 does not constitute a limitation on the specific construction of the computer device, and in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 3, and are not described herein again.

It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

In another embodiment of the invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a nonvolatile computer-readable storage medium or a volatile computer-readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the user offload based policy recommendation method disclosed in the embodiments of the present invention.

The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.

In the embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.

The invention is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.

In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.

While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于时间和地理位置的兴趣点推荐方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!