Request diversion method and device

By selecting the version with the largest gap to request shunt and performing self-increase processing, the problems of uneven shunt and AB test interference in the prior art are solved, and the accuracy of uniform shunt and AB test is achieved.

CN112988559BActive Publication Date: 2025-01-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911301904.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-17
Publication Date
2025-01-10
Estimated Expiration
2039-12-17

AI Technical Summary

Technical Problem

The existing request shunt technology is limited by the user identification structure and hashing operation method, resulting in uneven shunt, interfering with the independence and accuracy of AB tests.

Method used

By selecting the version with the largest gap according to the number of assigned and preset user IDs in the version set, and self-increase the number of assigned user IDs of the target version, ensuring uniformity and dynamic balance of shunts.

Benefits of technology

It realizes uniform shunt according to the number of preset user IDs for each version, avoids the fixed shunt version, and ensures the independence and accuracy of AB tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988559B_ABST
    Figure CN112988559B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for diverting requests, and relates to the field of computer technology. A specific implementation of the method includes: receiving and parsing a request to obtain a user identifier; selecting a version with the largest difference from the version set as the target version according to the difference between the number of allocated user identifiers of each version in the version set and the preset number of user identifiers of each version; diverting the request to the target version, and performing self-increment processing on the number of allocated user identifiers of the target version according to the user identifier. This implementation evenly diverts according to the preset number of user identifiers of each version, is not limited to the user identifier and the hash operation method, and the version to which the request is diverted is not fixed, which does not interfere with the independence of AB testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a request diversion method and device. Background Art

[0002] The existing request diversion process: create a correspondence between remainders and versions according to the preset number of user identifiers for each version. Receive and parse the request to obtain the user identifier; perform a hash operation on the user identifier to obtain a hash value; perform a modulus operation on the hash value to obtain a remainder; and divert the request to the version corresponding to the remainder.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] Since there are many cases where the user identification structure is similar, and the randomness of the hash value is related to the hash operation method used, the existing technology implements uniform diversion according to the preset number of user identifications of each version, which is limited by the user identification and hash operation method. In addition, the version of the request diversion is fixed, which interferes with the independence of AB testing and affects the accuracy of AB testing. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a request diversion method and device, which evenly diverts requests according to the preset number of user identifiers of each version, is not limited by user identifiers and hash operation methods, and the versions to which the requests are diverted are not fixed, which does not interfere with the independence of AB testing and does not affect the accuracy of AB testing.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for dividing requests is provided.

[0007] The request diversion method of the embodiment of the present invention includes:

[0008] Receive and parse the request to obtain the user ID;

[0009] According to the difference between the number of user identifiers allocated to each version in the version set and the preset number of user identifiers of each version, a version with the largest difference is selected from the version set as the target version;

[0010] The request is distributed to the target version, and the number of allocated user identifiers of the target version is incremented according to the user identifier.

[0011] In one embodiment, according to the difference between the number of allocated user identifiers of each version in the version set and the preset number of user identifiers of each version, selecting a version with the largest difference from the version set as the target version includes:

[0012] Calculate the priority coefficient of each version according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version;

[0013] Determine whether the priority coefficients of the various versions are the same; if so, select one version from the version set as the target version; if not, select a version with the highest priority coefficient from the version set as the target version.

[0014] In one embodiment, calculating the priority coefficient of each version according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version includes:

[0015] Determine whether the number of user identifiers allocated to each version in the version set is the same as the preset number of user identifiers of each version; if so, clear the number of user identifiers allocated to each version and perform the first operation; if not, directly perform the first operation;

[0016] The first operation includes:

[0017] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0018] In one embodiment, calculating the priority coefficient of each version according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version includes:

[0019] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0020] In one embodiment, after the number of allocated user identifiers of the target version is incremented according to the user identifier, the following steps are included:

[0021] Determine a time to divert the request to the target version, and determine a first valid time period according to the time and a preset duration;

[0022] Diverting the requests received within the first valid time period to the target version, and the number of allocated user identifiers of the target version remains unchanged;

[0023] A second valid time period is determined according to the current time and the preset duration, and the first valid time period is replaced by the second valid time period.

[0024] In one embodiment, it further includes:

[0025] If the preset number of user identifiers of a version is equal to zero, any number in the negative number set is used as the priority coefficient of the version.

[0026] In one embodiment, the request is diverted to the target version, including:

[0027] The page information or data corresponding to the target version is sent to the sender of the request.

[0028] To achieve the above objective, according to another aspect of an embodiment of the present invention, a request diversion device is provided.

[0029] The request splitting device of the embodiment of the present invention includes:

[0030] A receiving unit, used for receiving and parsing the request to obtain a user identifier;

[0031] A first processing unit is used to select a version with the largest difference from the version set as the target version according to the difference between the number of user identifiers allocated to each version in the version set and the number of user identifiers preset for each version;

[0032] The second processing unit is used to distribute the request to the target version and to increment the number of allocated user identifiers of the target version according to the user identifier.

[0033] In one embodiment, the first processing unit is configured to:

[0034] Calculate the priority coefficient of each version according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version;

[0035] Determine whether the priority coefficients of the various versions are the same; if so, select one version from the version set as the target version; if not, select a version with the highest priority coefficient from the version set as the target version.

[0036] In one embodiment, the first processing unit is configured to:

[0037] Determine whether the number of user identifiers allocated to each version in the version set is the same as the preset number of user identifiers of each version; if so, clear the number of user identifiers allocated to each version and perform the first operation; if not, directly perform the first operation;

[0038] The first operation includes:

[0039] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0040] In one embodiment, the first processing unit is configured to:

[0041] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0042] In one embodiment, the second processing unit is configured to:

[0043] After the number of user identifiers allocated to the target version is incremented according to the user identifier, a time for diverting the request to the target version is determined, and a first valid time period is determined according to the time and a preset duration;

[0044] Diverting the requests received within the first valid time period to the target version, and the number of allocated user identifiers of the target version remains unchanged;

[0045] A second valid time period is determined according to the current time and the preset duration, and the first valid time period is replaced by the second valid time period.

[0046] In one embodiment, the first processing unit is configured to:

[0047] If the preset number of user identifiers of a version is equal to zero, any number in the negative number set is used as the priority coefficient of the version.

[0048] In one embodiment, the second processing unit is configured to:

[0049] The page information or data corresponding to the target version is sent to the sender of the request.

[0050] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0051] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the request diversion method provided by the embodiment of the present invention.

[0052] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0053] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the request diversion method provided by the embodiment of the present invention is implemented.

[0054] One embodiment of the above invention has the following advantages or beneficial effects: according to the difference between the number of user identifiers allocated to each version in the version set and the preset number of user identifiers of each version, a version with the largest difference is selected from the version set as the target version; and the request is diverted to the target version. Thus, the differences are balanced, and the requests are evenly diverted according to the preset number of user identifiers of each version, without being limited by the user identifier and the hash operation method, and the version to which the request is diverted is not fixed, which does not interfere with the independence of the AB test and does not affect the accuracy of the AB test.

[0055] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0057] Figure 1 is a schematic diagram of the main process of the request diversion method according to an embodiment of the present invention;

[0058] Figure 2 is a schematic diagram of main units of a request splitting device according to an embodiment of the present invention;

[0059] Figure 3 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0060] Figure 4 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0062] It should be pointed out that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0063] The following is a specific example to illustrate the prior art: the version set includes version A, version B, version C and version D, the preset number of user identifiers for version A is 10, the preset number of user identifiers for version B is 70, the preset number of user identifiers for version C is 10, and the preset number of user identifiers for version D is 10. The remainder is 0-9, corresponding to version A; the remainder is 10-79, corresponding to version B; the remainder is 80-89, corresponding to version C; the remainder is 90-99, corresponding to version D. Receive and parse the request to obtain the user identifier; perform a hash operation on the user identifier to obtain a hash value; perform a modulus operation on the hash value to obtain a remainder of 22; and divert the request to version B.

[0064] The case where the user identification structure is similar includes user accounts automatically generated in the same period or user accounts in the same region, etc. Therefore, the generated hash value is not random enough, and the requests sent by the user terminals of the user accounts automatically generated in the same period will be evenly diverted to the same version, or the requests sent by the user terminals of the user accounts in the same region will be evenly diverted to the same version, resulting in failure to evenly divert according to the preset number of user identifications of each version. In addition, different hash calculation methods generate different degrees of randomness of hash values. For hash calculation methods with low randomness of generated hash values, even diversion according to the preset number of user identifications of each version cannot be performed.

[0065] For requests sent by the same user terminal, the user ID remains unchanged, the hash value remains unchanged, and once the version set and the preset number of user IDs for each version in the version set are determined, the version to which the request is diverted remains unchanged regardless of whether the experiment changes. In this way, the independence of AB testing is interfered with and the accuracy of AB testing is affected. For example, Experiment 1: The preset number of user IDs for version A is 50, and the preset number of user IDs for version B is 50. Experiment 2: The preset number of user IDs for version A is 50, and the preset number of user IDs for version B is 50. Experiment 1 is aimed at optimizing the page title, and Experiment 2 is aimed at optimizing the page layout. For requests sent by the same user terminal, in Experiment 1, the request is diverted to version A, and in Experiment 2, the request is also diverted to version A.

[0066] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a request diversion method, such as Figure 1 As shown, the method includes:

[0067] Step S101: Receive and parse a request to obtain a user ID.

[0068] In this step, when implemented, the existing technology is used to parse the request to obtain the user identification. The user identification can be a user account or a device number of a device used by the user, etc. The user identification is unique. The device used by the user can be a user terminal.

[0069] Step S102: According to the difference between the number of allocated user identifiers of each version in the version set and the preset number of user identifiers of each version, a version with the largest difference is selected from the version set as the target version.

[0070] It should be noted that this step is described in detail below and will not be repeated here.

[0071] Step S103: Divert the request to the target version, and increment the number of allocated user identifiers of the target version according to the user identifier.

[0072] In this step, in order to ensure the atomicity of the update of the number of allocated user identifiers of the version, the incr command in Redis (full name Remote Dictionary Server, also known as remote dictionary service, which is an open source log-type, Key-Value database written in ANSI C language, supporting the network, memory-based and persistent, and providing APIs in multiple languages) is used to increment the number of allocated user identifiers of the target version. The user identifier and the target version are also stored in Redis, which has high reading efficiency. The details are shown in Table 1:

[0073]

[0074] Table 1

[0075] Specifically, the version identifier may be a version number.

[0076] It should be noted that if the diversion is to be terminated, it can be achieved in the following manner: pre-set the termination time, and continuously execute the process described in step S101, step S102 and step S103 until the current time is the same as the termination time, then stop executing.

[0077] In the embodiment of the present invention, step S102 includes:

[0078] Calculate the priority coefficient of each version according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version;

[0079] Determine whether the priority coefficients of the various versions are the same; if so, select one version from the version set as the target version; if not, select a version with the highest priority coefficient from the version set as the target version.

[0080] In this embodiment, the version set may be preset, for example, multiple versions involved in the AB test may be used as the version set.

[0081] Specifically, if the priority coefficients of the versions are the same, a version with a mark is selected from the version set as the target version. In addition, the version with the mark can be a version corresponding to the basic web page. The mark can be a special symbol or letter, etc.

[0082] If not, then select a version with the highest priority coefficient from the version set as the target version, including: If not, arrange the versions in descending order of their priority coefficients, and take the first version as the target version.

[0083] If there are at least two versions with the highest priority coefficients, one of the at least two versions with the highest priority coefficients is used as the target version.

[0084] In this embodiment, the priority coefficient of the version is used to keep the gaps balanced, and the requests are evenly distributed according to the preset number of user identifiers of each version. It is not limited by the user identifier and the hash operation method. The version to which the request is distributed is not fixed, which does not interfere with the independence of the AB test and does not affect the accuracy of the AB test.

[0085] In the embodiment of the present invention, the priority coefficient of each version is calculated according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version, including:

[0086] Determine whether the number of user identifiers allocated to each version in the version set is the same as the preset number of user identifiers of each version; if so, clear the number of user identifiers allocated to each version and perform the first operation; if not, directly perform the first operation;

[0087] The first operation includes:

[0088] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0089] In this embodiment, during specific implementation, as shown in Table 1, the preset number of user identifiers of each version and the number of allocated user identifiers of each version are stored in Redis to ensure applicability in a distributed deployment environment.

[0090] The following is a specific example to illustrate that the number of allocated user identifiers for each version in a version set is the same as the preset number of user identifiers for each version: the version set includes version A and version B, and the same means that the number of allocated user identifiers for version A is the same as the preset number of user identifiers for version A, and the number of allocated user identifiers for version B is the same as the preset number of user identifiers for version B.

[0091] If the number of assigned user identifiers for each version in the version set is 0, the expression for the version priority coefficient Ci is:

[0092] Ci=Ri / R;

[0093] Wherein, i represents any version in the version set; Ri represents the preset number of user identifiers of version i; and R represents the sum of the preset numbers of user identifiers of all versions.

[0094] It should be noted that the reason why the expression of the version priority coefficient Ci is: Ci=Ri / R in this case is because the number of allocated user identifiers of each version is 0, that is, Ni / N=0.

[0095] If the number of assigned user identifiers of at least one version in the version set is greater than 0, the expression of the version priority coefficient Ci is:

[0096] Ci=(Ri / R)-(Ni / N);

[0097] Among them, i represents any version in the version set; Ri represents the preset number of user identifiers of version i; R represents the sum of the preset number of user identifiers of each version; Ni represents the number of allocated user identifiers of version i; R represents the sum of the number of allocated user identifiers of each version.

[0098] It should be noted that the larger the priority coefficient of a version, the fewer requests will be diverted to that version, the smaller the number of user identifiers allocated to that version, and the larger the gap between the number of user identifiers allocated to that version and the number of user identifiers preset for that version. Therefore, requests will be diverted to the version with the largest priority coefficient. Similarly, as the number of user identifiers allocated to that version gradually increases, the priority coefficient of that version will gradually decrease, and the probability of that version being diverted will decrease, thereby achieving a dynamic balance effect, so that each diversion approaches the preset number of user identifiers for each version.

[0099] In this embodiment, if the number of user identifiers allocated to each version is the same as the number of user identifiers preset for each version, the number of user identifiers allocated to each version is reset to zero, so that traffic is evenly distributed according to the number of user identifiers preset for each version. The preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of each version to obtain a first value; the number of user identifiers allocated to the version is divided by the sum of the number of user identifiers allocated to each version to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version. Thus, the priority coefficient of each version is determined, and then the gaps are balanced, and traffic is evenly distributed according to the preset number of user identifiers of each version, which is not limited to the user identifier and the hash operation method, and the version to which the request is distributed is not fixed, which does not interfere with the independence of the AB test and does not affect the accuracy of the AB test.

[0100] In the embodiment of the present invention, the priority coefficient of each version is calculated according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version, including:

[0101] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0102] In this embodiment, the preset number of user identifiers of the version is divided by the sum of the preset number of user identifiers of each version to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated number of user identifiers of each version to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version. In this way, the priority coefficient of each version is determined, and the gaps are balanced. The traffic is evenly distributed according to the preset number of user identifiers of each version, which is not limited by the user identifier and the hash operation method. The version to which the request is distributed is not fixed, which does not interfere with the independence of the AB test and does not affect the accuracy of the AB test. In addition, the number of allocated user identifiers of the version can be used to determine the number of all allocated user identifiers of the version from the start of the test to the current time.

[0103] In the embodiment of the present invention, after the number of allocated user identifiers of the target version is incremented according to the user identifier, the following steps are included:

[0104] Determine a time to divert the request to the target version, and determine a first valid time period according to the time and a preset duration;

[0105] Diverting the requests received within the first valid time period to the target version, and the number of allocated user identifiers of the target version remains unchanged;

[0106] A second valid time period is determined according to the current time and the preset duration, and the first valid time period is replaced by the second valid time period.

[0107] In this embodiment, during specific implementation, the preset duration can be determined according to the business scenario. For example, the preset duration is 24 hours.

[0108] It should be noted that, for each request received within the first valid time period, it is executed according to the process described in this embodiment.

[0109] It should be understood that if the request is received outside the first valid time period, the process described in step S101, step S102 and step S103 is performed. In addition, in Redis, the Key is the user ID, and the Value is the target version ID obtained by this diversion.

[0110] In this embodiment, requests received within the first effective time period are not counted in the AB test, thereby expanding the user range and increasing the accuracy of the test. The first effective time period is replaced by the second effective time period, further expanding the user range and further increasing the accuracy of the test.

[0111] In an embodiment of the present invention, it also includes:

[0112] If the preset number of user identifiers of a version is equal to zero, any number in the negative number set is used as the priority coefficient of the version.

[0113] In this embodiment, during specific implementation, if Ri=0, then Ci=-1; wherein Ri represents the preset number of user identifiers of version i, and Ci represents the priority coefficient of version i.

[0114] It should be noted that if the preset number of user identifiers of a version is greater than zero, the priority coefficient of the version is greater than or equal to zero, and zero is greater than any negative number, while the priority coefficients of all versions in the version set cannot all be negative numbers. Therefore, the version with a preset number of user identifiers equal to zero cannot be selected as the target version, and it is impossible for any request to be diverted to the version with a preset number of user identifiers equal to zero.

[0115] Of course, the effect of this embodiment can also be achieved even if the version set does not include a version in which the number of preset user identifiers is equal to zero.

[0116] In this embodiment, if the preset number of user identifiers of a version is zero, any number in the negative number set is used as the priority coefficient of the version, ensuring that requests are not diverted to the version, and increasing the accuracy of evenly diverting requests according to the preset number of user identifiers of each version.

[0117] In the embodiment of the present invention, the request is diverted to the target version, including:

[0118] The page information or data corresponding to the target version is sent to the sender of the request.

[0119] It should be noted that the sender of the request may be a user terminal.

[0120] The idea of ​​the embodiment of the present invention is to dynamically adjust the current shunted version through the difference between the preset number of user identifiers of each version and the number of allocated user identifiers of each version, so that the number of allocated user identifiers of each version is constantly close to the preset number of user identifiers of each version. The shunting method is not limited to the user identifier and the hash operation method, and can be evenly shunted according to the preset number of user identifiers of each version, without interfering with the independence of AB testing, and the test is more flexible.

[0121] It should be noted that performing hash operation on the AB test identifier and the user identifier together can, to a certain extent, not interfere with the independence of the AB test and do not affect the accuracy of the AB test.

[0122] Hash, also known as hash, hash or hash, is a function that transforms an input of arbitrary length (also called pre-image) into an output of fixed length through a hash algorithm. The output is the hash value. This conversion is a compression mapping, that is, the space of hash values ​​is usually much smaller than the space of inputs. Different inputs may hash to the same output, so it is impossible to determine the unique input value from the hash value. Simply put, it is a function that compresses a message of arbitrary length into a message digest of a fixed length.

[0123] If you can't measure, you can't optimize. For Internet products, such as recommendation systems, applications, or website systems, updates and iterations need to establish a set of measurement mechanisms to control the optimization direction. AB testing (also known as ABtest, ABtest is not only a powerful tool for recommendation iteration, it can also serve all product iterations that need to be gradually improved) is a tool for variable control and optimization direction selection. Refined iteration is a way of thinking based on data - getting better results with less cost. There is no need for optimization without data, and diversion is the only way to optimize.

[0124] In network analysis, AB testing is a random experiment, usually with two variants, A and B. The test uses the control variable method to maintain a single variable, compares the A data with the B data, and draws a conclusion. AB testing is a scientific method of using data to prove the feasibility of a solution, and is widely used on websites. AB testing experiments on iterative solutions, combines data for analysis, reversely re-verifies and drives solutions. It is a process of discovering problems, proposing hypotheses, verifying conjectures, and continuously optimizing. The recommendation method must be continuously verified by experiments, and the verification process is also to verify the data, thereby optimizing the recommendation system strategy and ultimately improving user additions and retention.

[0125] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a request flow distribution device, such as Figure 2 As shown, the device comprises:

[0126] The receiving unit 201 is used to receive and parse the request to obtain a user identifier.

[0127] The first processing unit 202 is configured to select a version with the largest difference between the number of allocated user identifiers of each version in the version set and the preset number of user identifiers of each version as the target version.

[0128] The second processing unit 203 is used to distribute the request to the target version, and to increment the number of allocated user identifiers of the target version according to the user identifier.

[0129] In the embodiment of the present invention, the first processing unit 202 is used for:

[0130] Calculate the priority coefficient of each version according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version;

[0131] Determine whether the priority coefficients of the various versions are the same; if so, select one version from the version set as the target version; if not, select a version with the highest priority coefficient from the version set as the target version.

[0132] In the embodiment of the present invention, the first processing unit 202 is used for:

[0133] Determine whether the number of user identifiers allocated to each version in the version set is the same as the preset number of user identifiers of each version; if so, clear the number of user identifiers allocated to each version and perform the first operation; if not, directly perform the first operation;

[0134] The first operation includes:

[0135] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0136] In the embodiment of the present invention, the first processing unit 202 is used for:

[0137] For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

[0138] In the embodiment of the present invention, the second processing unit 203 is used for:

[0139] After the number of user identifiers allocated to the target version is incremented according to the user identifier, a time for diverting the request to the target version is determined, and a first valid time period is determined according to the time and a preset duration;

[0140] Diverting the requests received within the first valid time period to the target version, and the number of allocated user identifiers of the target version remains unchanged;

[0141] A second valid time period is determined according to the current time and the preset duration, and the first valid time period is replaced by the second valid time period.

[0142] In the embodiment of the present invention, the first processing unit 202 is used for:

[0143] If the preset number of user identifiers of a version is equal to zero, any number in the negative number set is used as the priority coefficient of the version.

[0144] In the embodiment of the present invention, the second processing unit 203 is used for:

[0145] The page information or data corresponding to the target version is sent to the sender of the request.

[0146] It should be understood that the functions performed by the various components of the request diversion device provided in the embodiment of the present invention have been introduced in detail in the request diversion method of the above embodiment, and will not be repeated here.

[0147] Figure 3 An exemplary system architecture 300 is shown to which the request offloading method or request offloading apparatus according to the embodiment of the present invention can be applied.

[0148] like Figure 3 As shown, the system architecture 300 may include terminal devices 301, 302, 303, a network 304 and a server 305. The network 304 is used to provide a medium for communication links between the terminal devices 301, 302, 303 and the server 305. The network 304 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0149] Users can use terminal devices 301, 302, 303 to interact with server 305 through network 304 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 301, 302, 303, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0150] The terminal devices 301 , 302 , and 303 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0151] The server 305 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 301, 302, and 303. The backend management server may analyze and process the received product information query request and other data, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0152] It should be noted that the request diversion method provided in the embodiment of the present invention is generally executed by the server 305 , and accordingly, the request diversion device is generally set in the server 305 .

[0153] It should be understood that Figure 3 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0154] Reference below Figure 4 , which shows a schematic diagram of the structure of a computer system 400 of a terminal device suitable for implementing an embodiment of the present invention. Figure 4 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0155] like Figure 4 As shown, the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the system 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0156] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.

[0157] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above-mentioned functions defined in the system of the present invention are executed.

[0158] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0159] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0160] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, it may be described as: a processor includes a receiving unit, a first processing unit, and a second processing unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the receiving unit may also be described as "a unit that receives and parses a request and obtains a user identifier".

[0161] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving and parsing a request to obtain a user identifier; according to the difference between the number of user identifiers allocated to each version in the version set and the preset number of user identifiers of each version, selecting a version with the largest difference from the version set as the target version; diverting the request to the target version, and incrementing the number of user identifiers allocated to the target version according to the user identifier.

[0162] According to the technical solution of the embodiment of the present invention, according to the difference between the number of allocated user identifiers of each version in the version set and the preset number of user identifiers of each version, a version with the largest difference is selected from the version set as the target version; and the request is diverted to the target version. In this way, the differences are balanced, and the requests are evenly diverted according to the preset number of user identifiers of each version, without being limited by the user identifier and the hash operation method. The version to which the request is diverted is not fixed, which does not interfere with the independence of the AB test and does not affect the accuracy of the AB test.

[0163] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A request diversion method, characterized in that: include: Receive and parse the request to obtain the user ID; According to the difference between the number of user identifiers allocated to each version in the version set and the preset number of user identifiers of each version, a version with the largest difference is selected from the version set as the target version, including: Calculating the priority coefficient of each version according to the number of user identifiers allocated to each version in the version set and the number of preset user identifiers of each version, including: for each version, dividing the number of preset user identifiers of the version by the sum of the numbers of preset user identifiers of each version to obtain a first value; dividing the number of user identifiers allocated to the version by the sum of the numbers of user identifiers allocated to each version to obtain a second value; and using the difference between the first value and the second value as the priority coefficient of the version; Determine whether the priority coefficients of the various versions are the same; if so, select a version from the version set as the target version; if not, select a version with the highest priority coefficient from the version set as the target version; The request is distributed to the target version, and the number of allocated user identifiers of the target version is incremented according to the user identifier.

2. The method according to claim 1, characterized in that Calculating the priority coefficient of each version according to the number of allocated user identifiers of each version in the version set and the number of preset user identifiers of each version includes: Determine whether the number of user identifiers allocated to each version in the version set is the same as the preset number of user identifiers of each version; if so, clear the number of user identifiers allocated to each version and perform the first operation; if not, directly perform the first operation; The first operation includes: For each version, the preset number of user identifiers of the version is divided by the sum of the preset numbers of user identifiers of all versions to obtain a first value; the number of allocated user identifiers of the version is divided by the sum of the allocated numbers of user identifiers of all versions to obtain a second value; the difference between the first value and the second value is used as the priority coefficient of the version.

3. The method according to claim 1, characterized in that After the number of allocated user identifiers of the target version is incremented according to the user identifier, the method further includes: Determine a time to divert the request to the target version, and determine a first valid time period according to the time and a preset duration; Diverting the requests received within the first valid time period to the target version, and the number of allocated user identifiers of the target version remains unchanged; A second valid time period is determined according to the current time and the preset duration, and the first valid time period is replaced by the second valid time period.

4. The method according to claim 1 or 2, characterized in that: Also includes: If the preset number of user identifiers of a version is equal to zero, any number in the negative number set is used as the priority coefficient of the version.

5. The method according to claim 1, characterized in that Diverting the request to the target version includes: The page information or data corresponding to the target version is sent to the sender of the request.

6. A request diversion device, characterized in that: include: A receiving unit, used for receiving and parsing the request to obtain a user identifier; The first processing unit is configured to select a version with the largest difference between the number of user identifiers allocated to each version in the version set and the number of user identifiers preset for each version from the version set as the target version, including: Calculating the priority coefficient of each version according to the number of user identifiers allocated to each version in the version set and the number of preset user identifiers of each version, including: for each version, dividing the number of preset user identifiers of the version by the sum of the numbers of preset user identifiers of each version to obtain a first value; dividing the number of user identifiers allocated to the version by the sum of the numbers of user identifiers allocated to each version to obtain a second value; and using the difference between the first value and the second value as the priority coefficient of the version; Determine whether the priority coefficients of the various versions are the same; if so, select a version from the version set as the target version; if not, select a version with the highest priority coefficient from the version set as the target version; The second processing unit is used to distribute the request to the target version and to increment the number of allocated user identifiers of the target version according to the user identifier.

7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method for issuing application gray level, device and storage medium

    CN107145347A

  • A method and apparatus for an A / B test experiment

    CN109308255A