Data updating method and device, electronic equipment, chip and medium

Through the incremental update method, product related information is used to accurately obtain cache key-value pairs, which solves the problem of long data update time in the existing technology and achieves rapid data validation and rapid business development.

CN118796846APending Publication Date: 2024-10-18ZUNYI BRANCH OF CHINA MOBILE GRP GUIZHOU COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311359915.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-18
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the existing technology, the data update time is long, and the updated data cannot be quickly configured and effective, which affects the rapid development of the business, especially when the amount of product data is large, full loading causes a long time problem.

Method used

Accurately obtain the cache key-value pairs that need to be updated through the product's associated information, use the incremental update method, determine the associated data and cache key-value pairs based on the product identification and incremental configuration relationship reported by the user, and query the full load log to determine the update status , and obtain data in the relational database according to the update status to update the cache database.

Benefits of technology

This shortens the data update time, enables the updated data to take effect quickly, supports rapid business development, and reduces the waste of system resources and refresh time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796846A_ABST
    Figure CN118796846A_ABST
Patent Text Reader

Abstract

The invention provides a data updating method and device, electronic equipment, a chip and a medium, and relates to the technical field of computers, the method comprises the following steps: determining associated data of a first commodity according to a commodity identifier of the first commodity fed back by a user and an incremental configuration relationship; according to the associated data and the commodity identifier, a first cache key value pair of the first commodity is determined, and the first cache key value pair comprises a first cache key and first cache data which need to be updated; according to the first cache key, querying a full-amount loading log, and determining an updating state of the first cache data; the method comprises the following steps: acquiring update data in a relational database, updating a first cache key value pair in a cache database according to an update state and the first cache key value pair, and accurately acquiring a cache key value pair needing to be updated through associated information of a commodity so as to realize accurate update of the cache key value pair needing to be updated, reduce data update time and improve the update efficiency of the commodity. The updated data can take effect quickly, and quick business development is supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data updating method, device, electronic device, chip and medium. Background Art

[0002] The product data of existing network services is mainly based on commodities, which derive basic data models such as products, services, attributes, and features. In addition, in order to meet business needs, commodities will also expand data models associated with commodities, such as product information and service information associated with commodities. At present, in existing network services, the access volume of commodity data is large. In order to improve system performance and response time, reduce database pressure, improve concurrent processing capabilities, achieve data consistency, and improve user experience, cached data update technology is very necessary.

[0003] However, the related technology uses full data loading to update data, that is, querying the product in various dimensions according to demand, creating multiple processes, and dividing each process into multiple threads for loading and caching. Full data loading can easily lead to the inability to quickly configure and take effect the product data, affecting the development of the business. When the amount of product data is large, full data loading will also result in a long loading time each time. Summary of the invention

[0004] The present disclosure provides a data updating method, device, electronic device, chip and medium to solve the problem in related technologies that the data updating time is long and the updated data cannot be quickly configured and take effect, which affects the rapid development of business. Through the associated information of the goods, the cache key-value pairs that need to be updated are accurately obtained to achieve accurate updating of the cache key-value pairs that need to be updated, reduce the data updating time, enable the updated data to take effect quickly, and support the rapid development of business.

[0005] A first aspect embodiment of the present disclosure proposes a data update method, which includes: determining associated data of the first commodity based on a commodity identification and an incremental configuration relationship of the first commodity fed back by a user, wherein the incremental configuration relationship includes an associated relationship between the commodity identification and an incremental update command; determining a first cache key-value pair of the first commodity based on the associated data and the commodity identification, wherein the first cache key-value pair includes a first cache key to be updated and first cache data corresponding to the first cache key; querying a full load log based on the first cache key to determine an update status of the first cache data; obtaining updated data in a relational database, and updating the first cache key-value pair in the cache database based on the update status and the first cache key-value pair.

[0006] In some embodiments of the present disclosure, determining the associated data of the first commodity based on the commodity identification and incremental configuration relationship of the first commodity fed back by the user includes: determining the commodity type corresponding to the first commodity based on the commodity identification; obtaining the incremental update command corresponding to the first commodity in the incremental configuration relationship based on the commodity type and the commodity identification; and executing the incremental update operation corresponding to the incremental update command to determine the associated data in the relational database corresponding to the first commodity.

[0007] In some embodiments of the present disclosure, determining the first cache key-value pair of the first product based on the associated data and the product identifier includes: querying the incremental configuration relationship and determining the cache character based on the associated data and the product identifier; determining the first cache key-value pair of the first product based on the cache character, the product identifier and the associated data.

[0008] In some embodiments of the present disclosure, querying the full load log according to the first cache key to determine the update status of the first cache data includes: judging whether the first cache data is stored in the relational database according to the first cache key, and obtaining the judgment result; and querying the full load log according to the judgment result to determine the update status of the first cache data.

[0009] In some embodiments of the present disclosure, according to the judgment result, querying the full load log and determining the update status of the first cache data includes: if the first cache data is stored in the relational database, querying the full load log according to the first cache key, and if the first cache data is stored in the full load log, determining that the update status of the first cache data is a modified status; if the first cache data is stored in the relational database, querying the full load log according to the first cache key, and if the first cache data is not stored in the full load log, determining that the update status of the first cache data is a newly added status; if the first cache data is not stored in the relational database, querying the full load log according to the first cache key, and if the first cache data is stored in the full load log, determining that the update status of the first cache data is a deleted status; if the first cache data is not stored in the relational database, querying the full load log according to the first cache key, and if the first cache data is not stored in the full load log, determining that the update status of the first cache data is an unmodified status.

[0010] In some embodiments of the present disclosure, obtaining updated data in a relational database and updating a first cache key-value pair in a cache database according to an update status includes: obtaining updated data corresponding to a first commodity in the relational database; when the update status is a new addition status or a modified status, storing the updated data in the cache database to update the first cache key-value pair; when the update status is a deletion status or an unmodified status, clearing the first cache key-value pair corresponding to the updated data from the cache database to update the first cache key-value pair.

[0011] In some embodiments of the present disclosure, the method also includes: updating the node data in the first data node corresponding to the first cache data through distributed coordination services and updating data; and updating the cache data in the server corresponding to the first cache data based on the first data node and the node data.

[0012] In some embodiments of the present disclosure, the method further includes: determining the status of the processed data during the update process according to the update status of the cache database and the server; and storing the updated status of the processed data in the cache database.

[0013] In some embodiments of the present disclosure, determining the status of the processed data during the update process based on the update status of the cache database and the server includes: if the cache database and the server have completed the update, determining the status of the processed data during the update process is an update completion status; if the cache database and / or the server have not completed the update, determining the status of the processed data is an update failure status.

[0014] A second aspect embodiment of the present disclosure proposes a data updating device, which includes: a query unit, which determines the associated data of the first commodity based on the commodity identification and incremental configuration relationship of the first commodity fed back by the user, and the incremental configuration relationship includes the association relationship between the commodity identification and the incremental update command; a first determination unit, which is used to determine the first cache key-value pair of the first commodity based on the associated data and the commodity identification, and the first cache key-value pair includes a first cache key to be updated and the first cache data corresponding to the first cache key; a second determination unit, which is used to query the full load log based on the first cache key to determine the update status of the first cache data; an update unit, which is used to obtain the updated data in the relational database, and update the first cache key-value pair in the cache database based on the update status and the first cache key-value pair.

[0015] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when used to run the computer program, executes the method described in the first aspect embodiment of the present disclosure.

[0016] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.

[0017] The fifth aspect embodiment of the present disclosure proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals including computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the method described in the first aspect embodiment of the present disclosure.

[0018] In summary, according to the data updating method proposed in the present invention, the associated data of the first commodity is determined according to the commodity identification and incremental configuration relationship of the first commodity fed back by the user, and the incremental configuration relationship includes the association relationship between the commodity identification and the incremental update command; according to the associated data and the commodity identification, the first cache key-value pair of the first commodity is determined, and the first cache key-value pair includes a first cache key to be updated and the first cache data corresponding to the first cache key; according to the first cache key, the full load log is queried to determine the update status of the first cache data; the updated data in the relational database is obtained, and the first cache key-value pair in the cache database is updated according to the update status and the first cache key-value pair; through the associated information of the commodity, the cache key-value pair that needs to be updated is accurately obtained to achieve accurate update of the cache key-value pair that needs to be updated, reduce data update time, and enable the updated data to take effect quickly, thereby supporting rapid business development.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0021] Figure 1 A flowchart of a data updating method provided by an embodiment of the present disclosure;

[0022] Figure 2 A flowchart of a data updating method provided by an embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram of determining an update status of first cache data provided by an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram of the structure of a data updating device provided in an embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions.

[0027] The commodity data of existing network services is mainly based on commodities, and basic data models such as commodities, services, attributes, and features are derived. These basic data models are the basic units for describing commodity information, and a complete commodity data structure can be constructed through them. Taking the most common traffic package commodity as an example, its basic composition includes basic commodity information, such as commodity name, description, price, etc. In addition, the commodity will also be associated with product information and service information. Product information mainly includes detailed information of the traffic package, such as traffic size, validity period, etc. Service information includes service content related to the commodity, such as refund policy, customer service contact information, etc.

[0028] In addition to the basic data model, there may be some extended data models to meet business needs. For example, a "promotional activity" data model can be defined to describe the promotional information of a product. This data model can include attributes such as promotion name, promotion time, and promotion amount. By associating these extended data models with the basic data model, a richer product data structure can be constructed.

[0029] According to the current statistics of commodity data volume, there are more than three million cache key-value pairs. In the current network business, the access volume of commodity data is large. In order to improve the performance and response time of the system, reduce the pressure on the database, improve the concurrent processing capability, achieve data consistency and improve the user experience, cached data update technology is very necessary.

[0030] However, the related technology uses a full data loading method to update data, that is, query the product in various dimensions according to demand, create multiple processes, and divide each process into multiple threads for loading and caching.

[0031] Specifically, in the process of handling business on the existing network, the relevant technology will query the product in various dimensions according to the needs. For example: query the traffic package products in a certain city, query the traffic package with a certain traffic value, and query the traffic package in a certain price range. A large number of business product data queries require high query capabilities of the existing network, and peak queries may have millions of requests. Therefore, the commodity business architecture of the existing network is to load the commodity data cache into the cache database in advance (that is, full load) to avoid a large number of requests causing connection storms to the database during peak access during business hours. Due to the huge amount of commodity data, the full load cache method will take a long time each time.

[0032] For example, when a traffic package product adds a city information, it needs to be sold in a certain city. At this time, according to the existing technical architecture, it is necessary to refresh the full data of Memcache and clear all cached data in JVM. Every time the product data is modified, it is necessary to update a small part of the data in the cache or most of the data by fully refreshing the cache, which consumes a lot of time and system resources.

[0033] It can be seen that the data update method of the relevant technology does not support incremental refresh, and the product cache can only be fully refreshed each time, which increases the refresh time and risk. At the same time, for the sake of system stability, the product cache refresh is configured to be fully refreshed during the idle time in the early morning, resulting in the inability to quickly configure and take effect product data, affecting business development.

[0034] In order to solve the problems existing in the related technology, the present invention proposes a data update method. Based on Redis, through an incremental caching process, according to the product identifier input by the user, the corresponding business cache key-value pairs are dynamically loaded according to the configuration, and real-time refresh is performed, thereby shortening the refresh time, and incrementally and accurately refreshing the modified data cache instead of the full data, so that the modified data can take effect quickly and support the rapid development of the business.

[0035] The method proposed in the present disclosure can achieve efficient and reliable data update, and is mainly used in the fields of Internet of Things, infrastructure, IT support, smart terminals, etc. It can be applied to cache refresh scenarios, which may specifically include online shopping websites, company employee information systems, etc., and are not limited in the embodiments of the present disclosure.

[0036] The data updating method provided by the present application is described in detail below with reference to the accompanying drawings.

[0037] Figure 1 Flow chart of a data updating method provided by an embodiment of the present disclosure. Figure 1 As shown, the data updating method includes steps 101-103.

[0038] Step 101: determining association data of the first commodity according to the commodity identifier and the incremental configuration relationship of the first commodity fed back by the user, wherein the incremental configuration relationship includes an association relationship between the commodity identifier and the incremental update command.

[0039] In an embodiment of the present disclosure, a product identification of a first product fed back by a user is received, and based on the product identification, a pre-set incremental configuration relationship is queried to determine an incremental update command corresponding to the current product identification in the incremental configuration relationship, and based on the incremental update command, associated data of the first product is determined.

[0040] In the present disclosure, the first product refers to the product currently modified by the user. The product identification refers to the identification information related to the modified first product, which is used to distinguish different products. The product identification can be a product ID, a shelf ID, a service ID, etc., which is not limited in the embodiments of the present disclosure.

[0041] The incremental configuration relationship refers to the association relationship between the pre-set product identification and the incremental update command, which can be set according to specific business needs and is not limited in the embodiments of the present disclosure. In the present disclosure, the incremental configuration relationship can be in the form of a table, specifically an incremental configuration table whose dimension is the incremental update command corresponding to the product identification.

[0042] Related data refers to product information related to the first product, including but not limited to related products, related shelf information, related cities, etc. For example, for a 5G data package product, its related information includes the data package products mounted under the 5G data package product, the shelf location of the data package, etc.

[0043] Step 102: Determine a first cache key-value pair of the first commodity according to the associated data and the commodity identifier, wherein the first cache key-value pair includes a first cache key to be updated and first cache data corresponding to the first cache key.

[0044] In an embodiment of the present disclosure, a first cache key-value pair that needs to be updated is determined according to the associated data and a commodity identifier corresponding to the first commodity.

[0045] Cache key-value pairs are a basic data structure in cache technology. It stores data in the form of key-value pairs in the cache for fast access and update. In a cache key-value pair, each data item consists of a key and a value, where the key is used to uniquely identify the data item and the value is the specific content of the data item. In the cache, there are many ways to store key-value pairs, such as hash tables, linked lists, red-black trees, etc. Different storage methods have different characteristics and applicable scenarios, which need to be selected according to specific needs and scenarios, and are not limited in the present disclosed embodiments.

[0046] Step 103, querying the full load log according to the first cache key to determine the update status of the first cache data;

[0047] In an embodiment of the present disclosure, update data of a relational database is obtained, and based on a first cache key, it is determined whether a first cache value is stored in the relational database. Based on the determination result, a full load log is queried, and based on the query result, an update status of the first cache data is determined.

[0048] The update status refers to an update operation on the first cache data. In the present disclosure, the update status includes a modification status, a new addition status, a deletion status, and an unmodified status.

[0049] The full load log can obtain the log information recorded when the first product is fully loaded from the relational database through the incremental update instruction. The log information may include the loading time, the amount of loaded data, the loading status and other information.

[0050] It should be noted that the full load log is the log information recorded for the first product during the full load, rather than all the log information in the relational database.

[0051] Step 104: Acquire the updated data in the relational database, and update the first cache key-value pair in the cache database according to the updated state and the first cache key-value pair.

[0052] In an embodiment of the present disclosure, the first cache key-value pair in the cache database is updated according to the above-mentioned update data and update status.

[0053] Updated data refers to the latest data in the relational database. The relational database refers to the SQL database, and the cache database refers to the redis database.

[0054] In addition, in the present disclosure, after the first cache data in the cache database is updated, the cache data in the server corresponding to the first cache data may also be updated according to the distributed coordination service.

[0055] In summary, according to the data updating method proposed in the present invention, the associated data of the first product is determined according to the product identification of the first product fed back by the user and the incremental configuration relationship; the first cache key-value pair of the first product is determined according to the associated data and the product identification, and the first cache key-value pair includes the first cache key to be updated and the first cache data corresponding to the first cache key; according to the first cache key, the full load log is queried to determine the update status of the first cache data; the updated data in the relational database is obtained, and the first cache key-value pair in the cache database is updated according to the update status and the first cache key-value pair, and the cache key-value pair that needs to be updated is accurately obtained through the associated information of the product, so as to realize the accurate update of the cache key-value pair that needs to be updated, reduce the data update time, and enable the updated data to take effect quickly, so as to support the rapid development of business.

[0056] based on Figure 1 The embodiment shown, Figure 2 The following further illustrates a flow chart of a data updating method proposed in the present disclosure. Figure 2 based on Figure 1 In the embodiment shown, step 101, step 102 and step 103 are further defined. Figure 2In the embodiment shown, step 101 includes step 201, step 202 and step 203, step 102 includes step 204 and step 205, step 103 includes step 206 and step 207, step 104 includes step 208 and step 209, and step 104 includes step 210 and step 211. Figure 2 As shown, the method comprises the following steps:

[0057] Step 201: Determine the commodity type corresponding to the first commodity according to the commodity identifier.

[0058] In an embodiment of the present disclosure, the user first modifies the product information of the first product, for example, the user modifies the product name, description, price, inventory, etc., and saves the modified product information to the relational database. When updating product information, the user can enter the product information management page, on which the user can enter or select the product ID to be modified, including but not limited to: product ID, shelf ID, service ID, etc.

[0059] When the process scans that the current cache data needs to be updated, the incremental process is triggered. The incremental process determines the commodity type corresponding to the first commodity in the relational database by scanning the commodity identifier of the first commodity.

[0060] Step 202: Obtain an incremental update command corresponding to the first product in the incremental configuration relationship according to the product type and the product identifier.

[0061] In an embodiment of the present disclosure, according to the commodity type and commodity identification of the first commodity, the incremental configuration relationship corresponding to the commodity is queried, and the corresponding incremental refresh command in the incremental configuration relationship is determined.

[0062] In an optional embodiment of the present disclosure, the incremental process queries the incremental configuration relationship corresponding to the commodity type according to the commodity identification, wherein the incremental configuration relationship can be represented in the form of an incremental configuration table. The incremental update command (i.e., incremental refresh SQL statement) corresponding to the commodity identification is obtained. The incremental process can directly use the SQL statement to perform subsequent data update operations.

[0063] It is understandable that the incremental update command will filter according to the product identifier and only update the cached data of the changed products instead of updating the cached data of all products, thereby improving data update efficiency and reducing resource consumption.

[0064] Step 203: Execute the incremental update operation corresponding to the incremental update command to determine the associated data in the relational database corresponding to the first product.

[0065] In an embodiment of the present disclosure, the associated data related to the first commodity in the relational database is determined by executing the incremental update operation corresponding to the incremental update command.

[0066] In an optional embodiment of the present disclosure, the incremental process will use the acquired incremental update command (i.e., incremental refresh SQL statement) to perform a query operation on the relational database, and the incremental process can reversely query the commodity-related information based on the commodity ID. For example, the commodity ID can be used to query the commodity-related products, the commodity-related cities, the commodity-related shelf information, and other commodity information associated with the first commodity.

[0067] Step 204: query the incremental configuration relationship based on the associated data and the product identifier to determine the cached characters.

[0068] In an embodiment of the present disclosure, the cached characters may be cached prefix letters, which may be obtained by querying an incremental configuration relationship based on associated data and a commodity identifier.

[0069] In an optional embodiment of the present disclosure, the cache prefix can be obtained through the incremental configuration table and corresponds to the key_prefix field of cfg_product_load of the full configuration table. This ensures that the cache key prefix used during incremental refresh and full load is consistent, thereby avoiding cache key conflicts and data inconsistencies.

[0070] Step 205: Determine a first cache key-value pair of the first product according to the cache character, the product identifier, and the associated data.

[0071] In an embodiment of the present disclosure, the cache character, the commodity identifier, and the associated data may be assembled to obtain a first cache key-value pair of the first commodity.

[0072] In an optional embodiment of the present disclosure, the incremental process can assemble the cache key-value pairs that need to be refreshed based on the queried product association information. During the incremental refresh, the present disclosure can use the key_prefix field in the cfg_product_load configuration table to assemble the prefix of the cache key, and then load the product data into the cache. For example, the cache prefix + product id can be used for assembly.

[0073] Among them, when loading the whole amount, you can also use the same cache key prefix to assemble the cache key-value pairs that need to be refreshed. In this way, whether it is a full load or an incremental refresh, the same cache key prefix will be used to ensure the consistency and accuracy of the cached data.

[0074] It should be noted that when assembling cache key-value pairs, care should be taken to ensure the uniqueness of the key and the accuracy of the value. Uniqueness can be achieved by using a unique product ID or other unique identifier, and accuracy can be guaranteed through correct query and assembly operations.

[0075] Step 206: determine whether the first cache data is stored in the relational database according to the first cache key, and obtain a determination result.

[0076] In an embodiment of the present disclosure, the relational database is queried using the first cache key to determine whether the first cache data is stored in the relational database.

[0077] Step 207: According to the judgment result, query the full load log to determine the update status of the first cache data.

[0078] In an embodiment of the present disclosure, if the first cache data is stored in a relational database, the full load log is queried according to the first cache key. If the first cache data is stored in the full load log, it is determined that the update status of the first cache data is a modified status; if the first cache data is stored in a relational database, the full load log is queried according to the first cache key. If the first cache data is not stored in the full load log, it is determined that the update status of the first cache data is a newly added status; if the first cache data is not stored in the relational database, the full load log is queried according to the first cache key. If the first cache data is stored in the full load log, it is determined that the update status of the first cache data is a deleted status; if the first cache data is not stored in the relational database, the full load log is queried according to the first cache key. If the first cache data is not stored in the full load log, it is determined that the update status of the first cache data is a non-modified status.

[0079] In an optional embodiment of the present disclosure, Figure 3 A schematic diagram of determining the update status of the first cache data is shown, and a judgment result is obtained by querying a relational database. According to the judgment result, based on the first cache key-value pair, the loading cache log during the full refresh is compared with the latest batch number recorded to determine whether the first cache data is stored in the full load log. According to the query result of the full load log, the update status of the current first cache data is determined.

[0080] Specifically, in the present disclosure, after querying the full load log, the main purpose is to confirm whether the first cache data exists when the full refresh occurs. For example, if the first cache data exists, and the current update operation is to remove a certain product from the shelves, the first cache data needs to be deleted. If the first cache data does not exist, and the current update operation is to put a certain product on the shelves, the first cache data is updated and written to the cache.

[0081] In the full load log, no specific data is saved, only the corresponding cache key. By querying the first cache key, you can determine whether the first cache data existed during the last full refresh.

[0082] Step 208: Obtain update data corresponding to the first product in the relational database.

[0083] In the embodiments of the present disclosure, the latest data, that is, updated data, in the relational database may be queried according to the commodity identification.

[0084] In an optional embodiment of the present disclosure, the incremental process can query the latest data corresponding to the product identification from the relational database (sql database), that is, the updated data. When querying the latest updated data, it is necessary to ensure the accuracy and real-time nature of the query results.

[0085] A relational database is a database built on the relational database model, which uses concepts and methods such as set algebra to process data in the database. Relational databases include Oracle, DB2, SQL Server, Sybase, MySQL, etc.

[0086] Step 209: Update the first cache key-value pair in the cache database according to the update status and update data.

[0087] In an embodiment of the present disclosure, when the update status is a new addition status or a modified status, the update data is stored in the cache database to update the first cache key-value pair; when the update status is a deletion status or an unmodified status, the first cache key-value pair corresponding to the update data is cleared from the cache database to update the first cache key-value pair.

[0088] The cache database can be Redis. Redis is an open source high-performance key-value memory database developed in C language. It can be used as a database, cache, message middleware and other scenarios. It is a NoSQL (not-only sql, non-relational database) database.

[0089] In an optional embodiment of the present disclosure, the incremental process can use a Redis client library or a direct Redis operation API to call a Redis interface to load or delete update data according to the update status. The incremental process can load the update data into the cache database (Redis) based on the latest update data queried.

[0090] The incremental process ensures that the latest product information is stored in Redis by loading or deleting updated data in Redis.

[0091] Step 210: Update the node data of the first data node corresponding to the first cache data through distributed coordination services and updating data.

[0092] In the embodiments of the present disclosure, the distributed coordination service may be ZooKeeper. ZooKeeper is a distributed, open source distributed application coordination service, which is mainly software that provides consistency services for distributed applications, and provides functions including: configuration maintenance, domain name services, distributed synchronization, group services, etc.

[0093] In an optional embodiment of the present disclosure, the incremental process may use the ZooKeeper client library or the direct ZooKeeper operation API to notify ZooKeeper to modify the corresponding first data node. After receiving the notification of the incremental process, ZooKeeper may modify the corresponding node data according to the first data node.

[0094] Step 211: Update the cache data in the server corresponding to the first cache data according to the first data node and the node data.

[0095] In the embodiments of the present disclosure, the server refers to JVM. JVM is the abbreviation of Java Virtual Machine, which is a fictitious computer that is implemented by simulating various computer functions on an actual computer. JVM has its own complete hardware architecture, such as processor, stack, register, etc., and also has a corresponding instruction system.

[0096] In an optional embodiment of the present disclosure, by modifying the node data of the first data node, all applications that monitor the data node can be triggered to receive corresponding notifications. After listening to the notification of the modification of the ZooKeeper data node data, each application will update the local JVM cache according to the new node data in the notification.

[0097] In the present disclosure, the incremental process will complete the modification operation on the ZooKeeper data node and notify all applications listening to the node to update the local JVM cache, ensuring that the latest product information is stored in each application.

[0098] In addition, in the present disclosure, the state of the processed data during the update process can be determined according to the update status of the cache database and the server; and the state of the updated processed data is stored in the cache database. Wherein, determining the state of the processed data during the update process according to the update status of the cache database and the server includes: if the cache database and the server have completed the update, determining the state of the processed data during the update process is the update completion state; if the cache database and / or the server have not completed the update, determining the state of the processed data is the update failure state

[0099] In an optional embodiment of the present disclosure, when the incremental process has completed the update of the first cache data on Redis and the cache data of the server, and no interface returns a success mark, it is determined that the incremental process has completed processing the data. At this time, according to the update status of the cache database and the server, the state of the processed data in the update process is modified. In the present disclosure, the state of the processed data in the update process can be represented by the intermediate table data.

[0100] After that, the user can click on the query page to find the latest processing results of the data. In addition, when the user queries the product data again, the cached data in Redis (that is, the latest data after synchronization with the SQL database) will be obtained.

[0101] In summary, through the method provided by the present invention, through the incremental cache process, according to the product ID input by the user, the corresponding business cache key-value pairs are dynamically loaded according to the configuration, and a real-time refresh process is performed, thereby achieving fast refresh and accurate refresh, greatly improving efficiency and reducing the waste of system resources, and at the same time facilitating operation and maintenance personnel to quickly locate cache problems.

[0102] based on Figure 1 , Figure 2 In the illustrated embodiment, the present disclosure provides a specific data updating method.

[0103] In the embodiment of the present disclosure, by querying the corresponding incremental configuration table according to the input product identifier, obtaining the incremental query SQL statement, and reversely querying which cache values ​​this product will involve through the SQL statement. In the present disclosure, a product may involve query logic of different dimensions of multiple query services.

[0104] After querying the first cache key-value pair, compare the cache log loaded during full refresh according to the latest batch number recorded. When the data is newly added or modified, get the latest updated data from the relational database and call redis to add it; when the data is deleted or not modified, call redis directly to delete and update the data. This ensures that the product data in the cache is the latest updated data.

[0105] In summary, the method proposed in the present invention accurately obtains the cache key-value pairs that need to be updated through the associated information of the goods, so as to achieve accurate and rapid update of the cache key-value pairs that need to be updated, so that the updated data can take effect quickly and support the rapid development of business.

[0106] Figure 4 FIG. 4 is a schematic diagram of a data updating device 400 provided in an embodiment of the present disclosure. Figure 4 As shown, the data updating device comprises:

[0107] The query unit 410 determines the associated data of the first commodity according to the commodity identification and the incremental configuration relationship of the first commodity fed back by the user, wherein the incremental configuration relationship includes the association relationship between the commodity identification and the incremental update command;

[0108] A first determining unit 420 is used to determine a first cache key-value pair of the first commodity according to the associated data and the commodity identifier, where the first cache key-value pair includes a first cache key to be updated and first cache data corresponding to the first cache key;

[0109] The second determining unit 430 is used to query the full load log according to the first cache key to determine the update status of the first cache data;

[0110] The updating unit 440 is used to obtain the updated data in the relational database, and update the first cache key-value pair in the cache database according to the updated state and the first cache key-value pair.

[0111] In some embodiments of the present disclosure, the query unit 410 is used to: determine the product type corresponding to the first product based on the product identifier; obtain the incremental update command corresponding to the first product in the incremental configuration relationship based on the product type and the product identifier; execute the incremental update operation corresponding to the incremental update command to determine the associated data in the relational database corresponding to the first product.

[0112] In some embodiments of the present disclosure, the first determination unit 420 is used to: query the incremental configuration relationship and determine the cache character according to the associated data and the product identifier; determine the first cache key-value pair of the first product according to the cache character, the product identifier and the associated data.

[0113] In some embodiments of the present disclosure, the second determination unit 430 is used to: determine whether the first cache data is stored in the relational database according to the first cache key, and obtain a determination result; and query the full load log according to the determination result to determine the update status of the first cache data.

[0114] In some embodiments of the present disclosure, the second determination unit 430 is used to: if the first cache data is stored in a relational database, query the full load log according to the first cache key, and if the first cache data is stored in the full load log, determine that the update status of the first cache data is a modified status; if the first cache data is stored in a relational database, query the full load log according to the first cache key, and if the first cache data is not stored in the full load log, determine that the update status of the first cache data is a newly added status; if the first cache data is not stored in the relational database, query the full load log according to the first cache key, and if the first cache data is stored in the full load log, determine that the update status of the first cache data is a deleted status; if the first cache data is not stored in the relational database, query the full load log according to the first cache key, and if the first cache data is not stored in the full load log, determine that the update status of the first cache data is a non-modified status.

[0115] In some embodiments of the present disclosure, the update unit 440 is used to: obtain update data corresponding to the first product in the relational database; when the update status is a new addition status or a modified status, store the update data in a cache database; when the update status is a deletion status or an unmodified status, clear the update data from the cache database.

[0116] In some embodiments of the present disclosure, the device 400 also includes: a server update unit, which is used to update the node data in the first data node corresponding to the first cache data through distributed coordination services and update data; and update the cache data in the server corresponding to the first cache data according to the first data node and the node data.

[0117] In some embodiments of the present disclosure, the device 400 further includes: a status update unit, configured to determine the status of the processed data during the update process according to the update status of the cache database and the server; and store the updated status of the processed data in the cache database.

[0118] In some embodiments of the present disclosure, the status update unit is used to: if the cache database and the server have completed the update, determine that the status of the processed data during the update process is an update completion status; if the cache database and / or the server have not completed the update, determine that the status of the processed data is an update failure status.

[0119] In summary, through the data updating device, the associated data of the first commodity is determined according to the commodity identification and incremental configuration relationship of the first commodity fed back by the user, and the incremental configuration relationship includes the association relationship between the commodity identification and the incremental update command; according to the associated data and the commodity identification, the first cache key-value pair of the first commodity is determined, and the first cache key-value pair includes the first cache key to be updated and the first cache data corresponding to the first cache key; according to the first cache key, the full load log is queried to determine the update status of the first cache data; the updated data in the relational database is obtained, and the first cache key-value pair in the cache database is updated according to the update status and the first cache key-value pair, and the cache key-value pair that needs to be updated is accurately obtained through the associated information of the commodity, so as to realize the accurate update of the cache key-value pair that needs to be updated, reduce the data update time, and enable the updated data to take effect quickly, so as to support the rapid development of business.

[0120] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides a data updating device. Since the device provided in the embodiments of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.

[0121] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0122] Figure 5 is a block diagram of an electronic device 500 for implementing the above data update method according to an exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0123] Reference Figure 5 The electronic device 500 may include a communication interface 501, which can interact with other devices; a processor 502, which is connected to the communication interface 501 to interact with other devices and is used to execute the method provided by one or more of the above technical solutions when running a computer program; and a memory 503, on which the computer program is stored. Specifically, the specific processing process of the processor 502 can refer to the data update method described in the above embodiment of the present disclosure.

[0124] Of course, in actual application, the various components in the electronic device 500 are coupled together through the bus system 504. It can be understood that the bus system 504 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 5 Various buses are labeled as bus system 504 .

[0125] The memory 503 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 500. Examples of such data include: any computer program used to operate on the electronic device 500.

[0126] The method disclosed in the above embodiment of the present application can be applied to the processor 502, or implemented by the processor 502. The processor 502 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 502 or the instruction in the form of software. The above processor 502 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 502 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 503, and the processor 502 reads the information in the memory 503 and completes the steps of the above method in combination with its hardware.

[0127] In an exemplary embodiment, the electronic device 500 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0128] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the data updating method described in the above embodiments of the present disclosure.

[0129] The embodiments of the present disclosure further provide a computer program product, including a computer program, which executes the data updating method described in the above embodiments of the present disclosure when a processor is used to execute the computer program.

[0130] An embodiment of the present disclosure also proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals include computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the data update method described in the above embodiments of the present disclosure.

[0131] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0132] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0133] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0134] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0135] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0136] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0137] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0138] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A data updating method, characterized in that: The method comprises: Determine the associated data of the first commodity according to the commodity identifier and the incremental configuration relationship of the first commodity fed back by the user, wherein the incremental configuration relationship includes an associated relationship between the commodity identifier and the incremental update command; Determine, according to the associated data and the commodity identifier, a first cache key-value pair for the first commodity, wherein the first cache key-value pair includes a first cache key to be updated and first cache data corresponding to the first cache key; According to the first cache key, query the full load log to determine the update status of the first cache data; The updated data in the relational database is obtained, and the first cache key-value pair in the cache database is updated according to the updated state and the first cache key-value pair.

2. The method according to claim 1, characterized in that The determining, according to the commodity identifier of the first commodity fed back by the user and the incremental configuration relationship, the associated data of the first commodity comprises: Determining, according to the commodity identifier, a commodity type corresponding to the first commodity; According to the commodity type and the commodity identifier, obtaining an incremental update command corresponding to the first commodity in the incremental configuration relationship; An incremental update operation corresponding to the incremental update command is executed to determine associated data in a relational database corresponding to the first commodity.

3. The method according to claim 1, characterized in that The determining, according to the associated data and the commodity identifier, a first cache key-value pair of the first commodity comprises: According to the associated data and the commodity identifier, query the incremental configuration relationship to determine the cache character; A first cache key-value pair of the first commodity is determined according to the cache character, the commodity identifier, and the associated data.

4. The method according to claim 3, characterized in that The querying the full load log according to the first cache key to determine the update status of the first cache data includes: Determine, according to the first cache key, whether the first cache data is stored in the relational database, and obtain a determination result; According to the judgment result, the full load log is queried to determine the update status of the first cache data.

5. The method according to claim 4, characterized in that The querying the full load log according to the judgment result to determine the update status of the first cache data includes: If the first cache data is stored in the relational database, query the full load log according to the first cache key, and if the first cache data is stored in the full load log, determine that the update state of the first cache data is a modified state; If the first cache data is stored in the relational database, query the full load log according to the first cache key, and if the first cache data is not stored in the full load log, determine that the update state of the first cache data is a new state; If the first cache data is not stored in the relational database, query the full load log according to the first cache key, and if the first cache data is stored in the full load log, determine that the update state of the first cache data is a deletion state; If the first cache data is not stored in the relational database, the full load log is queried according to the first cache key, and if the first cache data is not stored in the full load log, it is determined that the update status of the first cache data is an unmodified status.

6. The method according to claim 5, characterized in that The acquiring updated data in the relational database and updating the first cache key-value pair in the cache database according to the updated state includes: Acquire update data corresponding to the first product in the relational database; When the update status is a newly added status or a modified status, the update data is stored in the cache database to update the first cache key-value pair; When the update state is a deletion state or an unmodified state, the first cache key-value pair corresponding to the update data is cleared from the cache database to update the first cache key-value pair.

7. The method according to claims 1-6, characterized in that: The method further comprises: Updating the node data of the first data node corresponding to the first cache data through the distributed coordination service and the update data; The cache data in the server corresponding to the first cache data is updated according to the first data node and the node data.

8. The method according to claim 7, characterized in that The method further comprises: Determining the state of the processed data during the updating process according to the updating status of the cache database and the server; The updated state of the processed data is stored in the cache database.

9. The method according to claim 8, characterized in that Determining the state of the processed data in the updating process according to the updating status of the cache database and the server includes: If the cache database and the server have completed updating, determining that the state of the processed data during the updating process is an updating completion state; If the cache database and / or the server has not completed the update, it is determined that the state of the processed data is an update failure state.

10. A data updating device, characterized in that: The device comprises: A query unit, which determines the associated data of the first commodity according to the commodity identifier and the incremental configuration relationship of the first commodity fed back by the user, wherein the incremental configuration relationship includes an association relationship between the commodity identifier and the incremental update command; A first determining unit, configured to determine a first cache key-value pair of the first commodity according to the associated data and the commodity identifier, wherein the first cache key-value pair includes a first cache key to be updated and first cache data corresponding to the first cache key; a second determining unit, configured to query a full load log according to the first cache key to determine an update status of the first cache data; The updating unit is used to obtain the updated data in the relational database, and update the first cache key-value pair in the cache database according to the updated state and the first cache key-value pair.

11. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the method described in any one of claims 1-9.

12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.

13. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal includes a computer instruction stored in the memory, and when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 9.