CN111221865A - Recipe query method and device, electronic equipment and storage medium - Google Patents

Recipe query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111221865A
CN111221865A CN202010019830.4A CN202010019830A CN111221865A CN 111221865 A CN111221865 A CN 111221865A CN 202010019830 A CN202010019830 A CN 202010019830A CN 111221865 A CN111221865 A CN 111221865A
Authority
CN
China
Prior art keywords
formula
route
weight
determining
target commodity
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
CN202010019830.4A
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.)
Shanghai Hex Information Technology Co ltd
Original Assignee
Shanghai Hex Information Technology 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 Shanghai Hex Information Technology Co ltd filed Critical Shanghai Hex Information Technology Co ltd
Priority to CN202010019830.4A priority Critical patent/CN111221865A/en
Publication of CN111221865A publication Critical patent/CN111221865A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application provides a method, a device, electronic equipment and a storage medium for inquiring a formula, which relate to the technical field of routing, and the method comprises the following steps: determining a formula route for the target commodity based on the target commodity; determining the weight of each material in each formula route and the weight of the sub-materials forming the material, and taking the result of adding the weight of each material in the formula route and the weight of the sub-materials forming the material as the route weight of the formula route; and determining the result of the formula query according to the formula route with the maximum routing weight in each formula route. According to the method and the device, the formula of the target commodity is determined by determining the formula route with the largest weight, the formula meeting the user requirement can be obtained after the user inputs the target commodity, and the efficiency and convenience for inquiring the formula of the target commodity are improved.

Description

Recipe query method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of query technologies, and in particular, to a method and an apparatus for querying a recipe, an electronic device, and a storage medium.
Background
In the fields including the catering and medicine industries, in the process of producing target commodities, production needs to be performed according to the formula of the target commodities, so that the formula of the target commodities meeting the conditions of time and regions needs to be searched in a large number of commodities. At present, the needed target commodity formulas are obtained by inquiring and contrasting all the listed commodity formulas one by one, and the formulas of the target commodities meeting the conditions are manually screened, so that the problems of low efficiency and low convenience exist.
Disclosure of Invention
Embodiments of the present application provide a method, an apparatus, an electronic device, and a storage medium for recipe query, so as to solve the problems of low efficiency and low convenience in the existing method.
An embodiment of the present application provides a method for recipe query, including: determining a recipe route for a target commodity based on the target commodity; determining the weight of each material in each formula route and the weight of the sub-materials forming the material, and taking the result of adding the weight of each material in each formula route and the weight of the sub-materials forming the material as the route weight of each formula route; and determining a formula query result according to the formula with the maximum routing weight in each formula route.
In the implementation process, the formula of the target commodity is determined by determining the formula route with the largest weight, so that a user can obtain the formula meeting the user requirement after inputting the target commodity, and the efficiency and convenience for inquiring the formula of the target commodity are improved.
Optionally, the determining a recipe route for the target good based on the target good comprises: determining the identification number of the target commodity according to the received information of the target commodity configured by the user; and determining a formula tree of the target commodity based on the identification number of the target commodity, and determining a formula route of the target commodity based on the formula tree.
In the implementation process, the formula tree of the target commodity is determined according to the identification number of the target commodity, and the formula tree of the target commodity can be found in the formula trees of a plurality of commodities more accurately and quickly, so that the overall efficiency of formula query is improved.
Optionally, the determining, according to the received information of the target product configured by the user, the identification number of the target product includes: determining nodes in an idle state based on a polling mode; receiving information of a target commodity configured by a user through the node in the idle state; and matching the identification number of the target commodity through the node in the idle state.
In the implementation process, the nodes in the idle state are searched in a polling mode, and the formula query tasks are processed on the nodes in the idle state, so that the formula query tasks can be ensured to be simultaneously performed at multiple nodes, and the efficiency of the formula query method is improved.
Optionally, the determining a weight of each material in each recipe route, and adding the weight of each material in the recipe route as a result of the weight of each material in the recipe route, includes: determining a weight of each material in the recipe route based on the demand information and the material acquisition area; and adding the weight of each material in the formula route to obtain the route weight of the formula route.
In the implementation process, the weights of all materials in the formula route are referred to when the weight of the formula route is calculated, so that the accuracy of weight setting of the formula route can be improved.
Optionally, before the receiving the information of the target product configured by the user and matching the identification number of the target product, the method further includes: taking the target commodity as a root node; determining a sub-node topological structure formed by each sub-node based on the inclusion relation among the materials of the target commodity; constructing the formula tree of the target commodity based on the root node, the child nodes and the child node topology structure.
In the implementation process, the materials of the target commodity are unfolded into the formula tree according to the inclusion relationship among the materials, so that the integrity of the formula tree is improved, and meanwhile, the layering of the materials needed by the target commodity can be reflected, and therefore, the complete formula of the target commodity can be obtained.
Optionally, the determining a recipe route for the target good based on the recipe tree includes: generating the recipe route for the target commodity based on a route path from the root node to a leaf node via a child node in the child node topology.
In the implementation process, based on the formula route generated by the nodes of each layer of the sub-node topological structure, the nodes of each layer can be selected and covered, and the accuracy and the integrity of the formula route are improved.
Optionally, selecting the formula route with the largest route weight to combine to obtain the result of the formula query, where the result includes: and combining the materials corresponding to all leaf nodes in the formula route with the maximum route weight to obtain the result of the formula query.
In the implementation process, the leaf nodes can be quickly obtained through formula tree traversal, so that materials corresponding to the leaf nodes are combined to obtain a formula query result, and the formula query speed can be improved.
An embodiment of the present application further provides a device for querying a formula, including: a route determination module for determining a recipe route for a target commodity based on the target commodity; the weight determining module is used for determining the weight of each material in each formula route, and the result of adding the weights of each material in each formula route is used as the weight of each formula route; and the combination module is used for determining a formula query result according to the formula route with the maximum routing weight in each formula route.
In the implementation process, the formula of the target commodity is obtained by determining the formula route combination with the largest weight, so that a user can conveniently obtain the formula meeting the user requirement after inputting the target commodity, and the efficiency and convenience for inquiring the formula of the target commodity are improved.
Optionally, the route determining module is specifically configured to determine, according to the received information of the target product configured by the user, an identification number of the target product; and determining a formula tree of the target commodity based on the identification number of the target commodity, and determining a formula route of the target commodity based on the formula tree.
In the implementation process, the formula tree of the target commodity is determined according to the identification number of the target commodity, and the formula tree of the target commodity can be found in the formula trees of a plurality of commodities more accurately and quickly, so that the overall efficiency of formula query is improved.
Optionally, the route determining module is further specifically configured to determine a node in an idle state based on a polling manner; receiving information of a target commodity configured by a user through the node in the idle state; and matching the identification number of the target commodity through the node in the idle state.
In the implementation process, the nodes in the idle state are searched in a polling mode, and the formula query tasks are processed on the nodes in the idle state, so that the formula query tasks can be ensured to be simultaneously performed at multiple nodes, and the efficiency of the formula query method is improved.
Optionally, the weight determining module is specifically configured to determine a weight of each material in the recipe route based on the demand information and the material obtaining area; and adding the weight of each material in the formula route to obtain the route weight of the formula route.
In the implementation process, the weights of all materials in the formula route are referred to when the weight of the formula route is calculated, so that the accuracy of weight setting of the formula route can be improved.
Optionally, the route determining module is configured to use the target commodity as a root node; determining a sub-node topological structure formed by each sub-node based on the inclusion relation among the materials of the target commodity; constructing the formula tree of the target commodity based on the root node, the child nodes and the child node topology structure.
In the implementation process, the materials of the target commodity are unfolded into the formula tree according to the inclusion relationship among the materials, so that the integrity of the formula tree is improved, and meanwhile, the layering of the materials needed by the target commodity can be reflected, and therefore, the complete formula of the target commodity can be obtained.
Optionally, the route determining module is specifically configured to generate the recipe route of the target product based on a route path from the root node to a leaf node via a child node in the child node topology.
In the implementation process, based on the formula route generated by the nodes of each layer of the sub-node topological structure, the nodes of each layer can be selected and covered, and the accuracy and the integrity of the formula route are improved.
Optionally, the combination module is specifically configured to combine the materials corresponding to all leaf nodes in the recipe route with the largest routing weight to obtain the result of the recipe query.
In the implementation process, the leaf nodes can be quickly obtained through formula tree traversal, so that materials corresponding to the leaf nodes are combined to obtain a formula query result, and the formula query speed can be improved.
The present embodiment also provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes the program instructions to perform the steps in any one of the above methods.
The present embodiment also provides a storage medium, in which computer program instructions are stored, and when the computer program instructions are executed by a processor, the steps in any one of the above methods are executed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Fig. 1 is a flowchart of a recipe query method according to an embodiment of the present disclosure.
Fig. 2 is a flowchart of steps provided in an embodiment of the present application for determining a recipe route for a target good based on the target good.
Fig. 3 is a flowchart of another step of determining a recipe route for a target commodity based on the target commodity according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a recipe tree according to an embodiment of the present application.
Fig. 5 is a flowchart of a step of determining an identification number of a target product according to received information of the target product configured by a user according to an embodiment of the present application.
Fig. 6 is a flowchart of a step of determining a weight of each material in each recipe route, and adding the weights of each material in the recipe routes as the route weights of the recipe routes according to an embodiment of the present application.
Fig. 7 is a schematic diagram of a recipe query implementation apparatus according to an embodiment of the present application.
Icon: 40-means for implementing a recipe query; 401-route determination module; 402-a weight determination module; 403-combining module.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
In the description of the present application, it is noted that the terms "first", "second", and the like are used merely for distinguishing between descriptions and are not intended to indicate or imply relative importance.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
BOM (Bill Of Material) is an important component Of MRP (Material Requirement Planning) and ERP (Enterprise Resource Planning), and is used in almost all production and food retail industries to record all materials and related attributes used in a project, i.e. the membership, unit usage and other attributes Of a master and all children, which are generally called a Material table or a formula Material table or a commodity formula.
The design of the bill of materials is mainly used in the production industry, the MRP and ERP system needs to accurately calculate the quantity and time of the required materials, an accurate and complete product formula bill of materials, namely a commodity formula, is required to reflect the quantity, the dependency relationship, the multi-level relationship and the like of the commodities and the components (materials) of the commodities, the accuracy and the timeliness of the commodity formula are the core factors of the accuracy of the ERP production plan and the correctness of the supply chain plan, and therefore the formula query to obtain the formula of the target commodity is crucial in the field of the supply chain.
An embodiment of the present application provides a method for querying a formula, please refer to fig. 1, where fig. 1 is a flowchart of the method for querying a formula provided in the embodiment of the present application, and the method includes the following steps:
step S1: a recipe route for the target good is determined based on the target good.
Referring to fig. 2 with reference to fig. 1, fig. 2 is a flowchart of steps for determining a recipe route for a target good based on the target good according to an embodiment of the present application. Optionally, step S1 is specifically divided into the following sub-steps:
step S11: and determining the identification number of the target commodity according to the received information of the target commodity configured by the user.
Step S12: and determining a formula tree of the target commodity based on the identification number of the target commodity, and determining a formula route of the target commodity based on the formula tree.
It is understood that the user may configure the information of the target product by text input, voice input, or picture input. The target commodity can be a commodity which is processed based on materials in a formula after the beverage, the medicine, the food and the like are combined by the formula. For example, taking the target commodity as the black ice tea, the user may input "a formula of black ice tea" through text voice, or upload a photo of black ice tea directly. A formula tree is a relational tree used to represent the relationship between a commodity and materials required to form the commodity, and a formula tree usually uses a commodity as a root node (also called a parent node), uses materials of the commodity as child nodes, and uses children materials forming the materials as child nodes of the materials for materials with children materials.
In order to improve the accuracy and convenience of finding the formula tree of the target commodity in the formula trees of a plurality of commodities, the embodiment may use the identification number of the target commodity to distinguish different target commodities.
It can be understood that, in order to match the target product, a database of the product needs to be established, in the product database, the product and the product identification number are in one-to-one correspondence, and the product identification number may be a product identification number using a Chinese and English name abbreviation, a number, or other character code. After receiving the target commodity information configured by the user, searching a target commodity identification number corresponding to the target commodity in the commodity database.
As an implementation manner, the formula tree of the commodity may be stored in the hash list, and after the identification number of the target commodity is found, the formula tree of the target commodity is directly found in the hash list with the identification number of the target commodity as a key value, without comparing all stored formula trees with the formula tree of the target commodity one by one, so as to determine whether the compared formula tree of the commodity is the formula tree of the target commodity, thereby improving the rate of determining the target formula tree.
Referring to fig. 3, fig. 3 is a flowchart of another step of determining a recipe route for a target good based on the target good according to an embodiment of the present application. Optionally, step S11 may be preceded by the following sub-steps:
step S13: and taking the target commodity as a root node.
Step S14: and determining a sub-node topological structure formed by each sub-node based on the inclusion relation among the materials of the target commodity.
Step S15: and constructing a formula tree of the target commodity based on the root node, the child nodes and the child node topological structures.
Referring to fig. 4, fig. 4 is a schematic diagram of a recipe tree according to an embodiment of the present disclosure. And unfolding the materials of the target commodity into a formula tree according to the inclusion relationship among the materials, so that each material on the formula tree can be conveniently obtained through traversal of the formula tree, and the formula of the target commodity can be conveniently obtained.
Taking the target commodity as an example, the ice black tea comprises a material A, a material B and a material C; wherein the material A comprises a material A-1, a material A-2 and a material A-3; the material A-1 comprises a material A-1-1 and a material A-1-2; the material A-1-1 comprises a material A-1-1-1 and a material A-1-1-2. The material B comprises a material B-1 and a material B-2; the material C comprises a material C-1 and a material C-2. The ice black tea is used as a root node, and the child node where the material A-1 is located, the child node where the material A-2 is located and the child node where the material A-3 is located all use the root node as a father node. The child node where the material A-1-1 is located and the child node where the material A-1-2 is located both take the child node where the material A-1 is located as a father node. The child node where the material A-1-1-1 is located and the child node where the material A-1-1-2 is located both take the child node where the material A-1-1 is located as a father node. The child node where the material B-1 is located and the child node where the material B-2 is located both take the child node where the material B is located as a father node. The child node where the material C-1 is located and the child node where the material C-2 is located both take the child node where the material C is located as a father node.
Similarly, the formula tree of any commodity can be obtained by the method.
Referring to fig. 5, fig. 5 is a flowchart illustrating a step of determining an identification number of a target product according to received information of the target product configured by a user according to an embodiment of the present application. Optionally, step S11 may be divided into the following sub-steps:
step S11.1: the nodes in the idle state are determined based on a polling manner.
Step S11.2: and receiving information of the target commodity configured by the user through the node in the idle state.
Step S11.3: and matching the identification number of the target commodity through the node in the idle state.
As an embodiment, in order to deal with possible high frequency recipe query requests, multi-node deployment may be performed and there is system load balancing control. When a plurality of formula query tasks are concurrent, the nodes in the idle state are queried in a polling mode to allocate the formula query tasks to the idle nodes, and the newly triggered formula query tasks are processed on the nodes without the formula query tasks, so that the phenomenon that the formula query tasks of some or a plurality of nodes are too many to cause blockage is prevented, and the efficiency of the formula query method can be improved. In this embodiment, the node may be an electronic device with processing capability, such as a computer and a server. For example, each node may be a server, and a plurality of nodes may form a server cluster, so that a distributed query task processing system may be deployed on the server cluster to execute the methods described in S11.1 to S11.3 above, and when tasks of a plurality of recipe queries are concurrent, a plurality of query tasks may be assigned to different idle servers to execute the query tasks.
Whether the node is in an idle state or not and task allocation can be carried out through the following modes: when a service request consumer accesses the BOM service, firstly inquiring the BOM service from a service registration list through a host built-in LB (Load Balance) component, then selecting a target address (of a node) by a polling Load balancing strategy, and finally initiating a request to the target BOM service address.
With continuing reference to fig. 2, optionally, step S12 includes: a recipe route for the target commodity is generated based on a route path from the root node to the leaf node via the child node in the child node topology.
Referring to fig. 4, "black ice tea → material a-1-1-1" is a route of the recipe starting from the root node where the black ice tea is located and finally reaching the leaf node a-1-1-1.
Step S2: and determining the weight of each material in each formula route, and taking the sum of the weights of each material in the formula routes as the route weight of the formula route.
Referring to fig. 6, fig. 6 is a flowchart illustrating a step of determining a weight of each material in each recipe route, and adding the weights of each material in the recipe routes as the route weights of the recipe routes according to this embodiment. Optionally, step 2 may be specifically divided into the following sub-steps:
step S21: the weight of each material in the recipe route is determined based on the demand information and the material acquisition area.
With the rapid development of commerce and technology, consumers increasingly do not meet personalized requirements for traditional commodities produced through factory standardization, and the whole industry is developed in a direction from one standard product to flexible production and customization as required, which means that a production scene moves forward, is closer to the consumers, and completely meets the personalized requirements of the consumers. The weight of each material in the formula route is determined based on the demand information and the material acquisition area, the finally obtained formula is closer to the demand of consumers, and the scene applicability of the formula query method is improved. Wherein the requirement information can be understood as requirements for the attributes of the material, including but not limited to: variety, color, demand, price and other information, and the material acquisition area includes but is not limited to material producing area, material transaction area or material processing area and the like. Taking the material a-1-1-1 in the ice black tea as an example, assuming that the material a-1-1-1 is tea, the demand information may include information such as tea variety, color (such as picking time, baking degree), demand (such as weight), and the like, and the material acquisition area may be, for example, a tea production area, a tea transaction area, a tea processing area, and the like.
Step S22: and adding the weight of each material in the formula route to obtain the routing weight of the formula route.
Step S3: and determining a formula query result according to the formula with the maximum routing weight in each formula route.
Optionally, step S3 specifically includes: and combining the materials corresponding to all leaf nodes in the formula route with the maximum route weight to obtain a formula query result.
As an embodiment, at the beginning of the recipe query task, all material weights in the recipe tree are set to 0. Illustratively, the materials A-1, B-1 and C-1 in the recipe tree in FIG. 4 are materials necessary for forming ice black tea, and the next-level materials for forming the materials A-1, B-1 and C-1 can be arbitrarily combined. And if the user demand information is' polysaccharide and ice, adding 1 to the weight of the material A-1, the material A-1-1, the material B-1 and the material C-2. And if the regional rule is 'south China', adding 2 to the weight of the material B-2 in south China. Then, in the three subtrees starting from material a-1, material B-1 and material C-1 in fig. 4, a formula route with the highest weight is selected, i.e., "material a → material a-1-1", "material B → material B-2" and "material C → material C-2".
And combining all the materials positioned at the leaf nodes in the three routes with the largest weight to obtain a material A-1-1-1, a material B-2 and a material C-2, wherein the material A-1-1, the material B-2 and the material C-2 are the result of formula query of the target commodity ice black tea.
Referring to fig. 7, fig. 7 is a schematic diagram of a recipe query implementation apparatus according to an embodiment of the present application.
In order to better implement the recipe query method provided by the present embodiment, the present embodiment further provides an implementation apparatus 40 for recipe query. The implementation device 40 for recipe query includes:
a route determining module 401, configured to determine a recipe route of the target product based on the target product.
And a weight determining module 402, configured to determine a weight of each material in each recipe route, and add the weight of each material in the recipe route as the weight of the recipe route.
And the combining module 403 is configured to determine, in each formula route, a result of the formula query according to the formula route with the largest routing weight.
Optionally, the route determining module 401 is specifically configured to determine an identification number of the target product according to the received information of the target product configured by the user; and determining a formula tree of the target commodity based on the identification number of the target commodity, and determining a formula route of the target commodity based on the formula tree.
Optionally, the route determining module 401 is further specifically configured to determine a node in an idle state based on a polling manner; receiving information of a target commodity configured by a user through a node in an idle state; and matching the identification number of the target commodity through the node in the idle state.
Optionally, the weight determining module 402 is specifically configured to determine the weight of each material in the recipe route based on the demand information and the material obtaining area; and adding the weight of each material in the formula route to obtain the routing weight of the formula route.
Optionally, the route determining module 401 is specifically configured to use the target commodity as a root node; determining a sub-node topological structure of each sub-node based on the inclusion relation among the materials of the target commodity; and constructing a formula tree of the target commodity based on the root node, the child nodes and the child node topological structures.
Optionally, the route determining module 401 is further specifically configured to generate a formula route of the target product based on a route path from the root node to the leaf node via the child node of the child node topology.
Optionally, the combining module 403 is specifically configured to combine the materials corresponding to all leaf nodes in the formula route with the largest routing weight to obtain a result of the formula query.
The present embodiment also provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes the program instructions to perform the steps in any one of the above methods.
The present embodiment also provides a storage medium, in which computer program instructions are stored, and when the computer program instructions are executed by a processor, the steps in any one of the above methods are executed.
Alternatively, the electronic device may be a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), or other electronic devices.
In summary, embodiments of the present application provide a method, an apparatus, an electronic device, and a storage medium for recipe query, where the method includes: determining a recipe route for a target commodity based on the target commodity; determining the weight of each material in each formula route and the weight of the sub-materials forming the material, and taking the result of adding the weight of each material in the formula route and the weight of the sub-materials forming the material as the route weight of the formula route; and determining the result of the formula query according to the formula route with the maximum routing weight in each formula route.
In the implementation process, the formula of the target commodity is determined through the formula route with the maximum weight in the formula tree, so that a user can obtain the formula meeting the user requirement after inputting the target commodity, and the efficiency and convenience for inquiring the formula of the target commodity are improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. The apparatus embodiments described above are merely illustrative, and for example, the block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Therefore, the present embodiment further provides a readable storage medium, in which computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the steps of any of the block data storage methods. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method of recipe query, comprising:
determining a recipe route for a target commodity based on the target commodity;
determining the weight of each material in each formula route and the weight of the sub-materials forming the material, and taking the result of adding the weight of each material in each formula route and the weight of the sub-materials forming the material as the route weight of each formula route;
and determining a formula query result according to the formula with the maximum routing weight in each formula route.
2. The method of claim 1, wherein the determining a recipe route for the target good based on the target good comprises:
determining the identification number of the target commodity according to the received information of the target commodity configured by the user;
and determining a formula tree of the target commodity based on the identification number of the target commodity, and determining a formula route of the target commodity based on the formula tree.
3. The method of claim 2, wherein the determining the identification number of the target product according to the received information of the target product configured by the user comprises:
determining nodes in an idle state based on a polling mode;
receiving information of a target commodity configured by a user through the node in the idle state;
and matching the identification number of the target commodity through the node in the idle state.
4. The method of claim 1, wherein determining the weight of each material in each of the recipe routes, adding the weight of each material in the recipe routes as the route weight of the recipe routes comprises:
determining a weight of each material in the recipe route based on the demand information and the material acquisition area;
and adding the weight of each material in the formula route to obtain the route weight of the formula route.
5. The method of claim 2, wherein before the receiving the information of the target product configured by the user and matching the identification number of the target product, further comprising:
taking the target commodity as a root node;
determining a sub-node topological structure formed by each sub-node based on the inclusion relation among the materials of the target commodity;
constructing the formula tree of the target commodity based on the root node, the child nodes and the child node topology structure.
6. The method of claim 5, wherein said determining a recipe route for the target good based on the recipe tree comprises:
generating the recipe route for the target commodity based on a route path from the root node to a leaf node via a child node in the child node topology.
7. The method of claim 6, wherein selecting the formula route with the highest route weight for combination to obtain the result of the formula query comprises:
and combining the materials corresponding to all leaf nodes in the formula route with the maximum route weight to obtain the result of the formula query.
8. An apparatus for recipe query, comprising:
a route determination module for determining a recipe route for a target commodity based on the target commodity;
the weight determining module is used for determining the weight of each material in each formula route and the weight of the sub-materials forming the material, and the sum of the weight of each material in the formula route and the weight of the sub-materials forming the material is used as the route weight of the formula route;
and the combination module is used for determining a formula query result according to the formula route with the maximum routing weight in each formula route.
9. An electronic device comprising a memory having stored therein program instructions and a processor that, when executed, performs the steps of the method of any of claims 1-7.
10. A storage medium having stored thereon computer program instructions for executing the steps of the method according to any one of claims 1 to 7 when executed by a processor.
CN202010019830.4A 2020-01-09 2020-01-09 Recipe query method and device, electronic equipment and storage medium Pending CN111221865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010019830.4A CN111221865A (en) 2020-01-09 2020-01-09 Recipe query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010019830.4A CN111221865A (en) 2020-01-09 2020-01-09 Recipe query method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111221865A true CN111221865A (en) 2020-06-02

Family

ID=70830992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010019830.4A Pending CN111221865A (en) 2020-01-09 2020-01-09 Recipe query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111221865A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103793403A (en) * 2012-10-31 2014-05-14 中国电信股份有限公司 Method and device for forwarding and searching information related with results
CN104331421A (en) * 2014-10-14 2015-02-04 安徽四创电子股份有限公司 High-efficiency processing method and system for big data
CN104598647A (en) * 2015-02-16 2015-05-06 李剑 Method for searching and matching articles by way of tree graph
CN106650225A (en) * 2016-10-25 2017-05-10 康美药业股份有限公司 FP growth algorithm model-based traditional Chinese medicine formula data mining method and system
CN106709700A (en) * 2016-12-23 2017-05-24 金蝶软件(中国)有限公司 Method and device for processing product structure in enterprise resource planning system
CN107967582A (en) * 2016-10-20 2018-04-27 中新软件(上海)有限公司 The bill-of-material structure generation method and device of product

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103793403A (en) * 2012-10-31 2014-05-14 中国电信股份有限公司 Method and device for forwarding and searching information related with results
CN104331421A (en) * 2014-10-14 2015-02-04 安徽四创电子股份有限公司 High-efficiency processing method and system for big data
CN104598647A (en) * 2015-02-16 2015-05-06 李剑 Method for searching and matching articles by way of tree graph
CN107967582A (en) * 2016-10-20 2018-04-27 中新软件(上海)有限公司 The bill-of-material structure generation method and device of product
CN106650225A (en) * 2016-10-25 2017-05-10 康美药业股份有限公司 FP growth algorithm model-based traditional Chinese medicine formula data mining method and system
CN106709700A (en) * 2016-12-23 2017-05-24 金蝶软件(中国)有限公司 Method and device for processing product structure in enterprise resource planning system

Similar Documents

Publication Publication Date Title
US8495007B2 (en) Systems and methods for hierarchical aggregation of multi-dimensional data sources
CN102253936B (en) Method for recording access of user to merchandise information, search method and server
US8108360B2 (en) Database object update order determination
CN101634994B (en) Service discovery and combination device
US9547541B2 (en) Interfacing between a caller application and a service module
CN109741060A (en) Information inquiry system, method, device, electronic equipment and storage medium
CN106407303A (en) Data storage method and apparatus, and data query method and apparatus
KR20100094021A (en) Customized and intellectual symbol, icon internet information searching system utilizing a mobile communication terminal and ip-based information terminal
CN106547646B (en) Data backup and recovery method and data backup and recovery device
US10134067B2 (en) Autocomplete of searches for data stored in multi-tenant architecture
CN106599153A (en) Multi-data-source-based waste industry search system and method
CN109726295A (en) Brand knowledge map display methods, device, figure server and storage medium
CN105373376A (en) Method and apparatus for configuring a software application
CN113392068A (en) Data processing method, device and system
US7949610B2 (en) Method and system for discovering dependencies in project plans of distributed system
CN101645935B (en) Web service combined method based on QoS indexes and Web service output parameters and device thereof
US8407255B1 (en) Method and apparatus for exploiting master-detail data relationships to enhance searching operations
CN102193988A (en) Method and system for retrieving node data in graphic database
US20090228435A1 (en) System and method for validating data record
CN117453980A (en) Metadata management, configuration page generation method, server and storage medium
CN111708761A (en) Partitioned autonomous distributed heterogeneous database management system and method
CN111221865A (en) Recipe query method and device, electronic equipment and storage medium
CN107315801B (en) parallel discrete event simulation system initialization data storage method
CN116225690A (en) Memory multidimensional database calculation load balancing method and system based on docker
CN102193979B (en) Control method for inquiring data from offline transaction of graphic database

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