Commodity management query request processing method, electronic equipment and storage medium
By setting up the Redis database on the server, storing the relationship data between the query field and product information, and using Redis caching technology to accelerate product query operations, the problem of unsatisfactory product management query requests under a large amount of product data is solved, and efficient data processing is achieved and system response.
Patent Information
- Application Number
- CN202411343806.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-14
AI Technical Summary
In the scenario of large amount of product data, the efficiency of product management query requests is not ideal, which affects the operating performance of the system.
By setting up a Redis database on the server, the relationship data between the query field and product information is stored, and the Redis caching technology is used to accelerate product query operations.
It greatly improves data processing speed and system response time, ensures that it can still operate efficiently in high-concurrency environments, and improves user experience.
Smart Images

Figure CN119441266A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of commodity management, and in particular to a commodity management query request processing method, electronic equipment, and storage medium. Background Art
[0002] The product management system can realize the automatic verification and creation of SKUs of different categories of products. By adopting the product management system, it can cope with high-concurrency request processing and improve the efficiency of product query and creation. However, when the product data is too large (more than 10 million data volumes), it will affect the efficiency of product query.
[0003] In summary, how to achieve efficient processing of product management query requests in the scenario of a large amount of product data is an urgent problem to be solved. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a product management query request processing method, electronic device, and storage medium to achieve efficient processing of product management query requests in the scenario of a large amount of product data.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] One aspect of the present invention provides a method for processing a commodity management query request, which is applied to a server, and the method comprises the following steps:
[0007] Step S1, in response to receiving a commodity management query request, extracting the variety code information and commodity attribute value in the commodity management query request;
[0008] Step S2, based on the variety code information and the commodity attribute value, querying the attribute group data of the target variety from the pre-built key attribute group table;
[0009] Step S3, in response to the corresponding attribute group data being found and the commodity attribute value passing the integrity check, converting the commodity attribute value into a query field in a preset format;
[0010] Step S4, using the query field, obtaining a query result including product information from a pre-built Redis database.
[0011] As a preferred technical solution, it also includes:
[0012] Step S5, in response to not finding the product information matching the query field in the database, constructing the product information based on the product attribute value and the variety code information, and adding the relationship between the query field and the product information into the Redis database.
[0013] As a preferred technical solution, the key attribute group table includes a variety code and at least one attribute group, wherein each of the attribute groups includes at least one key attribute and an attribute value indicating whether the attribute group is necessary.
[0014] As a preferred technical solution, the key attributes include key attribute name, attribute value, attribute type and whether it is required.
[0015] As a preferred technical solution, the construction process of the Redis database includes:
[0016] Establish the relationship between the query fields and the product information.
[0017] As a preferred technical solution, in the step S4, in response to obtaining the query result, the query result is fed back to the source of initiating the commodity management query request.
[0018] As a preferred technical solution, the commodity attribute values include the commodity's origin, brand, specification, shape, color, surface treatment, surface structure, technical standards, thickness and width information.
[0019] As a preferred technical solution, the commodity information includes commodity code information, commodity name information, variety code information, origin code information and key attribute value information.
[0020] Another aspect of the present invention provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned product management query request processing method.
[0021] Another aspect of the present invention provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned product management query request processing method.
[0022] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0023] (1) Realize efficient processing of product management query requests: To address the problem of unsatisfactory product query efficiency in scenarios with a large amount of product data, the present invention sets a Redis database to store the query field-product information relationship data, and can apply Redis cache technology to accelerate product query or creation, greatly improving data processing speed and system response time, ensuring efficient operation in a high-concurrency environment and improving user experience.
[0024] (2) Strong compatibility: On the one hand, this method is highly adaptable and can meet the needs of different business scenarios, reducing the complexity of system maintenance and development and improving the versatility and application scope of the system. On the other hand, through a unified data management method, it ensures the consistency and integrity of product information, facilitates data synchronization and maintenance on various platforms, and reduces the problem of data inconsistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Schematic diagram of the process of the commodity management query request processing method in the embodiment. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] Example 1
[0028] In view of the problems existing in the above-mentioned prior art, this embodiment provides a method for processing a commodity management query request, see Figure 1 , the method comprises the following steps:
[0029] Step S1, in response to receiving a commodity management query request, extracting the variety code information and commodity attribute value in the commodity management query request.
[0030] The interface call service is provided externally in the form of a microservice interface. The user provides the product code [PRODUCT_TYPE_CODE] and product attribute values (including origin, brand, rule, shape, color, surface treatment, surface structure, technical standards, thickness / diameter / outer diameter / wall thickness / belly height / waist height / height, width / wall thickness / wing width / leg width / height and other attribute values).
[0031] Step S2: Based on the variety code information and the commodity attribute value, query the attribute group data of the target variety from the pre-built key attribute group table.
[0032] According to the product code [PRODUCT_TYPE_CODE], query the attribute group data of the target product in the key attribute group table (T_BSMC_SKU_ATTR_FAMILY). If the attribute group data is not found, a failure is returned, indicating that the data is illegal and the attribute group data of the product needs to be maintained in advance. If the data group data is found, check whether the attribute value is complete according to the required attribute field of the key attribute (IS_REQUIRED_GROUP). If the required attribute value is missing, the product cannot be created and a failure is returned.
[0033] Specifically, the process of constructing the key attribute group table includes two steps: creating a key attribute management table and creating a key attribute group table.
[0034] The key attribute management table (T_BSMC_SKU_ATTR_TYPE) can maintain the key attribute name (ATTR_DESC), attribute value (ATTR_VALUE), attribute type (ATTR_TYPE, not limited to characters, numbers, value sets, etc.), and whether it is not required (IS_REQUIRED) to achieve convenient and quick maintenance of key attributes.
[0035] The key attribute group table (T_BSMC_SKU_ATTR_FAMILY) maintains the attribute group of each variety according to different varieties. The variety code (PRODUCT_TYPE_CODE) is the default attribute. Each attribute group can define different group names and codes (FAMILY_NAME, FAMILY_CODE), can assemble different key attributes (ATTR1...ATTRn), and can set the required attribute fields (IS_REQUIRED_GROUP) of the attribute group to achieve high scalability of required fields for different varieties. For example: IS_REQUIRED_GROUP ([1, 2, 4, 7]) means that ATTR1, ATTR2, ATTR4, and ATTR7 are required data.
[0036] Step S3, in response to the corresponding attribute group data being found and the commodity attribute value passing the integrity check, the commodity attribute value is converted into a query field in a preset format.
[0037] After the data integrity check is passed, the Key value is composed according to the key attribute fields, that is, the query field (SKU_REDIS_KEY: PRODUCTTYPECODE_MANUFACTURECODE_SHOPSIGN_SPEC_THICK_WID TH_WEIGHT_COLOR_ITEMSHAPE, for example, TL11_BGGF_HRB500E_GB / T1499.2-2018_1000_01).
[0038] Step S4, using the query field, querying from the pre-built Redis database to obtain query results including product information.
[0039] Use the query field to index in the Redis database. If the product data can be retrieved in the Redis database, the query result is obtained from the Oracle database that stores the full amount of product information based on the index, and the specific product information of the product (T_BSMC_SKU), that is, the product table, is returned. If it is not retrieved in the Redis database, the query is performed in the Oracle database with the same data as the Redis database.
[0040] Specifically, the product table (T_BSMC_SKU), including the product code (SKU_CODE), product name (SKU_NAME), variety code (PRODUCT_TYPE_CODE), origin code (MANUFACTURE_CODE), and key attribute values (ATTR_VALUE1...ATTR_VALUEn), is used to flexibly store product data.
[0041] Step S5, in response to not finding product information matching the query field in the database, constructing product information based on product attribute values and variety code information, and adding the relationship between the query field and the product information to the Oracle database and the Redis database respectively.
[0042] If the product information is not found in the Redis database, the complete product data is assembled according to the product attribute group information and written into the product table (T_BSMC_SKU) of Redis and Oracle database, and the Redis Key value is composed and written into the Redis database to facilitate the subsequent efficient and fast query of the product information.
[0043] This method has the following beneficial effects:
[0044] (1) Strong versatility: The commodity management method is flexibly designed to support a variety of different types of commodities, including steel bundles, service commodities, etc. It has high adaptability and can meet the needs of different business scenarios, reducing the complexity of system maintenance and development and improving the versatility and application scope of the system.
[0045] (2) Efficiency: Redis cache technology is introduced to accelerate product creation and query operations. By using Redis cache technology, the data processing speed and system response time are greatly improved, ensuring efficient operation in a high-concurrency environment and improving the user experience.
[0046] (3) High integrity: Product information is maintained in detail in the product table, making it compatible and supporting the data requirements of different platforms. Through a unified data management method, the consistency and integrity of product information is ensured, which facilitates data synchronization and maintenance on various platforms and reduces data inconsistency issues.
[0047] Example 2
[0048] This embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the commodity management query request processing method as described in Example 1.
[0049] Example 3
[0050] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the commodity management query request processing method as described in Example 1.
[0051] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for processing a commodity management query request, characterized in that: Applied to the server, the method comprises the following steps: Step S1, in response to receiving a commodity management query request, extracting the variety code information and commodity attribute value in the commodity management query request; Step S2, based on the variety code information and the commodity attribute value, querying the attribute group data of the target variety from the pre-built key attribute group table; Step S3, in response to the corresponding attribute group data being found and the commodity attribute value passing the integrity check, converting the commodity attribute value into a query field in a preset format; Step S4, using the query field, obtaining a query result including product information from a pre-built Redis database.
2. A method for processing commodity management query requests according to claim 1, characterized in that: Also includes: Step S5, in response to not finding the product information matching the query field in the database, constructing the product information based on the product attribute value and the variety code information, and adding the relationship between the query field and the product information into the Redis database.
3. A method for processing commodity management query requests according to claim 1, characterized in that: The key attribute group table includes a product code and at least one attribute group, wherein each attribute group includes at least one key attribute and an attribute value indicating whether the attribute group is necessary.
4. A method for processing commodity management query requests according to claim 3, characterized in that: The key attributes include key attribute name, attribute value, attribute type and whether it is required.
5. A method for processing commodity management query requests according to claim 1, characterized in that: The construction process of the Redis database includes: Establish the relationship between the query fields and the product information.
6. A method for processing commodity management query requests according to claim 1, characterized in that: In the step S4, in response to obtaining the query result, the query result is fed back to the source that initiated the commodity management query request.
7. A method for processing commodity management query requests according to claim 1, characterized in that: The commodity attribute values include the commodity's origin, brand, specification, shape, color, surface treatment, surface structure, technical standards, thickness and width information.
8. A method for processing commodity management query requests according to claim 1, characterized in that: The commodity information includes commodity code information, commodity name information, variety code information, origin code information and key attribute value information.
9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the commodity management query request processing method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: It includes one or more programs executed by one or more processors of an electronic device, and the one or more programs include instructions for executing the commodity management query request processing method as described in any one of claims 1-8.