Disclosure of Invention
The present invention has been made in view of the above-described problems occurring in the prior art.
Therefore, the invention provides a one-product multi-code scene support method for solving the problem that a scoring model depends on fixed weight distribution and cannot flexibly adapt to different business scene requirements.
In order to solve the technical problems, the invention provides the following technical scheme:
In a first aspect, the present invention provides a one-to-many code scene support method, comprising,
Collecting different codes of the same commodity, multidimensional attribute data and user behavior data of the codes through an interface, and calculating according to the user behavior data to obtain the similarity between users;
carrying out standardization processing on all collected data to obtain a fusion data set;
selecting scoring core dimensions from the fusion data set by using a atlas analysis method, distributing initial weights, constructing a commodity scoring model to obtain comprehensive scores of each commodity code, and sequencing the commodity codes at the same time;
Optimizing the comprehensive scores of commodity codes, combining the similarity among users to obtain the weight of the optimized core dimension, and updating the ordering of the commodities;
according to the updated commodity code sequence, the mapping relation of commodity codes is adjusted in real time;
And formulating a multi-scene priority rule, and applying the multi-scene priority rule to the functional module based on the priority scores of commodity codes. As a preferable scheme of the one-article multi-code scene supporting method, different codes of the same commodity comprise UPC, EAN and internal codes, the multi-dimensional attribute data comprise stock state, movable sales state, saleable state, shelf state, geographic position, historical sales and commodity classification, and the user behavior data comprise user ID, purchase history, browsing records, clicking behaviors, residence time and behavior occurrence time;
and constructing a user-commodity matrix by using the user behavior data, and obtaining the similarity between the users by using a collaborative filtering algorithm according to the user-commodity matrix.
As a preferable scheme of the one-article multi-code scene supporting method, the invention comprises the following steps of carrying out standardization processing on all collected data to obtain a fusion data set,
The standardized processing refers to data cleaning of different codes of unified commodities and formats, units and fields of corresponding multidimensional attribute data;
And merging the standardized data into a central database to form a fusion data set.
As a preferable scheme of the one-article multi-code scene supporting method, the invention uses a atlas analysis method to select scoring core dimensions from a fusion data set and assign initial weights, and specifically comprises the following steps,
Setting each data in the fusion data set as a node, and constructing edges between the nodes by using pearson correlation coefficients;
assigning an initial importance score to each node, iteratively updating the importance score of each node by using a PageRank algorithm, performing community detection by using a Louvain algorithm, and selecting the node with the highest PageRank score from each community as a core dimension;
Each core dimension is assigned a respective weight.
As a preferable scheme of the one-article multi-code scene supporting method, the invention comprises the steps of constructing a commodity grading model to obtain the comprehensive grade of each commodity code, sequencing the commodity codes at the same time,
Calculating the grading value of each core dimension according to the obtained core dimension;
Based on the obtained scoring value of the core dimension and the corresponding weight, obtaining the comprehensive scoring of the commodity codes in a linear combination mode;
And sorting from high to low according to the calculated comprehensive score of each commodity code, and selecting the commodity with the highest comprehensive score for preferential display corresponding to the commodity code.
The invention is used as a preferable scheme of the one-article multi-code scene supporting method, wherein, the comprehensive score of commodity codes is optimized to obtain the weight of the optimized core dimension, and the sequencing of commodity codes is updated, which comprises the following steps,
Determining sales as business indexes, and collecting sales of commodities corresponding to each commodity code;
the business index of each commodity code is predicted using a linear regression algorithm based on the composite score of the commodity code,
Calculating the error between the actual service index and the predicted service index, and simultaneously applying an activation function to make the error non-negative;
Predicting interest scores of users on the non-contacted commodities based on the similarity between the users;
according to the error between the actual service index and the predicted service index and the interest score of the user, introducing a learning rate to control the adjustment amplitude and adjusting the weight of the core dimension;
and (3) recalculating the comprehensive score of each commodity code based on the core dimension after the weight is adjusted, and updating and sorting according to the comprehensive score to obtain a personalized commodity score display list.
As a preferable scheme of the one-article multi-code scene supporting method, the invention adjusts the normalized commodity mapping relation in real time according to the updated commodity code sequence,
Displaying the commodities corresponding to the updated commodity codes according to the arrangement sequence, and simultaneously monitoring the core dimension change of the commodity codes;
When the change of the core dimension is detected, the core dimension of the commodity code is immediately updated, the latest core dimension is used for calculating the comprehensive score of the commodity code again, and meanwhile, the commodity codes are reordered;
And updating the commodities corresponding to the reordered commodity codes to the displayed commodity list in real time.
The invention is used as a preferable scheme of the one-article multi-code scene supporting method, wherein, a multi-scene priority rule is formulated and applied to a functional module based on the priority score of commodity codes, and the method specifically comprises the following steps,
Making a multi-scene priority rule according to service requirements, constructing commodity scoring models applicable to multiple scenes, and applying the commodity scoring models to the functional modules;
According to the function module selected by the user, calling a corresponding commodity scoring model to obtain a commodity display result pointed by the corresponding commodity code;
the commodity scoring model applicable to multiple scenes has independent weight settings.
In a second aspect, the invention provides a computer device comprising a memory and a processor, the memory storing a computer program, wherein the computer program when executed by the processor implements any of the steps of the one-article multi-code scene support method according to the first aspect of the invention.
In a third aspect, the present invention provides a computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements any step of the one-article multi-code scene support method according to the first aspect of the present invention.
The method has the beneficial effects that the weight in the commodity grading model is optimized by utilizing a machine learning algorithm, and the weight of the core dimension is adjusted based on the error between the sales of the actual business index and the predicted value, so that the self-optimization and continuous improvement of the commodity grading model are realized. The application of the machine learning algorithm not only improves the accuracy and stability of the commodity scoring model, but also can respond to market changes in real time and dynamically adjust commodity priority. The self-adaptive mechanism ensures that recommended commodities are always optimal, user requirements are met to the maximum extent, and the competitiveness and the operation efficiency of enterprises are improved.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described herein, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Further, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic can be included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
Embodiment 1, referring to fig. 1 and 2, is a first embodiment of the present invention, and this embodiment provides a one-article multi-code scene supporting method, which includes the following steps:
S1, collecting different codes of the same commodity, multidimensional attribute data and user behavior data of the codes through an interface, and calculating according to the user behavior data to obtain similarity among users.
Specifically comprises the following steps of,
Different codes (UPC, EAN, internal codes) of the same commodity of the third party ERP and the warehouse management module and relevant multidimensional attribute data (stock state, movable sales state, saleable state, on-shelf state, geographic position and historical sales) are acquired by using an API interface, and user behavior data (user ID, purchase history, browsing record, clicking behavior, residence time and behavior occurrence time) of a user are collected from a user interaction platform.
Further, centralized management of commodity information with different codes is realized by importing data in batches through an API interface, and the problem that the traditional manual input mode is easy to make mistakes is solved. The method ensures the consistency and accuracy of all commodity codes and related attribute data thereof, and avoids operation errors caused by inconsistent data. The comprehensive collection of the multi-dimensional attribute data provides a rich information basis, which is helpful for evaluating the commodity performance more scientifically, for example, the stock state and the movable sales state can help enterprises to plan the replenishment strategy better. In addition, the behavior data of the user can be accurately recommended, so that the shopping experience of the user is improved, the opportunity of finding the products of the cardiology instrument is increased, and further the satisfaction degree and the loyalty degree of the user are improved.
S1.1, constructing a user-commodity matrix by using user behavior data, wherein the matrix can accurately record specific interaction conditions (such as browsing times, purchasing frequency and the like) of each user on different commodities, the user-commodity matrix is a two-dimensional matrix, wherein rows represent users, columns represent commodities, each element in the matrix represents interaction scores of the users on the commodities, traversing all user behavior data, filling the user-commodity matrix according to user ID and commodity codes, and if the user isAnd commodity withWith interaction, then;The interaction score is represented as a function of the interaction score,Is a specific interaction score (such as browsing times, purchase rates, etc.), if there is no interaction, then;
For each user, calculating the average interaction score of the user on all the interactive commodities, and then obtaining the similarity between the users by using a collaborative filtering algorithm, wherein the expression is as follows:
;
Wherein,Representing a userAnd a userThe degree of similarity between the two,Representing a userThe interaction score for the merchandise is determined,Representing a userAn average interaction score for the interacted merchandise,Representing a userThe interaction score for the merchandise is determined,Representing a userAverage interaction score for interacted merchandise.
Further, the similarity between users is calculated, and other users matching with the interests of the target user can be found, so that the commodities liked by the similar users are recommended. Such recommendation based on user behavior is more accurate than conventional rule engines or simple classification recommendations.
S2, carrying out standardization processing on all the collected data to obtain a fusion data set.
Specifically comprises the following steps of,
S2.1, unifying different codes of commodities and formats, units and fields of corresponding multi-dimensional attribute data.
The ETL tool is used to define the standard format of each coding type (such as UPC, EAN, internal coding), for example, UPC should be 12 digits and EAN should be 13 digits, for multi-dimensional attribute data (such as stock state and historical sales volume) related to numerical values, the standard unit is defined, for example, the stock state is in units of 'parts', the historical sales volume is in units of 'parts/day', and the standard field name and data type of the multi-dimensional attribute data are determined. For example, the "inventory status" field is named inventory_status, and the data type is an integer. The ETL tool can handle the problems of unified format, unit conversion, field mapping and the like of data.
Abnormal data in the user behavior data (such as abnormally high dwell times or unreasonable purchase frequencies) is removed, and then missing values in the user behavior data are processed by filling in the average.
And storing all the standardized data into a central database according to the unified format, unit and field to form a fusion data set.
Further, the standardized fusion data set provides high-quality basic data for subsequent commodity scoring model construction. Accurate data is the key of model success, and the standardized processing can obviously improve the prediction precision and reliability of the model.
And S3, selecting scoring core dimensions from the fusion data set by using a map analysis method, distributing initial weights, constructing a commodity scoring model to obtain comprehensive scores of each commodity code, and sequencing the commodity codes at the same time.
Specifically comprises the following steps of,
S3.1, setting each multi-dimensional attribute data in the fusion data set as a node, wherein the inventory state, the movable pin state, the saleable state and the like are different nodes, and each node can be expressed as a vector and contains a specific numerical value of the attribute. For example, the stock status may be an integer, the movable pin status may be a boolean value, etc.
Calculating the correlation between two attributes by using the pearson correlation coefficient in the collaborative filtering algorithm, setting a correlation threshold (for example, 0.5), and if the correlation between the two attributes is greater than the correlation threshold, establishing an edge between the two attributes;
Each node is then assigned an initial importance score, typically set to 1, ensuring fairness of subsequent calculations. Iteratively updating importance scores for each node using a PageRank algorithm
;
Wherein,Representing nodesThe PageRank score of (i.e., importance score),Representing the damping factor (typically set to 0.85),Representation pointing nodeIs defined as a set of all nodes of the network,Representing nodesIs a PageRank score of (C),Representing slave nodesThe number of edges that go out;
The PageRank algorithm can evaluate the importance of each node in the overall graph to determine which properties are more influential in the overall graph. And then the communities are divided by maximizing the modularity through a Louvain algorithm, and natural grouping among attributes can be found through community detection, so that the internal structure of data can be understood. The node with the highest PageRank score is selected from each community as a core dimension to ensure that important attributes of different communities are contained. This ensures diversity and representativeness of the core dimensions.
S3.2, calculating the grading value of the core dimension. For example, if the dynamic sales state and the historical sales weight are core dimensions, the statistical method is used to calculate the score value, and the dynamic sales state is calculatedThe time window of (2) is set as the average value of sales daily in 7 days of the week, and the historical sales weightIs set to an average sales over the past 30 days, expressed as:
;
;
Wherein,A score value indicating the state of the movable pin,Indicating the sales volume per day of the week,A scoring value representing the historical sales weight,Representing the daily sales volume within a month,Index indicating the number of days.
If the saleable state and the on-shelf state of the commodity code are core dimensions, a Boolean judgment method is used for obtaining a grading value, and the saleable state is taken as an example, and the expression is as follows:
;
Wherein,The score value representing the marketable status is a boolean value, 1 if the commodity is marketable, or 0 otherwise.
For example, the stock state and the movable pin state are selected as core dimensions, and the stock is prioritized, the weight of the core dimensions can be that the stock state weight is 0.7, and the movable pin state weight is 0.3.
Definition and useSummarizing the calculated scoring values of the core dimensions for subsequent calculation of a composite score for the commodity code, whereinAn index representing the core dimension, i.e., the number of core dimensions.
S3.3, obtaining the comprehensive score of the commodity code by using a linear combination mode based on the obtained score value of the core dimension and the corresponding weight, wherein the expression is as follows:
;
Wherein,A composite score representing the code of the good,A score value representing the dimension of the core,The weights representing the dimensions of the core are,An index representing the dimension of the core,Represent the firstThe scoring values for the individual core dimensions,Represent the firstWeights for the individual core dimensions;
And sorting from high to low according to the calculated comprehensive score of each commodity code, and selecting the commodity corresponding to the commodity code with the highest comprehensive score for preferential display to the user. I.e. comprehensive scoring of commodity codesDirectly serve as a basis for deciding which goods should be preferentially displayed.
Further, by constructing the commodity scoring model, quantitative evaluation of commodity multidimensional performance is realized, and scientific decision basis is provided for enterprises. For example, based on the composite score, the enterprise may more reasonably arrange for promotional campaigns to optimize inventory management policies.
And S4, optimizing the comprehensive scores of the commodity codes, combining the similarity among users to obtain the weight of the optimized core dimension, and updating the ordering of the commodity codes.
Specifically comprises the following steps of,
Selecting salesAs a primary business index, as it is a key index for measuring the performance of a commodity. Historical sales data for each commodity code is extracted from the ERP. It is ensured that a sufficiently long period of time (e.g., the past few months) is covered in order to capture seasonal and trending changes.
S4.1, taking the comprehensive score of the commodity codes as an independent variable and the sales as a dependent variable, and establishing a linear regression model to obtain the prediction business index of each commodity codeThe expression is:
;
Wherein,The predicted business index, i.e. predicted sales,The intercept term is represented as such,Representing regression coefficients.
Further, by establishing a linear regression model, sales of each commodity code can be effectively predicted, so that the performance of the commodity can be better understood.
Predictive traffic metrics based on each commodity codeCalculating actual business indexAnd predicting business indexMeanwhile, an activation function is applied to enable the error to be non-negative, so that the influence of a negative value on the weight adjustment process is avoided, and the expression is as follows:
;
;
Wherein,Representing the error between the actual traffic index and the predicted traffic index,Representing the total number of samples,The index of the sample is represented and,Represent the firstThe actual traffic index of the individual samples,Represent the firstThe prediction traffic index of each sample is calculated,Indicating the result of the processing of the application activation function,Representing taking 0 and a larger value of error between the actual business index and the predicted business index;
S4.2, according to the similarity between usersPredicting interest scores of users on non-contacted commodities, wherein the expression is as follows:
;
Wherein,Representing a commodityIs a score of interest in (a),Representing an interaction score;
According to the interest score of the user and the error between the actual service index and the predicted service index, introducing a learning rate to control the adjustment amplitude, and completing the adjustment of the core dimension weight, wherein the expression is as follows:
;
Wherein,Represents the optimized firstThe weight of the individual core dimensions,The learning rate is indicated as being indicative of the learning rate,Representing the total number of core dimensions,Representing each weight in all core dimensions, hereRepresenting an index variable, the value ranges from 1 to,Representing a userFor commodityIs a score of interest in (a),Representing a userFor the firstInterest scores for items associated with each core dimension.
Further, according to the error between the actual business index and the predicted business index, the weight of each core dimension is dynamically adjusted, so that the commodity grading model can be continuously self-optimized. The method can adapt to market change and business demand change, and maintain timeliness and accuracy of commodity scoring models.
And (3) based on the core dimension after the weight is adjusted, calculating the comprehensive score of each commodity code again, updating the ordering of the commodity codes according to the new comprehensive score, and adjusting the ordering of the commodity according to the updated commodity codes to obtain a personalized commodity score display list fitting the interests of the user.
Further, according to the error between the actual business index and the predicted business index and the interest score of the user, the weight of each core dimension is dynamically adjusted, so that the commodity scoring model can be continuously self-optimized. The method can adapt to market change and business demand change, can meet interest preference of users, and keeps timeliness and accuracy of commodity scoring models.
S5, according to the updated commodity code sequence, the mapping relation of the commodities is adjusted in real time.
Specifically comprises the following steps of,
And (3) after recalculating the comprehensive score of each commodity code according to the optimized weight, sequencing according to the comprehensive score of the commodity code from high to low. And displaying the commodities corresponding to the commodity codes to a user according to a new ordering sequence in the front-end display page. For example, on the e-commerce platform, the commodity with the highest score is preferentially displayed.
Database triggers are used to check whether the core dimensions of the commodity code (e.g., inventory status, movable sales status, marketable status, etc.) have changed.
When the core dimension of a commodity code is detected to change, the core dimension data of the commodity code is updated immediately, and the latest core dimension data is used for recalculating the comprehensive score of the commodity code. For example, if the inventory status of a commodity changes from good to out of stock, then its commodity code composite score needs to be reevaluated. All items are reordered based on the new composite score.
And updating the commodity list corresponding to the reordered commodity codes to the front-end display page in real time by using the WebSocket, so that the front-end page can respond to the data change of the rear end in real time, and the user can see the latest commodity recommendation without manually refreshing the page.
Further, the enterprise can obtain a more accurate commodity performance assessment by recalculating the composite score based on the latest core dimension data. The method provides scientific decision basis for enterprises, and helps the enterprises make more intelligent choices in aspects of resource allocation, promotion and the like. In addition, an automatic monitoring and updating mechanism reduces the need for manual intervention and improves the operating efficiency. For example, when the stock state of a certain commodity changes, the comprehensive score and the sequence of the commodity can be automatically adjusted, so that the problem of information lag caused by human negligence is avoided. The mapping relation of the commodities is adjusted in real time, market change can be responded quickly, a user can see the latest and hottest commodity recommendation, and shopping experience is improved. Especially during a promotional campaign or in the case of a shortage of inventory, the user may more quickly obtain the desired merchandise information, increasing the likelihood of purchase.
And S6, formulating a multi-scene priority rule, and applying the multi-scene priority rule to the functional module based on the priority scores of commodity codes.
Specifically comprises the following steps of,
And S6.1, according to the requirements of different service scenes, corresponding priority rules are formulated, and the commodities can be effectively evaluated and displayed in each scene.
Business scenarios such as distribution management, inventory management, and applet tasks are first identified. Each scene has its specific objects and points of interest.
Distribution management focuses on optimizing supply chain efficiency and improving the cooperative satisfaction of channel partners.
Inventory management focuses on inventory turnover rate and avoids backlog, ensuring reasonable inventory levels.
The applet task focuses on the user experience, improving user viscosity and conversion through personalized recommendations.
Specific priority rules are set for each scene. For example, in distribution management, dynamic sales status and historical sales may be more of a concern, while in inventory management, real-time inventory status is more of a concern.
S6.2, building commodity grading models applicable to multiple scenes and applying the commodity grading models to the functional modules.
For example, the inventory management model emphasizes inventory status. Then the inventory status weight is set to 0.5, the movable sales status weight is set to 0.15, the saleable status weight is set to 0.1, the on-shelf status weight is set to 0.1, the geographic location weight is set to 0.05, and the historical sales weight is set to 0.1.
The commodity grading models under different scenes are integrated into corresponding functional modules, such as inventory management.
When a user selects a certain functional module, the corresponding commodity scoring model is automatically called for calculation, and a commodity display result corresponding to the corresponding commodity code is generated.
Further, by constructing special commodity scoring models for different business scenes, more accurate commodity performance evaluation can be obtained. For example, in distribution management, supply chain policies may be optimized based on dynamic sales status and historical sales, and in inventory management, inventory layouts may be arranged reasonably based on real-time inventory status. And the most relevant commodity recommendation is displayed based on the function module selected by the user, so that the shopping experience of the user is improved. For example, in the applet task, the commodity which has good movable sales state and meets the preference of the commodity is recommended to the user, so that the satisfaction degree and the conversion rate of the user are improved.
The embodiment also provides computer equipment, which is suitable for the situation of the one-article multi-code scene supporting method and comprises a memory and a processor, wherein the memory is used for storing computer executable instructions, and the processor is used for executing the computer executable instructions to realize the one-article multi-code scene supporting method as proposed by the embodiment.
The computer device may be a terminal comprising a processor, a memory, a communication interface, a display screen and input means connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
The present embodiment also provides a storage medium having a computer program stored thereon, which when executed by a processor implements the one-article multi-code scene supporting method as set forth in the above embodiment, the storage medium may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM for short), electrically erasable Programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM for short), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM for short), programmable Read-Only Memory (ROM for short), magnetic Memory, flash Memory, magnetic disk or optical disk.
In summary, the self-optimization and continuous improvement of the commodity grading model are realized by optimizing the weight in the commodity grading model by utilizing a machine learning algorithm and adjusting the weight of the core dimension based on the error between the sales of the actual business index and the predicted value. The application of the machine learning algorithm not only improves the accuracy and stability of the commodity scoring model, but also can respond to market changes in real time and dynamically adjust commodity priority. The self-adaptive mechanism ensures that recommended commodities are always optimal, user requirements are met to the maximum extent, and the competitiveness and the operation efficiency of enterprises are improved.
It should be noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention may be modified or substituted without departing from the spirit and scope of the technical solution of the present invention, which is intended to be covered in the scope of the claims of the present invention.