[go: up one dir, main page]

CN110991836A - Commodity quality score obtaining method and device - Google Patents

Commodity quality score obtaining method and device Download PDF

Info

Publication number
CN110991836A
CN110991836A CN201911145090.2A CN201911145090A CN110991836A CN 110991836 A CN110991836 A CN 110991836A CN 201911145090 A CN201911145090 A CN 201911145090A CN 110991836 A CN110991836 A CN 110991836A
Authority
CN
China
Prior art keywords
evaluation
commodity
calculated
template
score
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911145090.2A
Other languages
Chinese (zh)
Inventor
陈洋
万鹏程
吕勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suning Cloud Computing Co Ltd
Original Assignee
Suning Cloud Computing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suning Cloud Computing Co Ltd filed Critical Suning Cloud Computing Co Ltd
Priority to CN201911145090.2A priority Critical patent/CN110991836A/en
Publication of CN110991836A publication Critical patent/CN110991836A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • G06Q10/06393Score-carding, benchmarking or key performance indicator [KPI] analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Probability & Statistics with Applications (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Game Theory and Decision Science (AREA)
  • Fuzzy Systems (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for acquiring a commodity quality score, wherein the method comprises the following steps: sequentially inquiring a corresponding relation table and an evaluation template table of a preset evaluation template and the commodity, and acquiring element codes of evaluation elements contained in the evaluation template corresponding to the commodity to be calculated; inquiring a corresponding evaluation element sub-table according to the element codes to obtain codes of evaluation items corresponding to the evaluation elements; inquiring a corresponding evaluation item sub-table according to the codes of the evaluation items to acquire the relevant information of the evaluation items corresponding to the evaluation elements; according to the corresponding relation between the preset evaluation items and the tasks, starting the corresponding tasks to calculate the related information of each evaluation item and the related information of the commodity to be calculated to obtain the score of each evaluation item; and summarizing and calculating the scores of the evaluation items to obtain the quality score of the commodity to be calculated. According to the invention, the evaluation elements and the evaluation items are stored in the form of the sub-table, so that the query depth when the evaluation elements and the evaluation items are queried is reduced, and the query efficiency is improved.

Description

Commodity quality score obtaining method and device
Technical Field
The invention relates to the technical field of big data algorithms, in particular to a method and a device for acquiring commodity quality scores.
Background
Spark is a general-purpose memory parallel computing framework developed by the Burkholderia school AMP laboratories (Algorithms Machines and PeopleLab, California university). Spark is realized by using a Scala language, is an object-oriented and functional programming language, can easily operate a distributed data set like operating a local set object, and has the characteristics of high operation speed, good usability, strong universality, anywhere operation and the like.
The current big data quality score task is generally based on a spark platform, when the quality score is calculated, one task is usually provided for each commodity data in each sub-library to acquire all evaluation item contents for calculation, the spark task is longer and longer in execution time along with the increase of the data, and if the expression or calculation rule of one evaluation item changes, all tasks need to be modified, so that the maintenance is troublesome.
According to statistics, the execution time of the current big data task exceeds 8 hours, so that a new commodity quality score calculation scheme needs to be provided to ensure that the big data task can calculate the result in the shortest time, so as to improve the execution efficiency of the big data task calculated by the quality score.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for calculating a quality score of a commodity, so as to overcome the problems in the prior art that a quality score calculation task is low in serial execution efficiency, large in data size, slow in query speed, long in calculation time consumption, and the like.
In order to solve one or more technical problems, the invention adopts the technical scheme that:
in one aspect, a method for obtaining a quality score of a commodity is provided, which includes the steps of:
sequentially inquiring a corresponding relation table and an evaluation template table of a preset evaluation template and the commodity, and acquiring element codes of evaluation elements contained in the evaluation template corresponding to the commodity to be calculated;
inquiring a corresponding evaluation element sub-table according to the element codes to obtain codes of evaluation items corresponding to the evaluation elements;
inquiring a corresponding evaluation item sub-table according to the codes of the evaluation items to acquire the relevant information of the evaluation items corresponding to the evaluation elements;
according to the corresponding relation between the preset evaluation items and the tasks, starting the corresponding tasks to calculate the related information of each evaluation item and the related information of the commodity to be calculated to obtain the score of each evaluation item;
and summarizing and calculating the scores of the evaluation items to obtain the quality score of the commodity to be calculated.
Further, sequentially querying the preset corresponding relationship table and the evaluation template table between the evaluation template and the commodity, and acquiring the element code of the evaluation element included in the evaluation template corresponding to the commodity to be calculated includes:
acquiring relevant information of a commodity to be calculated, and inquiring template codes of an evaluation template corresponding to the commodity to be calculated from a preset corresponding relation table of the evaluation template and the commodity according to the relevant information of the commodity to be calculated;
and inquiring a preset evaluation template table according to the template codes to obtain the element codes of the evaluation elements contained in the evaluation template.
Further, the starting of the corresponding task according to the preset corresponding relationship between the evaluation items and the task to calculate the relevant information of each evaluation item and the relevant information of the commodity to be calculated to obtain the score of each evaluation item includes:
inquiring a corresponding relation between a preset evaluation item and a task according to the received related information of the evaluation item, and acquiring the task corresponding to the evaluation item;
acquiring information required for calculating the evaluation item from the related information of the commodity to be calculated;
and executing tasks corresponding to the evaluation items in parallel, and calculating the related information of the evaluation items and the information required for calculating the evaluation items to obtain the scores of the evaluation items.
Further, the starting of the corresponding task to calculate the relevant information of each evaluation item and the relevant information of the commodity to be calculated to obtain the score of each evaluation item includes:
and extracting a calculation method corresponding to each evaluation item, and calculating the related information of each evaluation item and the related information of the commodity to be calculated by using the calculation method to obtain the score of each evaluation item.
Further, the collecting and calculating the scores of the evaluation items and acquiring the quality score of the commodity to be calculated includes:
and summarizing and calculating the scores of the evaluation items to obtain the total scores of the deduction items and the commodities to be calculated.
In another aspect, there is provided a quality score of goods acquiring apparatus, the apparatus including:
the first acquisition module is used for sequentially inquiring the corresponding relation table and the evaluation template table of the preset evaluation template and the commodity and acquiring element codes of evaluation elements contained in the evaluation template corresponding to the commodity to be calculated;
the second obtaining module is used for inquiring the corresponding evaluation element sub-table according to the element codes and obtaining the codes of the evaluation items corresponding to the evaluation elements;
the third obtaining module is used for inquiring the corresponding evaluation item sub-table according to the codes of the evaluation items and obtaining the relevant information of the evaluation items corresponding to the evaluation elements;
the score calculation module is used for starting a corresponding task to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relation between the preset evaluation item and the task to obtain the score of each evaluation item;
and the score summarizing module is used for summarizing and calculating the scores of the evaluation items and acquiring the quality score of the commodity to be calculated.
Further, the first obtaining module includes:
the first query unit is used for acquiring relevant information of a commodity to be calculated and querying a template code of an evaluation template corresponding to the commodity to be calculated from a preset corresponding relation table of the evaluation template and the commodity according to the relevant information of the commodity to be calculated;
and the second query unit is used for querying a preset evaluation template table according to the template codes and acquiring the element codes of the evaluation elements contained in the evaluation template.
Further, the score calculating module comprises:
the task obtaining unit is used for inquiring the corresponding relation between a preset evaluation item and a task according to the received related information of the evaluation item and obtaining the task corresponding to the evaluation item;
the information acquisition unit is used for acquiring information required for calculating the evaluation item from the related information of the commodity to be calculated;
and the score calculating unit is used for executing tasks corresponding to the evaluation items in parallel, and calculating the related information of the evaluation items and the information required for calculating the evaluation items to obtain the scores of the evaluation items.
Further, the score calculating module further comprises:
a method extraction unit for extracting a calculation method corresponding to each evaluation item;
the score calculating unit is further used for calculating the related information of each evaluation item and the related information of the commodity to be calculated by using the calculating method to obtain the score of each evaluation item.
Further, the score summarizing module is specifically configured to:
and summarizing and calculating the scores of the evaluation items to obtain the total scores of the deduction items and the commodities to be calculated.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
1. according to the commodity quality score obtaining method and device provided by the embodiment of the invention, element codes of evaluation elements contained in an evaluation template corresponding to a commodity to be calculated are obtained by sequentially inquiring a preset evaluation template and commodity corresponding relation table and an evaluation template table, then the corresponding evaluation element score table is inquired according to the element codes, codes of evaluation items corresponding to the evaluation elements are obtained, the corresponding evaluation item score table is inquired according to the evaluation item codes, relevant information of the evaluation items corresponding to the evaluation elements is obtained, and by storing the evaluation elements and the evaluation items in the score tables, the inquiry depth when the evaluation elements and the evaluation items are inquired is reduced, and the inquiry efficiency is improved;
2. according to the commodity quality score obtaining method and device provided by the embodiment of the invention, the corresponding tasks are started to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relation between the preset evaluation item and the tasks to obtain the score of each evaluation item, finally, the score of each evaluation item is calculated in a gathering manner to obtain the quality score of the commodity to be calculated, the evaluation items are divided into a plurality of tasks to be calculated in parallel, the execution efficiency of the tasks is improved, and the calculation time is reduced;
3. according to the commodity quality score obtaining method and device provided by the embodiment of the invention, the frequency of accessing the database is reduced by obtaining the information required for calculating the evaluation item from the related information of the commodity to be calculated instead of all data.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is an exemplary diagram illustrating an item correlation table in accordance with one illustrative embodiment;
FIG. 2 is an exemplary diagram illustrating a table associated with an evaluation item in accordance with one illustrative embodiment;
FIG. 3 is a flow diagram illustrating a quality of goods score acquisition method in accordance with an exemplary embodiment;
FIG. 4 is an exemplary diagram illustrating task execution in accordance with one illustrative embodiment;
fig. 5 is a flowchart illustrating sequentially querying a preset evaluation template and commodity correspondence table and an evaluation template table to obtain element codes of evaluation elements included in an evaluation template corresponding to a commodity to be calculated according to an exemplary embodiment;
fig. 6 is a flowchart illustrating that, according to a preset correspondence between evaluation items and tasks, corresponding tasks are started to calculate the related information of each evaluation item and the related information of a commodity to be calculated, so as to obtain a score of each evaluation item, according to an exemplary embodiment;
fig. 7 is a schematic configuration diagram illustrating a product quality score acquisition apparatus according to an exemplary embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, in a scheme for obtaining a quality score in the prior art, data to be calculated for the quality score is obtained in the following manner: fig. 1 is an exemplary diagram of a commodity-related table according to an exemplary embodiment, and referring to fig. 1, a table of commodity data with a large data size is stored in a sub-library and is subjected to sub-table division, and all sub-tables and other tables are combined to form data related to a commodity to be calculated in the sub-library. Fig. 2 is an exemplary diagram illustrating tables related to evaluation items according to an exemplary embodiment, and is illustrated in fig. 2, and includes an evaluation template and commodity group relationship table, an evaluation template table, an evaluation element table, an evaluation item table, and the like. And correlating the related data of the commodity to be calculated with the table related to the quality score evaluation item to form the related data of the quality score evaluation to be calculated. However, the above solutions have the problems of low serial execution efficiency of the computing task, large data size, slow query speed, long computing time consumption, and the like.
According to the commodity quality score obtaining method provided by the embodiment of the invention, the calculation task is based on the spark platform, and the optimization is performed on the original quality score calculation big data task, so that the calculation, the more refined resource management and the larger-scale parallel execution of the task are performed by using the more granular evaluation items, the task execution efficiency is greatly improved, and the overall execution time of the task is shortened by more than half.
Fig. 3 is a flowchart illustrating a quality of goods score acquisition method according to an exemplary embodiment, and referring to fig. 3, the method includes the steps of:
s1: and sequentially inquiring a corresponding relation table and an evaluation template table of a preset evaluation template and the commodity, and acquiring element codes of evaluation elements contained in the evaluation template corresponding to the commodity to be calculated.
Specifically, in the embodiment of the present invention, different evaluation templates are set for different commodities in advance, the evaluation template includes a plurality of different evaluation elements, and each evaluation element includes a plurality of different evaluation items. After the goods to be calculated are determined, corresponding evaluation templates can be matched for the goods to be calculated according to the information of the goods to be calculated, and the evaluation templates are used for calculating the quality scores of the goods to be calculated. In specific implementation, a corresponding relation table of an evaluation template and a commodity and an evaluation template table can be maintained in advance. The corresponding relation table of the evaluation template and the commodity is used for recording the corresponding relation between the evaluation template and the commodity, such as the corresponding relation between the commodity code and the evaluation template code, and the user can inquire the evaluation template corresponding to the commodity to be calculated in the corresponding relation table of the evaluation template and the commodity according to the related information (such as the commodity code) of the commodity to be calculated. The evaluation template table is used for recording specific information of each evaluation template, such as information of evaluation elements contained in each evaluation template. After the evaluation template corresponding to the commodity to be calculated is inquired, the element code of the evaluation element contained in the evaluation template is inquired in the evaluation template table according to the relevant information (such as the template code) of the evaluation template.
S2: and inquiring the corresponding evaluation element sub-table according to the element codes to obtain the codes of the evaluation items corresponding to the evaluation elements.
Specifically, in the embodiment of the present invention, at least information of an evaluation item included in each evaluation element is recorded in the evaluation element sublist. In addition, each evaluation element is also provided with information such as an evaluation large class, an evaluation element code, an evaluation element name, an object path, a unique information identifier and the like. In the prior art, the evaluation elements contained in each evaluation template are stored in a general table, which results in the problems of a deep query depth when querying the corresponding evaluation element, a too slow query speed and the like. In the embodiment of the invention, in order to solve the above problem, the element codes of all the evaluation elements are uniformly divided into a plurality of parts, and the parts are respectively stored in different sub-tables. After the element codes are obtained, the corresponding evaluation element sub-tables are inquired according to the element codes, and information such as codes of evaluation items corresponding to the evaluation elements is obtained.
S3: and inquiring a corresponding evaluation item sub-table according to the codes of the evaluation items to acquire the relevant information of the evaluation items corresponding to the evaluation elements.
Specifically, the evaluation item is the minimum evaluation unit suspended under the evaluation element, and may include information such as an evaluation item code, an evaluation item description, an expression field, optimization, hit soft text (which refers to a prompt for notifying the user of hit conditions), and non-hit soft text (which refers to a prompt for notifying the user of miss conditions). In the prior art, all evaluation items are stored in a general table, which also causes the problems of a deep query depth when querying the corresponding evaluation item, a slow query speed and the like. Similarly, in the embodiment of the present invention, to solve the above problem, the codes of all the evaluation items are uniformly divided into multiple parts, and the parts are respectively stored in different sub-tables. After the codes of the evaluation items are obtained, the corresponding evaluation item sub-tables are inquired according to the codes of the evaluation items, and the related information of the evaluation items corresponding to the evaluation elements is obtained for subsequent calculation of the quality scores of the commodities to be calculated.
S4: and starting the corresponding tasks to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relation between the preset evaluation item and the tasks to obtain the score of each evaluation item.
Specifically, in the prior art, generally, one task is adopted for each commodity data in each sub-library to acquire all contents of evaluation items for calculation, with the increase of data, the execution time of spark tasks becomes longer and longer, and if the expression or calculation rule of one evaluation item changes, all tasks need to be modified, which is also troublesome to maintain. In the embodiment of the invention, all the evaluation items are split, so that each task performs calculation on the content of a plurality of (such as 3-5) evaluation items, wherein the evaluation items can be coded according to the evaluation items and are transmitted to the task in a parameter mode.
Specifically, during implementation, a corresponding relationship between an evaluation item and a task may be maintained in advance, and the corresponding relationship records which task is adopted by each evaluation item for calculation. After the related information of the evaluation items is obtained, the corresponding tasks can be started to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relation between the evaluation items and the tasks, and the score of each evaluation item is obtained.
Generally, the data to be calculated of the product quality score includes the related information of the product to be calculated and the related information of the evaluation item, and in order to improve the calculation efficiency, the two data may be combined together in a left-related manner according to the product code to form the final data to be calculated, a spark task of a big data platform is used, and a plurality of database tasks are executed in parallel, as shown in fig. 4.
S5: and summarizing and calculating the scores of the evaluation items to obtain the quality score of the commodity to be calculated.
Specifically, after the scores of the evaluation items are obtained, the score results of all the evaluation items in the sub-base are summarized, for example, the score results are written into a large hive table, and after a total score calculation task is called, all the scores are counted to obtain the quality score of the commodity to be calculated.
Fig. 5 is a flowchart illustrating sequentially querying a preset evaluation template and commodity correspondence table and an evaluation template table to obtain an element code of an evaluation element included in an evaluation template corresponding to a commodity to be calculated according to an exemplary embodiment, and as a preferred implementation, referring to fig. 5, in an embodiment of the present invention, sequentially querying a preset evaluation template and commodity correspondence table and an evaluation template table to obtain an element code of an evaluation element included in an evaluation template corresponding to a commodity to be calculated includes:
s101: acquiring relevant information of a commodity to be calculated, and inquiring template codes of an evaluation template corresponding to the commodity to be calculated from a preset corresponding relation table of the evaluation template and the commodity according to the relevant information of the commodity to be calculated.
Specifically, in order to reduce the data amount, in the embodiment of the present invention, in the preset correspondence table between the evaluation template and the product, the template code including only the evaluation template may be set in the information related to the evaluation template corresponding to the product, instead of including the specific content of the evaluation template (i.e., the information including the evaluation elements, the evaluation items, and the like). After the relevant information of the commodity to be calculated is obtained, the template code of the evaluation template corresponding to the commodity to be calculated can be inquired from the preset corresponding relation table of the evaluation template and the commodity according to the relevant information of the commodity to be calculated.
S102: and inquiring a preset evaluation template table according to the template codes to obtain the element codes of the evaluation elements contained in the evaluation template.
Specifically, in the embodiment of the present invention, the evaluation template table also records only the coding information of the evaluation elements included in each evaluation template, so that the data storage amount in the evaluation template table can be reduced, thereby reducing the system stress. After the template code is obtained, a preset evaluation template table can be queried according to the template code, and the element code of the evaluation element contained in the evaluation template is obtained.
Fig. 6 is a flowchart illustrating, according to an exemplary embodiment, that a corresponding task is started to calculate related information of each evaluation item and related information of a product to be calculated according to a preset correspondence between the evaluation item and the task, so as to obtain a score of each evaluation item, and referring to fig. 6, as a preferred implementation, in an embodiment of the present invention, as shown in fig. 6, the starting of a corresponding task according to a preset correspondence between the evaluation item and the task to calculate related information of each evaluation item and related information of the product to be calculated, so as to obtain a score of each evaluation item includes:
s401: and inquiring the corresponding relation between a preset evaluation item and a task according to the received related information of the evaluation item, and acquiring the task corresponding to the evaluation item.
Specifically, in the embodiment of the present invention, for example, the execution time of a single task is reduced, instead of adopting a mode of obtaining all the contents of the evaluation items by using one task for calculation with respect to each commodity data in each sub-library, a mode of splitting all the evaluation items and causing each task to execute the calculation of a plurality of (for example, 3 to 5) contents of the evaluation items is adopted. Specifically, during implementation, a corresponding relationship between an evaluation item and a task needs to be maintained in advance, and the corresponding relationship records a corresponding relationship between each evaluation item and a task for calculating the evaluation item. After the related information of the evaluation item is obtained, the corresponding relationship between the evaluation item and the task can be queried according to the received related information of the evaluation item, and the task corresponding to each evaluation item and used for calculating the evaluation item is obtained.
S402: and acquiring information required for calculating the evaluation item from the related information of the commodity to be calculated.
Specifically, in the quality score calculation process, data (here, related data of a commodity to be calculated) required by different evaluation items are different, and in the embodiment of the invention, only table data (related data of the commodity to be calculated) required by all corresponding evaluation items is acquired for each task, but not all data, so that the frequency of accessing a database is reduced.
In addition, as a preferred embodiment, the commodity data that is commonly required by each evaluation item may be encapsulated into the basic method of the base class, and the basic method may include data such as commodity basic information, deduction item template data, evaluation elements, deduction items, unique information, and shelving information. And then extracting the data of each sub-table, and combining the data into a large table in an external connection mode based on the basic information of the product. And merging other data used by each evaluation item with the large table to serve as data to be calculated of the quality score of the final commodity.
S403: and executing tasks corresponding to the evaluation items in parallel, and calculating the related information of the evaluation items and the information required for calculating the evaluation items to obtain the scores of the evaluation items.
Specifically, after determining the task corresponding to each evaluation item, the corresponding task is started to perform the calculation of the relevant information of each evaluation item and the information required for calculating the evaluation item, so as to obtain the score of each evaluation item. When calculating each evaluation item, the Spark task takes each line of data to be calculated (here, the related information of the evaluation item and the information required for calculating the evaluation item) for processing, each line of data includes one or more fields of a plurality of tables, and the value of each field is obtained according to the field name, so the field names of the single tasks cannot be repeated.
As a preferred implementation manner, in an embodiment of the present invention, the starting of the corresponding task to calculate the relevant information of each evaluation item and the relevant information of the commodity to be calculated, and obtaining the score of each evaluation item includes:
and extracting a calculation method corresponding to each evaluation item, and calculating the related information of each evaluation item and the related information of the commodity to be calculated by using the calculation method to obtain the score of each evaluation item.
Specifically, the calculation methods used by the different evaluation items are not necessarily the same, that is, each evaluation item has its corresponding calculation method. In the embodiment of the invention, in order to reduce the coupling among the calculation methods, when the quality of the commodity is calculated, only the calculation method corresponding to each evaluation item calculated by the calculation method is extracted for each task, and then the extracted calculation method is used for calculating the related information of each evaluation item and the related information of the commodity to be calculated to obtain the score of each evaluation item.
It should be noted that, in the embodiment of the present invention, the calculation method is stored in the corresponding service class method, after the data is prepared in the previous step, all tasks use the same entry to calculate the quality score, the entry method includes the calculation methods of all the evaluation items, and specifically, when the corresponding calculation method is extracted, the matching may be performed according to an expression, and the matching may enter the corresponding service class after the matching is performed, and the corresponding quality score calculation method is invoked.
As a preferred implementation manner, in an embodiment of the present invention, the collecting and calculating the scores of the evaluation items and acquiring the quality score of the commodity to be calculated includes:
and summarizing and calculating the scores of the evaluation items to obtain the total scores of the deduction items and the commodities to be calculated.
Specifically, in the embodiment of the invention, the commodity quality score result needs to include a point deduction item and a total score, and after the score of each evaluation item is obtained through calculation, the score of each evaluation item needs to be summarized and calculated to obtain the point deduction item and the total score of the commodity to be calculated.
It should be noted that, in the embodiment of the present invention, in the commodity quality score calculating process, an expression is obtained first, a field value in data to be calculated (here, related information of an evaluation item and related information of a commodity to be calculated) is extracted according to the expression, if a certain field in Row includes multiple pieces of data, sorting is performed according to a separator to obtain data that can be used for direct calculation, then calculation is performed according to the expression to obtain a score or score adding result, corresponding element codes, evaluation item codes, and calculation results are all written into an individual hive table, and finally total score data is obtained according to the score adding result and stored in the individual hive table.
Fig. 7 is a schematic configuration diagram illustrating a product quality score acquisition apparatus according to an exemplary embodiment, and referring to fig. 7, the apparatus includes:
the first acquisition module is used for sequentially inquiring the corresponding relation table and the evaluation template table of the preset evaluation template and the commodity and acquiring element codes of evaluation elements contained in the evaluation template corresponding to the commodity to be calculated;
the second obtaining module is used for inquiring the corresponding evaluation element sub-table according to the element codes and obtaining the codes of the evaluation items corresponding to the evaluation elements;
the third obtaining module is used for inquiring the corresponding evaluation item sub-table according to the codes of the evaluation items and obtaining the relevant information of the evaluation items corresponding to the evaluation elements;
the score calculation module is used for starting a corresponding task to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relation between the preset evaluation item and the task to obtain the score of each evaluation item;
and the score summarizing module is used for summarizing and calculating the scores of the evaluation items and acquiring the quality score of the commodity to be calculated.
As a preferred implementation manner, in an embodiment of the present invention, the first obtaining module includes:
the first query unit is used for acquiring relevant information of a commodity to be calculated and querying a template code of an evaluation template corresponding to the commodity to be calculated from a preset corresponding relation table of the evaluation template and the commodity according to the relevant information of the commodity to be calculated;
and the second query unit is used for querying a preset evaluation template table according to the template codes and acquiring the element codes of the evaluation elements contained in the evaluation template.
As a preferred implementation manner, in an embodiment of the present invention, the score calculating module includes:
the task obtaining unit is used for inquiring the corresponding relation between a preset evaluation item and a task according to the received related information of the evaluation item and obtaining the task corresponding to the evaluation item;
the information acquisition unit is used for acquiring information required for calculating the evaluation item from the related information of the commodity to be calculated;
and the score calculating unit is used for executing tasks corresponding to the evaluation items in parallel, and calculating the related information of the evaluation items and the information required for calculating the evaluation items to obtain the scores of the evaluation items.
As a preferred implementation manner, in an embodiment of the present invention, the score calculating module further includes:
a method extraction unit for extracting a calculation method corresponding to each evaluation item;
the score calculating unit is further used for calculating the related information of each evaluation item and the related information of the commodity to be calculated by using the calculating method to obtain the score of each evaluation item.
As a preferred implementation manner, in an embodiment of the present invention, the score summarizing module is specifically configured to:
and summarizing and calculating the scores of the evaluation items to obtain the total scores of the deduction items and the commodities to be calculated.
In summary, the technical solution provided by the embodiment of the present invention has the following beneficial effects:
1. according to the commodity quality score obtaining method and device provided by the embodiment of the invention, element codes of evaluation elements contained in an evaluation template corresponding to a commodity to be calculated are obtained by sequentially inquiring a preset evaluation template and commodity corresponding relation table and an evaluation template table, then the corresponding evaluation element score table is inquired according to the element codes, codes of evaluation items corresponding to the evaluation elements are obtained, the corresponding evaluation item score table is inquired according to the evaluation item codes, relevant information of the evaluation items corresponding to the evaluation elements is obtained, and by storing the evaluation elements and the evaluation items in the score tables, the inquiry depth when the evaluation elements and the evaluation items are inquired is reduced, and the inquiry efficiency is improved;
2. according to the commodity quality score obtaining method and device provided by the embodiment of the invention, the corresponding tasks are started to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relation between the preset evaluation item and the tasks to obtain the score of each evaluation item, finally, the score of each evaluation item is calculated in a gathering manner to obtain the quality score of the commodity to be calculated, the evaluation items are divided into a plurality of tasks to be calculated in parallel, the execution efficiency of the tasks is improved, and the calculation time is reduced;
3. according to the commodity quality score obtaining method and device provided by the embodiment of the invention, the frequency of accessing the database is reduced by obtaining the information required for calculating the evaluation item from the related information of the commodity to be calculated instead of all data.
It should be noted that: in the above embodiment, when triggering the quality score obtaining service, the device for obtaining the quality score is only illustrated by dividing the functional modules, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the embodiment of the product quality score obtaining device and the embodiment of the product quality score obtaining method provided by the above embodiments belong to the same concept, that is, the device is based on the product quality score obtaining method, and the specific implementation process thereof is described in the method embodiments in detail, and is not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method for obtaining a quality score of a commodity, comprising the steps of:
sequentially inquiring a corresponding relation table and an evaluation template table of a preset evaluation template and the commodity, and acquiring element codes of evaluation elements contained in the evaluation template corresponding to the commodity to be calculated;
inquiring a corresponding evaluation element sub-table according to the element codes to obtain codes of evaluation items corresponding to the evaluation elements;
inquiring a corresponding evaluation item sub-table according to the codes of the evaluation items to acquire the relevant information of the evaluation items corresponding to the evaluation elements;
according to the corresponding relation between the preset evaluation items and the tasks, starting the corresponding tasks to calculate the related information of each evaluation item and the related information of the commodity to be calculated to obtain the score of each evaluation item;
and summarizing and calculating the scores of the evaluation items to obtain the quality score of the commodity to be calculated.
2. The method for obtaining the commodity quality score according to claim 1, wherein the sequentially querying a preset evaluation template and commodity correspondence table and an evaluation template table, and obtaining the element code of the evaluation element included in the evaluation template corresponding to the commodity to be calculated comprises:
acquiring relevant information of a commodity to be calculated, and inquiring template codes of an evaluation template corresponding to the commodity to be calculated from a preset corresponding relation table of the evaluation template and the commodity according to the relevant information of the commodity to be calculated;
and inquiring a preset evaluation template table according to the template codes to obtain the element codes of the evaluation elements contained in the evaluation template.
3. The method for obtaining the quality score of the commodity according to claim 1 or 2, wherein the step of starting the corresponding task to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relationship between the preset evaluation item and the task to obtain the score of each evaluation item comprises:
inquiring a corresponding relation between a preset evaluation item and a task according to the received related information of the evaluation item, and acquiring the task corresponding to the evaluation item;
acquiring information required for calculating the evaluation item from the related information of the commodity to be calculated;
and executing tasks corresponding to the evaluation items in parallel, and calculating the related information of the evaluation items and the information required for calculating the evaluation items to obtain the scores of the evaluation items.
4. The method according to claim 1 or 2, wherein the starting of the corresponding task to calculate the related information of each evaluation item and the related information of the commodity to be calculated to obtain the score of each evaluation item includes:
and extracting a calculation method corresponding to each evaluation item, and calculating the related information of each evaluation item and the related information of the commodity to be calculated by using the calculation method to obtain the score of each evaluation item.
5. The method according to claim 1 or 2, wherein the step of calculating the scores of the evaluation items in a summary manner to obtain the quality score of the commodity to be calculated includes:
and summarizing and calculating the scores of the evaluation items to obtain the total scores of the deduction items and the commodities to be calculated.
6. An article quality score acquisition apparatus, characterized in that the apparatus comprises:
the first acquisition module is used for sequentially inquiring the corresponding relation table and the evaluation template table of the preset evaluation template and the commodity and acquiring element codes of evaluation elements contained in the evaluation template corresponding to the commodity to be calculated;
the second obtaining module is used for inquiring the corresponding evaluation element sub-table according to the element codes and obtaining the codes of the evaluation items corresponding to the evaluation elements;
the third obtaining module is used for inquiring the corresponding evaluation item sub-table according to the codes of the evaluation items and obtaining the relevant information of the evaluation items corresponding to the evaluation elements;
the score calculation module is used for starting a corresponding task to calculate the related information of each evaluation item and the related information of the commodity to be calculated according to the corresponding relation between the preset evaluation item and the task to obtain the score of each evaluation item;
and the score summarizing module is used for summarizing and calculating the scores of the evaluation items and acquiring the quality score of the commodity to be calculated.
7. The commodity quality score acquisition device according to claim 6, wherein the first acquisition module includes:
the first query unit is used for acquiring relevant information of a commodity to be calculated and querying a template code of an evaluation template corresponding to the commodity to be calculated from a preset corresponding relation table of the evaluation template and the commodity according to the relevant information of the commodity to be calculated;
and the second query unit is used for querying a preset evaluation template table according to the template codes and acquiring the element codes of the evaluation elements contained in the evaluation template.
8. The product quality score acquisition apparatus according to claim 6 or 7, wherein the score calculation module includes:
the task obtaining unit is used for inquiring the corresponding relation between a preset evaluation item and a task according to the received related information of the evaluation item and obtaining the task corresponding to the evaluation item;
the information acquisition unit is used for acquiring information required for calculating the evaluation item from the related information of the commodity to be calculated;
and the score calculating unit is used for executing tasks corresponding to the evaluation items in parallel, and calculating the related information of the evaluation items and the information required for calculating the evaluation items to obtain the scores of the evaluation items.
9. The product quality score acquisition apparatus according to claim 6 or 7, wherein the score calculation module further includes:
a method extraction unit for extracting a calculation method corresponding to each evaluation item;
the score calculating unit is further used for calculating the related information of each evaluation item and the related information of the commodity to be calculated by using the calculating method to obtain the score of each evaluation item.
10. The product quality score acquisition device according to claim 6 or 7, wherein the score aggregation module is specifically configured to:
and summarizing and calculating the scores of the evaluation items to obtain the total scores of the deduction items and the commodities to be calculated.
CN201911145090.2A 2019-11-20 2019-11-20 Commodity quality score obtaining method and device Pending CN110991836A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911145090.2A CN110991836A (en) 2019-11-20 2019-11-20 Commodity quality score obtaining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911145090.2A CN110991836A (en) 2019-11-20 2019-11-20 Commodity quality score obtaining method and device

Publications (1)

Publication Number Publication Date
CN110991836A true CN110991836A (en) 2020-04-10

Family

ID=70085404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911145090.2A Pending CN110991836A (en) 2019-11-20 2019-11-20 Commodity quality score obtaining method and device

Country Status (1)

Country Link
CN (1) CN110991836A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297082A (en) * 2021-05-27 2021-08-24 北京中指讯博数据信息技术有限公司 Product quality evaluation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297082A (en) * 2021-05-27 2021-08-24 北京中指讯博数据信息技术有限公司 Product quality evaluation method and device

Similar Documents

Publication Publication Date Title
CN110321344B (en) Information query method and device for associated data, computer equipment and storage medium
CN104182405B (en) Method and device for connection query
CN104123374B (en) The method and device of aggregate query in distributed data base
CN104699718B (en) Method and apparatus for being rapidly introduced into business datum
JP5721818B2 (en) Use of model information group in search
US20220358178A1 (en) Data query method, electronic device, and storage medium
JP2019504371A (en) Method and apparatus for question clustering processing in automatic question answering system
US9898508B2 (en) Method and device for processing information
US20110208691A1 (en) Accessing Large Collection Object Tables in a Database
US20160328445A1 (en) Data Query Method and Apparatus
CN109062936B (en) Data query method, computer readable storage medium and terminal equipment
CN110704486B (en) Data processing method, device, system, storage medium and server
CN102968417A (en) Searching method and system applied to computer network
TW201333730A (en) Web page search method and apparatus
CN116756216A (en) Time sequence data acquisition method and device, electronic equipment and storage medium
CN113986948A (en) Query method, device, server and storage medium for instant message
CN115080607A (en) A method, device, device and storage medium for optimizing structured query statement
CN112527917A (en) Data processing method and device
CN102314464A (en) Lyrics searching method and lyrics searching engine
CN110895538A (en) Data retrieval method, device, storage medium and processor
CN106557483B (en) Data processing method, data query method, data processing equipment and data query equipment
CN110991836A (en) Commodity quality score obtaining method and device
CN112445819B (en) Data processing method, device, equipment and storage medium
CN110874366A (en) Data processing and query method and device
CN117194498A (en) Data aggregation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200410