Maxdiff question type generation method based on backtracking method and dynamic adjustment method
By adopting the maxdiff problem-generating method based on backtracking method and dynamic adjustment method in market research, the error problems in the existing technology under large server performance consumption and high concurrency are solved, and the market research results with high accuracy and rapid display are achieved.
Patent Information
- Application Number
- CN202411491978.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-03-04
AI Technical Summary
When the existing technology uses the maxdiff method in market research, the server performance consumes a lot, data management is troublesome, and the error is large under high concurrency, so it is impossible to quickly display the situation where there are many attributes.
The maxdiff problem-type generation method based on backtracking method and dynamic adjustment method is adopted to achieve server interaction through front-end technology, and a uniformly distributed grouping result is generated to ensure uniform extraction and presentation of attributes.
It reduces server performance consumption and data management complexity, reduces errors in high concurrency situations, and achieves fast display and high accuracy market research results.
Smart Images

Figure CN119558907A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of questionnaire survey, and in particular to a maxdiff question type generation method based on a backtracking method and a dynamic adjustment method. Background Art
[0002] In market research, there are many research methods to let many respondents judge the popularity of certain attributes of a product. For example, when buying beverages, which factor is the most important and which is the least important. If there are only a few attributes, such as whether price or taste is more important, or whether taste or packaging is more important, the comparison method can be used. Just let each respondent compare and answer which one they like more, and then count which attribute the most people like. This is the simplest and most direct way, but it is only applicable when there are fewer attributes. If there are more attributes, the number of pairwise comparisons will be large, and the respondents will take longer to answer. If you want the respondents to answer the least number of times, the existing technology adopts the maxdiff method.
[0003] Maxdiff, also known as maximum difference measurement, is a commonly used method in market research. It asks respondents to point out the object that shows the greatest difference in preference from a group of objects. Take the purchase of beverages as an example. If there are T attributes, including price, taste, packaging, color, ingredients, spokesperson, etc., the maxdiff scheme will divide these attributes into M*N groups. Each attribute can appear multiple times. Respondents only need to answer N times, and each time they can choose the most and least favorite from M.
[0004] However, when the existing technology uses maxdiff to conduct market research, it is necessary to achieve the purpose of balance through overall server-side regulation. Interacting with the server consumes a lot of performance and it is also troublesome to manage data. If the server fails or there are many respondents and the concurrency is large, the overall error will be greater. In addition, when there are many visits and a large concurrency, the accuracy of the survey results will be greatly reduced. In addition, when there are many attributes, they cannot be displayed quickly in the browser. Summary of the invention
[0005] The present invention provides a maxdiff question type generation method based on backtracking method and dynamic adjustment method, which can achieve the purpose of uniform interviewees, uniform presentation positions and diverse content for each interviewee according to various attribute groupings, and solve the technical problems existing in the above-mentioned prior art.
[0006] To achieve the above purpose, an embodiment of the present invention provides a method for generating maxdiff question types based on a backtracking method and a dynamic adjustment method, comprising:
[0007] Get the number T of all the research attributes of the research product, select M research attributes from T each time for the user to choose, and set the number of selections to N times;
[0008] According to the values of T, M, and N, determine whether to use the backtracking method or the dynamic adjustment method to obtain the grouping result;
[0009] The resulting array is presented to the user for selection in combination with the interface design.
[0010] Furthermore, numerical thresholds are set for T, M, and N respectively in advance. When T, M, and N do not exceed the corresponding numerical thresholds, the backtracking method is used; otherwise, the dynamic adjustment method is used;
[0011] Among them, M represents the number of columns of the grouping result, and N represents the number of rows of the grouping result.
[0012] Furthermore, the steps of the backtracking method include:
[0013] Generate the first attribute pool, number all survey attributes, and calculate Get the minimum number of occurrences X of each survey attribute in the grouping results; if If there is no remainder, the first attribute pool is saturated; if If there is a remainder Y, then each research attribute is put into the first attribute pool X times, and Y research attributes are randomly selected from the T research attributes and put into the first attribute pool;
[0014] Determine in sequence from the first attribute pool the survey attributes that are allowed to appear at the current position in the grouping result;
[0015] After determining the survey attributes that are allowed to appear at the current position, the results are recorded in a two-dimensional array according to the row and column positions of the current position in the grouping result, and the execution path is recorded; at the same time, determining the survey attributes that are allowed to appear at the next position from the first attribute pool;
[0016] Set the maximum backtracking times threshold. When the backtracking times exceed the maximum backtracking times threshold, switch to the dynamic adjustment method.
[0017] Furthermore, the step of sequentially determining the survey attributes that are allowed to appear at the current position in the grouping result from the first attribute pool includes:
[0018] Take a research attribute from the first attribute pool;
[0019] Determine whether the current survey attribute is allowed to appear in the current row; if the current survey attribute has not appeared in the current row, it is allowed to appear in the current row; otherwise, take the next survey attribute from the first attribute pool;
[0020] Determine whether the current research attribute is allowed to appear in the current column; if the number of times the current research attribute appears in the current column is less than or equal to the maximum number of times other research attributes appear in the current column, it is allowed to appear in the current column; otherwise, take the next research attribute from the first attribute pool.
[0021] Determine whether the addition of the current research attribute belongs to the backtracking path; if it belongs to the backtracking path, take the next research attribute from the first attribute pool.
[0022] If there is no research attribute that meets the current position, record the backtracking path, backtrack to the previous position, and re-determine the research attribute at the previous position.
[0023] Furthermore, the backtracking path is recorded in an array, and whether it is a duplicate path is judged by the hash value of the array.
[0024] Furthermore, the steps of the dynamic adjustment method include:
[0025] Generate a second attribute pool and a first attribute priority pool, number all research attributes, and calculate to obtain the lowest number of times X that each research attribute appears in the grouping result; if there is no remainder, the second attribute pool is saturated and there is no need for the first attribute priority pool; if there is a remainder Y, then in the second attribute pool, each research attribute is placed X times, and Y research attributes are randomly selected from the T research attributes and placed in the first attribute priority pool;
[0026] Complete the selection of research attributes for each row in the grouping result;
[0027] Conduct adjustments to the research attributes within each row;
[0028] Conduct adjustments to the research attributes within the global scope.
[0029] Furthermore, the completion of the selection of research attributes for each row in the grouping result includes:
[0030] First, randomly select research attributes from the first attribute priority pool as the data in the current row. If Y≥M, the current row is full, and the selected research attributes are removed from the first attribute priority pool; if Y<M, the current row is not full, then select research attributes that are not included in the first attribute priority pool from the second attribute pool as the second priority attribute pool, and the second priority attribute pool does not contain duplicate research attributes. Randomly select these research attributes into the current row. If the current row is full at this time, the selected research attributes are removed from the second priority attribute pool, and the remaining research attributes in the second priority attribute pool are used as the data in the next row;
[0031] If a row is not full and the remaining research attributes in the second attribute pool have all appeared in this row, the research attributes between rows are exchanged from the previously allocated rows without destroying the row duplication principle.
[0032] Furthermore, the adjustment of the survey attributes within each industry includes:
[0033] The first row does not need to be adjusted. Adjustments should be made starting from the second row. First, all the survey attributes in each row are sorted from low to high according to the number of times they appear in the current column, and stored in an array variable;
[0034] In the same row, the current survey attribute is recorded as A, and the survey attribute to be exchanged is recorded as B. The column where A is located is recorded as the first attribute column, and the column where B is located is recorded as the second attribute column. When the number of times A appears in the first attribute column before the exchange is greater than the number of times B appears, the number of times A appears in the first attribute column after the exchange is greater than or equal to the number of times B appears, and the number of times A appears in the second attribute column after the exchange is less than the number of times A appears in the first attribute column, then A and B are exchanged;
[0035] According to the method of exchanging the positions of A and B, all rows are adjusted in sequence.
[0036] Furthermore, the global adjustment of the survey attributes includes:
[0037] Look at the entire result set, count the number of occurrences of each survey attribute in each column, and record them in a variable
[0038] Calculate the maximum value n allowed in each column, where n is the quotient of the number of rows N and the number of all survey attributes T, rounded upwards;
[0039] When the number of occurrences of a certain survey attribute in a column is greater than n, the position is searched globally for exchange.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] The technical solution of the present invention is applied in the maxdiff question type in the questionnaire survey platform, and is implemented based on the front-end technology of javascript. The purpose can be achieved without interacting with the server, avoiding the problems of poor server performance, troublesome data management, and a large number of data errors caused by server failures due to overall regulation of the server. At the same time, by combining the backtracking and dynamic adjustment methods, it is ensured that each attribute can be extracted as evenly as possible by many respondents, and each attribute can be evenly presented in different positions after being extracted. The backtracking method is used when there is no remainder or the remainder is relatively small, and the number of rows and columns to be presented is not large, so that the accuracy error is extremely low, and the remaining cases use a dynamic adjustment algorithm to be compatible with niche needs and abnormal situation processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only preferred embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 It is a method flow chart of a maxdiff question type generation method based on backtracking method and dynamic adjustment method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0045] Embodiment 1
[0046] Figure 1 This is a flowchart of a method for generating maxdiff questions based on backtracking and dynamic adjustment methods provided in the first embodiment of the present invention. This embodiment is applicable to scenarios of product market research.
[0047] Reference Figure 1 After entering T, M, and N, the questionnaire survey platform will determine the algorithm strategy and generate evenly distributed grouping results. Finally, the questionnaire survey platform will design the UI and generate question types.
[0048] The embodiment of the present invention provides a method for generating a maxdiff question type based on a backtracking method and a dynamic adjustment method, which intervenes in the grouping result of the question type generation by combining the backtracking method and the dynamic adjustment method, so that each survey attribute in the grouping result is evenly distributed in the group, and ensures that each attribute evenly appears in different positions in the row and different positions in the column. The method includes:
[0049] Get the number T of all the research attributes of the research product, select M research attributes from T each time for the user to choose, and set the number of selections to N times;
[0050] According to the values of T, M, and N, determine whether to use the backtracking method or the dynamic adjustment method to obtain the grouping result;
[0051] The resulting array is presented to the user for selection in combination with the interface design.
[0052] For example, a product has eight attributes: price, brand, taste, function, ingredients, spokesperson, packaging, and health. It is necessary to generate four attributes each time for users to choose their favorite and least favorite attributes, and make six choices. Then, the corresponding value of T is 8, the value of M is 4, and the value of N is 6. A variety of different grouping results can be generated. After the backtracking method or dynamic adjustment method, one grouping result can be:
[0053] First row: spokesperson, packaging, ingredients, flavors;
[0054] The second row: function, health, price, brand;
[0055] The third row: packaging, function, spokesperson, price;
[0056] The fourth row: brand, taste, health, ingredients;
[0057] The fifth row: health, brand, function, spokesperson;
[0058] Row 6: price, ingredients, taste, packaging.
[0059] It should be noted that the solution in this embodiment is implemented based on the front-end technology of javascript and is used in the maxdiff question type in the questionnaire survey platform. It does not need to interact with the server and is intended to generate a maxdiff question type for respondents to fill in for collection.
[0060] Maxdiff is used to measure the preferences of respondents for product attributes and is widely used in the field of market research. The approach is to ask respondents to point out the object that shows the greatest difference in preference from a group of objects. For example, the subjects need to point out the "best" and "worst" among several objects).
[0061] The criteria for judging the quality of a Maxdiff question type are: ensuring that each attribute can be extracted as evenly as possible by many respondents, and at the same time, each attribute can be evenly presented in different positions after being extracted. For example, if a product includes attributes such as price, taste, and packaging, there will be a problem if the price attribute appears much more often than the taste attribute. If the price attribute is always placed first and the taste attribute is always placed last, it is also unfair to the attributes. In addition, the answers of each respondent should be as different as possible to reduce interference.
[0062] Furthermore, numerical thresholds are set for T, M, and N respectively in advance. When T, M, and N do not exceed the corresponding numerical thresholds, the backtracking method is used; otherwise, the dynamic adjustment method is used;
[0063] Among them, M represents the number of columns of the grouping result, and N represents the number of rows of the grouping result.
[0064] T refers to the number of all survey attributes, such as price, taste, packaging and other survey attributes of the product; M refers to the number of options presented to users each time, and also represents the number of columns of the grouping results. Users need to select the most and least favorite from M each time; N refers to the number of times each user chooses, that is, the respondents need to answer N times, and also represents the number of rows of the grouping results.
[0065] Depending on the number of input rows, columns, and attributes, and the requirements of your own system for data and performance, choose a backtracking algorithm or a dynamic adjustment algorithm. The backtracking method is accurate, but it may be slow when the row and column attributes are large, while the dynamic adjustment algorithm generates quickly, but there is a certain sacrifice in the requirements for the data's position. The combination of the two can achieve the effect of fast speed and accurate data.
[0066] The steps of backtracking include:
[0067] Generate the first attribute pool, number all survey attributes, and calculate Get the minimum number of occurrences X of each survey attribute in the grouping results; if If there is no remainder, the first attribute pool is saturated; if If there is a remainder Y, then each research attribute is put into the first attribute pool X times, and Y research attributes are randomly selected from the T research attributes and put into the first attribute pool;
[0068] Determine the survey attributes that are allowed to appear at the current position from the first attribute pool in sequence;
[0069] After determining the survey attributes that are allowed to appear at the current position, the results are recorded in a two-dimensional array according to the positions of rows and columns, and the execution path is recorded; at the same time, the survey attributes that are allowed to appear at the next position are determined from the first attribute pool;
[0070] Set the maximum backtracking times threshold. When the backtracking times exceed the maximum backtracking times threshold, switch to the dynamic adjustment method.
[0071] The specific process of backtracking is as follows:
[0072] S101: Generate the first attribute pool to be used this time. First, number the survey attributes from 1 to t, then calculate the minimum number of times X used this time based on the product of the number of columns M and the number of rows N divided by the number of all survey attributes T, and then store the minimum number of times of each survey attribute into the first attribute pool. At this time, if there is no remainder, the first attribute pool is saturated. If there is a remainder Y at this time, Y survey attributes are randomly selected from the T survey attributes and put into the first attribute pool.
[0073] S102: determining in sequence from the first attribute pool the survey attributes that are allowed to appear at the current position in the grouping result.
[0074] Step S102 specifically includes:
[0075] S1021: Take a research attribute from the first attribute pool.
[0076] S1022: Determine whether the current survey attribute is allowed to appear in the current row; if the current survey attribute has not appeared in the current row, then it is allowed to appear in the current row; otherwise, take the next survey attribute from the first attribute pool;
[0077] Because duplication is not allowed within a row, if the row has appeared before, the attribute is not satisfied and the next one is taken from the attribute pool.
[0078] S1023: Determine whether the current survey attribute is allowed to appear in the current column; if the number of times the current survey attribute appears in the current column is less than or equal to the maximum number of times other survey attributes appear in the current column, it is allowed to appear in the current column; otherwise, take the next survey attribute from the first attribute pool.
[0079] Because maxdiff needs to try to ensure that an attribute does not always appear in a fixed position, it is necessary to verify whether the number of times the attribute appears in this column is less than or equal to the maximum number of times other elements in the column appear. For example, for the current attribute a, if attribute a appears twice in the column, but there is an attribute that appears three times, then the attribute passes the verification. However, if any other attribute does not appear twice in the column, then the attribute fails the verification and continues to take the next one from the attribute pool.
[0080] S1024: Determine whether the addition of the current survey attribute belongs to a backtracking path; if it belongs to a backtracking path, take the next survey attribute from the first attribute pool.
[0081] The trajectory of the program is the backtracking path. The backtracking path is recorded in an array, and the hash value of the array is used to determine whether it is a repeated path.
[0082] S1025: If there is no survey attribute that matches the current position, then the backtracking path is recorded, and backtracking is performed to the previous position to re-determine the survey attribute of the previous position.
[0083] If no qualified attribute can be found, record the backtracking path, and then backtrack to the most recent node with multiple optional attributes that has not been executed, and continue the above steps until it is found, because this must have a solution.
[0084] According to the above steps, all attributes that meet the verification are selected. Because they are of equal weight, the algorithm will randomly select one of the attributes with equal weight. This ensures that each respondent gets different options, which is more in line with the concept of maxdiff survey.
[0085] S103: After determining the survey attributes allowed to appear at the current position, record the results in a two-dimensional array according to the row and column positions of the current position in the grouping result, and record the execution path; at the same time, determine the survey attributes allowed to appear at the next position from the first attribute pool.
[0086] If an attribute that meets the conditions is found, the result is recorded in a two-dimensional array according to the row and column position of the current position in the grouping result, and the execution path is recorded, and the attribute selection of the next position is performed according to S102.
[0087] S104: Setting a maximum backtracking threshold. When the backtracking times exceed the maximum backtracking threshold, switching to a dynamic adjustment method.
[0088] Although the backtracking method must have a solution, due to the possibility of randomness in the middle, when the probability is extremely low, the number of backtracking times may be too large, affecting performance. After exceeding the set maximum number of backtracking times, the algorithm will switch to the dynamic adjustment method.
[0089] The steps of the dynamic adjustment method include:
[0090] Generate the second attribute pool and the first attribute priority pool, number all the survey attributes, and calculate Get the minimum number of occurrences X of each survey attribute in the grouping results; if If there is no remainder, the second attribute pool is saturated and the first attribute priority pool is not needed; if If there is a remainder Y, then each research attribute is placed X times in the second attribute pool, and Y research attributes are randomly selected from the T research attributes and placed in the first attribute priority pool;
[0091] Complete the selection of research attributes for each row;
[0092] Adjust the research attributes within each row;
[0093] Adjust the research attributes globally.
[0094] The process of the dynamic adjustment method is specifically as follows:
[0095] S201: Generate the second attribute pool and the first attribute priority pool required for this time. First, number the research attributes from 1 to t, then divide the product of the number of columns M and the number of rows N by the total number of research attributes T to calculate the minimum number of times X used this time. Then deposit the minimum number of times of each research attribute into the first attribute pool. At this time, if there is no remainder, the second attribute pool is saturated and no attribute priority pool is needed. If there is a remainder Y at this time, randomly select Y attributes from the T research attributes and put them into the attribute pool. Since the number of times these Y attributes appear will be one more than that of other research attributes, they are put into the first attribute priority pool.
[0096] S202: Complete the selection of research attributes for each row in the grouping result.
[0097] Step S202 specifically includes:
[0098] First, randomly select research attributes from the first attribute priority pool as the data in the current row. If Y≥M, the current row is full, and the selected research attributes are removed from the first attribute priority pool; if Y<M, the current row is not full, then select research attributes from the second attribute pool that are not included in the first attribute priority pool as the second priority attribute pool, and the second priority attribute pool does not contain duplicate research attributes. Randomly select these research attributes into the current row. If the current row is full at this time, remove the selected research attributes from the second priority attribute pool, and use the remaining research attributes in the second priority attribute pool as the data in the next row;
[0099] If a certain row is not full and all the remaining research attributes in the second attribute pool have already appeared in this row, then, under the principle of not destroying row repetition, exchange the research attributes between rows from the previously allocated rows.
[0100] In this way, the purpose of basically allocating all attributes, without row repetition and with balanced attribute occurrence times can be achieved. The current data result has achieved the purpose of balanced occurrence times and non-repeated rows. Only the balance of columns has not been adjusted yet. Without destroying the existing balance of rows, therefore, in-row adjustment can be given priority, and without cross-row adjustment, the columns can be made more balanced.
[0101] S203: Adjust the research attributes within each row.
[0102] The first row does not need to be adjusted. Adjustments should be made starting from the second row. First, all the survey attributes in each row are sorted from low to high according to the number of times they appear in the current column, and stored in an array variable;
[0103] In the same row, the current survey attribute is recorded as A, and the survey attribute to be exchanged is recorded as B, where the column where A is located is recorded as the first attribute column, and the column where B is located is recorded as the second attribute column. When the number of times A appears in the first attribute column before the exchange is greater than the number of times B appears, the number of times A appears in the first attribute column after the exchange is greater than or equal to the number of times B appears, and the number of times A appears in the second attribute column after the exchange is less than the number of times A appears in the first attribute column, then A and B are exchanged. For example: A appears 5 times in the first attribute column and 3 times in the second attribute column, while B appears 7 times in the first attribute column and 2 times in the second attribute column. Since the number of times A appears in the first attribute column before the exchange is less than the number of times B appears, they cannot be exchanged. If A appears 7 times in the first attribute column and 3 times in the second attribute column, and B appears 5 times in the first attribute column and 2 times in the second attribute column, after the swap, A appears 6 times in the first attribute column and 4 times in the second attribute column, and B appears 6 times in the first attribute column and 1 times in the second attribute column, then the number of times A appears in the first attribute column before the swap is greater than the number of times B appears, the number of times A appears in the first attribute column after the swap is greater than or equal to the number of times B appears, and the number of times A appears in the second attribute column after the swap is less than the number of times A appears in the first attribute column, so the positions can be swapped.
[0104] According to the method of exchanging the positions of A and B, all rows are adjusted in sequence.
[0105] After the dynamic adjustment in S203, column balancing has been well achieved. However, since there is a certain degree of randomness after each execution, a global supplementary adjustment is performed at the end. Since the supplementary adjustment is global, the number of adjustments can be limited according to one's own error rate.
[0106] S204: Adjust the survey attributes on a global scale.
[0107] Look at the entire result set, count the number of occurrences of each survey attribute in each column, and record them in a variable
[0108] Calculate the maximum value n allowed in each column, where n is the quotient of the number of rows N and the number of all survey attributes T, rounded up; for example: if the number of rows is 24 and the number of all survey attributes is 5, the result is 5.
[0109] When the number of occurrences of a certain survey attribute in a column is greater than n, the position is searched globally for exchange.
[0110] It should be noted that, firstly, the search process for the certain survey attribute needs to ensure that there is no infinite loop, that is, the current column is not a column that has been searched in this adjustment; secondly, the number of times the certain survey attribute appears in the column must be greater than the maximum number of times, otherwise there is no need to adjust; finally, the number of times the certain survey attribute appears in the column is the largest among all columns.
[0111] If such a survey attribute A exists, the target survey attribute B is searched for in the global scope to exchange the position. If such a survey attribute cannot be found, it is considered that the grouping result can be passed and successfully generated.
[0112] When searching for positions in the global scope, if a suitable target survey attribute B is found, the position is exchanged, with the following requirements: first, the row uniqueness cannot be destroyed after the adjustment; second, the number of occurrences of A and B in each column after the adjustment is less than or equal to n.
[0113] Following the above steps, if you can always find such a value, set a fixed maximum number of adjustments based on your own required error, and allow the number of adjustments to be exceeded.
[0114] The technical solution of the embodiment of the present invention combines backtracking and dynamic adjustment methods to ensure that each attribute can be extracted as evenly as possible by many respondents, and each attribute can be evenly presented in different positions after being extracted. The backtracking method is used when there is no remainder or the remainder is relatively small, and the number of rows and columns to be presented is not large, so that the accuracy error is extremely low, and the remaining cases use a dynamic adjustment algorithm to be compatible with niche needs and abnormal situation processing. At the same time, the algorithm implemented by the front-end technology of the technical solution of this embodiment based on javascript can achieve the purpose without interacting with the server, while other implementation schemes are all achieved by the overall regulation of the server side to achieve the purpose of balance. This type of scheme will consume a lot of performance when interacting with the server, and it is also troublesome to manage data. If the server fails or there are many respondents and the concurrency is large, the overall error will be greater; the technical solution of this embodiment can still maintain the property of low accuracy error rate of the result under the premise of ensuring various types of balance, under the condition of large number of visits and large concurrency; the technical solution of this embodiment has excellent execution performance, and can still ensure fast display in the browser when there are many attributes.
[0115] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating maxdiff question types based on backtracking and dynamic adjustment, characterized in that: Including: Obtain all the research attributes T of the research product, each time select M research attributes from T for the user to choose, and set the number of selections as N times; According to the values of T, M, and N, determine whether to use the backtracking method or the dynamic adjustment method to obtain the grouping result; Present the obtained result array to the user for selection in combination with the interface design.
2. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 1, characterized in that: Pre-set value thresholds for T, M, and N respectively. When T, M, and N do not exceed the corresponding value thresholds, use the backtracking method; otherwise, use the dynamic adjustment method; Among them, M represents the number of columns of the grouping result, and N represents the number of rows of the grouping result.
3. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 2, characterized in that: The steps of the backtracking method include: Generate the first attribute pool, number all survey attributes, and calculate Get the minimum number of occurrences X of each survey attribute in the grouping results; if If there is no remainder, the first attribute pool is saturated; if If there is a remainder Y, then each research attribute is put into the first attribute pool X times, and Y research attributes are randomly selected from the T research attributes and put into the first attribute pool; Successively determine the research attributes allowed to appear in the current position in the grouping result from the first attribute pool; After determining the research attributes allowed to appear in the current position, according to the row and column positions of the current position in the grouping result, record the results in a two-dimensional array and record the execution path; at the same time, determine the research attributes allowed to appear in the next position from the first attribute pool; Set the maximum backtracking times threshold. When the backtracking times exceed the maximum backtracking times threshold, switch to the dynamic adjustment method.
4. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 3, characterized in that: The step of successively determining the research attributes allowed to appear in the current position in the grouping result from the first attribute pool includes: Take a research attribute from the first attribute pool; Judge whether the current research attribute is allowed to appear in the current row; if the current research attribute has not appeared in the current row, it is allowed to appear in the current row; otherwise, take the next research attribute from the first attribute pool; Judge whether the current research attribute is allowed to appear in the current column; if the number of times the current research attribute appears in the current column is less than or equal to the maximum number of times other research attributes appear in the current column, it is allowed to appear in the current column; otherwise, take the next research attribute from the first attribute pool; Judge whether the addition of the current research attribute belongs to the backtracking path; if it belongs to the backtracking path, take the next research attribute from the first attribute pool; If there is no research attribute that meets the current position, record the backtracking path and backtrack to the previous position to re-determine the research attribute at the previous position.
5. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 4, characterized in that: The backtracking path is recorded in an array, and whether it is a duplicate path is judged by the hash value of the array.
6. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 2 or 3, characterized in that: The steps of the dynamic adjustment method include: Generate the second attribute pool and the first attribute priority pool, number all the survey attributes, and calculate Get the minimum number of occurrences X of each survey attribute in the grouping results; if If there is no remainder, the second attribute pool is saturated and the first attribute priority pool is not needed; if If there is a remainder Y, then each research attribute is placed X times in the second attribute pool, and Y research attributes are randomly selected from the T research attributes and placed in the first attribute priority pool; Complete the selection of research attributes for each row in the grouping result; Adjust the research attributes within each row; Adjust the research attributes globally.
7. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 6, characterized in that: The step of completing the selection of research attributes for each row in the grouping result includes: First, randomly select research attributes from the first attribute priority pool as the data in the current row. If Y≥M, the current row is full, and the selected research attributes are removed from the first attribute priority pool; if Y<M, the current row is not full, then select the research attributes that are not included in the first attribute priority pool from the second attribute pool as the second priority pool, and the second priority pool does not contain duplicate research attributes, and randomly select these research attributes into the current row. If the current row is full at this time, the selected research attributes are removed from the second priority pool, and the remaining research attributes in the second priority pool are used as the data in the next row; If a row is not full and the remaining research attributes in the second attribute pool have all appeared in this row, the research attributes between rows are exchanged from the previously allocated rows without destroying the row duplication principle.
8. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 6, characterized in that: The adjustments to the survey attributes within each industry include: The first row does not need to be adjusted. Adjustments should be made starting from the second row. First, all the survey attributes in each row are sorted from low to high according to the number of times they appear in the current column, and stored in an array variable; In the same row, the current survey attribute is recorded as A, and the survey attribute to be exchanged is recorded as B. The column where A is located is recorded as the first attribute column, and the column where B is located is recorded as the second attribute column. When the number of times A appears in the first attribute column before the exchange is greater than the number of times B appears, the number of times A appears in the first attribute column after the exchange is greater than or equal to the number of times B appears, and the number of times A appears in the second attribute column after the exchange is less than the number of times A appears in the first attribute column, then A and B are exchanged; According to the method of exchanging the positions of A and B, all rows are adjusted in sequence.
9. A method for generating maxdiff question types based on backtracking and dynamic adjustment as claimed in claim 6, characterized in that: The global adjustment of survey attributes includes: Look through the entire result set, count the number of occurrences of each survey attribute in each column, and record them in a variable; Calculate the maximum value n allowed in each column, where n is the quotient of the number of rows N and the number of all survey attributes T, rounded upwards; When the number of occurrences of a certain survey attribute in a column is greater than n, the position is searched globally for exchange.