List updating method and apparatus, device, storage medium and program product
By configuring timeliness tags in the database according to business scenarios and data volume and differentiating message consumption channels, the problem of intense resource competition between different data tables is solved, data processing efficiency and resource utilization are improved, and the requirements of different business needs and data volumes are met.
Patent Information
- Application Number
- PCT/CN2025/137535
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-16
- Filing Date
- 2025-11-25
- Publication Date
- 2026-11-19
AI Technical Summary
In business systems, the interrelationships between different data tables lead to intense competition for resources, and high loads result in low data processing efficiency. This is especially true in customer relationship management systems, where the data volumes of customer lists, customer follow-up assignment lists, and customer order lists differ, leading to fierce competition for computing and bandwidth resources and impacting system processing efficiency.
By configuring timeliness tags for the lists in the first database according to business scenarios and data volume, and configuring different message consumption channels for different timeliness tags, the binary log change stream of the second database is obtained, pushed to the message queue, and routed to different message consumption channels according to the timeliness tags for data processing. Finally, the processed data is written to the target list in the first database.
It enables refined management and optimized processing of data, avoids competition for computing and bandwidth resources between data of different scales, balances the load between databases, and improves the processing efficiency and resource utilization of list updates in the database.
Smart Images

Figure CN2025137535_19112026_PF_FP_ABST
Abstract
Description
List update methods, devices, equipment, storage media and program products
[0001] Cross-references to related applications
[0002] This application claims priority to Chinese Patent Application No. 2025106362540, filed on May 16, 2025, entitled “List updating method, apparatus, device, storage medium and program product”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of computer technology, specifically to a list updating method, apparatus, device, storage medium, and program product. Background Technology
[0004] In business systems, data tables are indispensable as data sources in various business functions. Different data tables are interconnected. When processing data from a single data table, the interconnectedness between different data tables leads to a large number of read and write operations, resulting in intense resource competition and high load, which in turn leads to low data processing efficiency. Summary of the Invention
[0005] This application provides a list updating method, apparatus, device, storage medium, and program product, which can balance the load between databases and improve the processing efficiency and resource utilization of list updates in the database.
[0006] On one hand, embodiments of this application provide a list updating method, the method comprising:
[0007] Based on the business scenario and data volume, timeliness tags are configured for the lists in the first database, and different message consumption channels are configured for lists with different timeliness tags.
[0008] Obtain the change stream of the binary log of the second database, the change stream being used to associate multiple target lists in the first database;
[0009] Push the change stream of the binary log to the message queue;
[0010] Based on the timeliness tags corresponding to the target list, the change stream of the binary log in the message queue is routed to different message consumption channels for data processing;
[0011] The processed data is written into the corresponding target list in the first database.
[0012] On the other hand, embodiments of this application provide a list updating apparatus, the apparatus comprising:
[0013] The configuration unit is used to configure timeliness tags for lists in the first database according to business scenarios and data volume, and to configure different message consumption channels for lists with different timeliness tags.
[0014] The acquisition unit is used to acquire the change stream of the binary log of the second database, the change stream being used to associate with multiple target lists in the first database;
[0015] The push unit is used to push the change stream of the binary log to the message queue;
[0016] The processing unit is used to route the change stream of the binary log in the message queue to different message consumption channels for data processing according to the timeliness tag corresponding to the target list;
[0017] The writing unit is used to write the processed data into the corresponding target list in the first database.
[0018] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory, the memory storing a computer program, the processor executing the list update method as described in any of the above embodiments by calling the computer program stored in the memory.
[0019] On the other hand, embodiments of this application provide a non-volatile computer-readable storage medium storing a computer program adapted for loading by a processor to execute the list update method as described in any of the above embodiments.
[0020] On the other hand, an embodiment of this application provides a computer program product, including computer instructions that, when executed by a processor, implement the list update method as described in any of the above embodiments.
[0021] This embodiment of the application configures timeliness tags for lists in a first database based on business scenarios and data volume, and configures different message consumption channels for lists with different timeliness tags; it obtains change streams from binary logs in a second database, which are used to associate multiple target lists in the first database; it pushes the change streams from binary logs to a message queue; based on the timeliness tags corresponding to the target lists, it routes the change streams from binary logs in the message queue to different message consumption channels for data processing; and it writes the processed data into the corresponding target lists in the first database. This embodiment of the application, by configuring timeliness tags for lists in a first database based on business scenarios and data volume, and configuring different message consumption channels for lists with different timeliness tags, enables refined management and optimized processing of data. By obtaining the change streams from binary logs in the second database, pushing them to a message queue, and then routing the change streams to different message consumption channels for data processing based on timeliness tags, it effectively avoids competition for computing and bandwidth resources between different data volumes, balances the load between the first and second databases, and improves the processing efficiency and resource utilization of list updates in the databases. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 is a flowchart illustrating the list update method provided in an embodiment of this application.
[0024] Figure 2 is a schematic diagram of the first application scenario of the list update method provided in the embodiments of this application.
[0025] Figure 3 is a schematic diagram of a second application scenario of the list update method provided in the embodiments of this application.
[0026] Figure 4 is a schematic diagram of a third application scenario of the list update method provided in the embodiments of this application.
[0027] Figure 5 is a schematic diagram of the fourth application scenario of the list update method provided in the embodiments of this application.
[0028] Figure 6 is a schematic diagram of the list updating device provided in an embodiment of this application.
[0029] Figure 7 is a schematic diagram of the structure of the computer device provided in the embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] This application provides a list updating method, apparatus, device, storage medium, and program product. In some embodiments, the list updating method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, desktop computer, smart TV, smart speaker, wearable smart device, smart vehicle terminal, etc. The terminal can also include a client, which can be a financial client, browser client, or instant messaging client, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery network services, and big data and artificial intelligence platforms, but is not limited to these.
[0032] In business systems, data tables are indispensable as data sources in various business functions. Different data tables are interconnected. When processing data from a single data table, the interconnectedness between different data tables leads to a large number of read and write operations, resulting in intense resource competition and high load, which in turn leads to low data processing efficiency.
[0033] Taking a Customer Relationship Management (CRM) system as an example, the data list can include a customer list, a customer follow-up manager assignment list, and a customer order list. The customer list records all customers and their basic information, such as customer name and asset data. The customer follow-up manager assignment list records the business managers serving each customer, and the customer order list records the customer's order data. The CRM system can also set up a data list service to enable functions such as searching and aggregating data across all data tables, including customer queries, customer order history retrieval, and viewing the status of assigned customer manager follow-ups.
[0034] In some embodiments, the backend service can write the data list corresponding to the business function to a relational (MySQL) database. The data list service can use an Elasticsearch database, synchronizing the business data in MySQL to the Elasticsearch database by subscribing to the MySQL binary log (binlog) change stream. Considering the relatively slow write speed of the Elasticsearch database, the customer relationship management system can first write the binlog change stream to a distributed messaging (Kafka) queue, and then have the message consumer asynchronously process the data before writing it to the Elasticsearch database. However, because different data lists have different amounts of data and are interconnected (e.g., a customer name can be accessed simultaneously by the customer list, the customer follow-up person assignment list, and the customer order list, but the customer list only has a few thousand records while the customer order list has tens of millions of records), the different sizes of data lists compete for computing and bandwidth resources. For example, the MySQL backend service, due to the frequent need to respond to binlog reads and business writes, bears a high load, and the Elasticsearch database of the data list service, due to the high pressure of batch writes, cannot keep up with the indexing speed, further accumulating unprocessed data, ultimately slowing down the processing efficiency of the entire system, and may even trigger a service avalanche.
[0035] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0036] Please refer to Figures 1 to 5. Figure 1 is a flowchart illustrating the list update method provided in this application embodiment, and Figures 2 to 5 are application scenario illustrations provided in this application embodiment. The method includes the following operations:
[0037] Operation 110: Based on the business scenario and data volume, configure timeliness tags for the lists in the first database, and configure different message consumption channels for lists with different timeliness tags.
[0038] Among them, "business scenario" is used to indicate the business function type of the business data stored in the corresponding list. It can be understood that different business function types have different requirements for the timeliness of data updates. "Data volume" is used to indicate the amount of business data corresponding to the list in the first database. It can be understood that the time required and the resources required to update business data of different data volumes are different. The larger the data volume, the more time and resources are required.
[0039] The timeliness tag is used to indicate the processing timeliness required for the data to be written to the list. The message consumption channel refers to the channel used to process the data to be written to the list. In some embodiments, it may include at least one consumer group.
[0040] The first database contains lists of different data under different business scenarios. For any list in the first database, the business scenario and data volume of the list are obtained, and based on the business scenario and data volume of the list, the timeliness tag required by the data to be written to the list and the message consumption channel corresponding to the timeliness tag are determined.
[0041] In some embodiments, the higher the timeliness requirement of the business function type indicated by the business scenario, the higher its timeliness label level; conversely, the lower its timeliness label level, the lower its timeliness label level. The more business data indicated by the data volume, the lower its timeliness label level; conversely, the higher its timeliness label level.
[0042] For example, taking the aforementioned customer relationship management system as an example, in the data list service of the CRM (Customer Relationship Management) system, the lists in the first database (such as Elasticsearch) are first categorized by timeliness tags based on business scenarios and the urgency of data updates. For example, the first database could be a search engine (Elasticsearch) database.
[0043] For example, the business function types corresponding to customer lists and customer follow-up person assignment lists have high requirements for the timeliness of data updates and a small volume. That is, customer lists or customer follow-up person assignment lists that need to quickly reflect changes in business data are marked with a "high timeliness tag", which is usually represented by the tag "fast". On the other hand, the business function type corresponding to customer order lists has lower requirements for the timeliness of data updates and a large volume. That is, customer order lists that are updated less frequently or have low timeliness requirements are marked with a "low timeliness tag", which is usually represented by the tag "slow".
[0044] For different time-sensitivity tags, independent message consumption channels can be configured for lists with different time-sensitivity tags. Different message consumption channels are configured with different resources to process binary logs related to data changes to be written to different lists at different speeds. In some embodiments, this can be achieved by creating different consumer groups using Kafka message queues, with each consumer group specifically handling binary logs with a particular time-sensitivity tag.
[0045] For example, continuing with the above scenario, different Kafka consumer groups are configured as message consumption channels for lists with different timeliness requirements. Lists with high timeliness requirements (such as customer lists and allocation lists) will be processed by the fast message consumption channel, while lists with low timeliness requirements (such as transaction logs and order tables) will be processed by the slow message consumption channel. This configuration ensures that business data to be written to lists with different timeliness requirements can be efficiently processed through independent channels, avoiding the blocking of tasks writing to lists with low timeliness requirements from tasks writing to lists with high timeliness requirements.
[0046] In some embodiments, timeliness tags are configured for lists in the first database according to business scenarios and data volume, and different message consumption channels are configured for lists with different timeliness tags, including:
[0047] Based on the business scenario and data volume, configure timeliness tags for the lists in the first database, distinguishing them into high timeliness tags and low timeliness tags;
[0048] Configure different message consumption channels for lists with different timeliness tags, where high timeliness tags correspond to the first message consumption channel and low timeliness tags correspond to the second message consumption channel.
[0049] The timeliness tags include high timeliness tags and low timeliness tags; the high timeliness tag corresponds to the first message consumption channel configured with higher resource parameters and concurrency parameters, while the low timeliness tag corresponds to the second message consumption channel configured with lower resource parameters and concurrency parameters.
[0050] For example, the lists in the first database are differentiated by timeliness based on business scenarios and data volume. This is to ensure that data processing and services that match the timeliness requirements of lists with different business needs and data importance can be provided.
[0051] In some embodiments, the system configures a timeliness label for each list in the first database. This label is determined based on factors such as the update frequency, business sensitivity, and data volume of the business data in the list. In this embodiment, the timeliness label may include a high-timeliness label and a low-timeliness label. A high-timeliness label is suitable for lists that require rapid reflection of data changes and have high business sensitivity, such as customer lists and customer follow-up assignment lists. Business data changes in these lists typically originate from real-time business operations, requiring updates to the system as quickly as possible. A low-timeliness label is suitable for lists that experience less frequent data changes and have lower business sensitivity, such as transaction log lists and customer order lists. Data changes in these lists may originate from periodic pulls from the data warehouse, and the timeliness requirement is relatively low.
[0052] For example, to ensure that lists with different timeliness requirements are processed promptly and effectively, the system configures different message consumption channels for lists with different timeliness tags. For lists configured with a high timeliness tag, the system associates them with the first message consumption channel, which typically has higher priority and faster processing speed, to ensure that data changes to high-timeliness lists can be quickly captured, processed, and written to the second database.
[0053] For lists configured with the low timeliness tag, the system associates them with the second message consumption channel, which may have a relatively low priority and processing speed because data changes to low timeliness lists are not as time-sensitive.
[0054] With this configuration, the system can provide differentiated data processing services based on the timeliness requirements of different lists. This not only improves the efficiency and accuracy of data processing but also ensures the timeliness and consistency of data in business operations, thereby meeting different business needs and data volume requirements.
[0055] As shown in Figure 2, the backend service can write its corresponding business data to its corresponding relational (MySQL) database. In the data list service, a canal instance is configured for each MySQL database. The search engine (Elasticsearch) database can listen for data changes in MySQL through the canal instance to obtain the binary log (binlog) of the changed data. In some embodiments, when the backend service can receive data change operations and write the changed data to its corresponding relational (MySQL) database, the Elasticsearch database can obtain a binary log (binlog) based on the change event through the canal instance. A binary log change event is associated with multiple lists in the Elasticsearch database in the data list service, and each list corresponds to an index in the Elasticsearch database (i.e., the first database). After obtaining the binary log, the data list service writes it to a distributed message queue, and then the message consumer asynchronously processes the data and writes it to the corresponding index table in the Elasticsearch database.
[0056] Referring to Figure 3, taking customer information as an example, a customer name may be used simultaneously by the customer list, the customer follow-up assignment list, and the customer order list, each list corresponding to an index table in the Elasticsearch database (i.e., the first database). Specifically, in the customer order list, a customer may have 100,000 to 1 million order records, while in the customer list, a customer is only involved in one customer record. Therefore, when processing binary logs related to customer names, different message consumption channels can be routed to different index tables (i.e., multiple target lists in the first database). The logs are then processed by message consumers in different message consumption channels and stored in the corresponding index tables.
[0057] Different lists have different latency requirements. For example, customer lists and customer follow-up assignment lists have stricter requirements for the timeliness of responding to change events, needing to record the corresponding data changes to the list as quickly as possible for subsequent data query services. In contrast, customer order lists have less stringent requirements for the timeliness of responding to change events and lower latency requirements. Furthermore, customer order lists often involve changes to multiple data items, consuming more resources.
[0058] Different data volumes and business scenarios require different data paths for processing lists. Therefore, when configuring Elasticsearch index tables (i.e., the various lists in the first database), different timeliness tags can be used for labeling. For example, "high timeliness" is labeled "fast," and "low timeliness" is labeled "slow." The configured timeliness tags are read into memory when the list is loaded. During subsequent binary log data processing and list writing, the timeliness tags can be used to quickly determine the required business timeliness of the target list to be processed.
[0059] Furthermore, the processing of lists with different time-sensitive tags should not use the same data path. As shown in Figure 3, the change flow of a binlog for a customer name is associated with both the customer list and the customer order list. Typically, the customer list is associated with one document, while the transaction order list is associated with 1 million documents. If the same data path is used, even with coroutine concurrency, updating 1 million documents will inevitably consume a certain number of coroutines, potentially causing the documents associated with the customer list to not be updated in a timely manner. This will also block the change flow of subsequent binlogs that have not yet had time to process other data, leading to a sharp increase in service load and database pressure, and affecting the latency of subsequent changes.
[0060] Therefore, as shown in Figure 4, in order to independently process the list of different timeliness tags, the embodiments of this application configure different consumer channels for different timeliness tags, such as: the first message consumption channel corresponding to the "high timeliness tag", which includes the high timeliness consumer group (consumer group fast), and the second message consumption channel corresponding to the "low timeliness tag", which includes the low timeliness consumer group (consumer group slow). Continuing with the example above, different timeliness tags can be configured for the customer list and the transaction order list. A "high timeliness tag" can be configured for the customer list, and a "low timeliness tag" for the transaction order list. After obtaining a change stream of a binary log entry for a customer name, on the one hand, based on the timeliness tag of the customer list, the binary log can be routed to the first message consumption channel (i.e., the high timeliness consumer group) corresponding to the "high timeliness tag." The binlog is then processed by the first message consumption channel to match the data in the customer list before being written to the customer list. On the other hand, based on the timeliness tag of the customer order list, the binary log can be routed to the second message consumption channel (i.e., the low timeliness consumer group) corresponding to the "low timeliness tag." The binary log is then processed to match the data in the customer order list before being written to the customer order list.
[0061] Understandably, high-timeliness consumer groups and low-timeliness consumer groups do not incur additional storage costs. Different consumer groups consume the same message queue. For example, after binary logs are written to the message queue, the high-timeliness consumer group corresponding to the first message consumption channel will consume all binary logs in that message queue, while the low-timeliness consumer group corresponding to the second message consumption channel will consume all binary logs in that message queue. For different consumer groups, each consumer group (such as the high-timeliness consumer group and the low-timeliness consumer group) independently consumes all binary logs in the message queue. For different consumers within the same consumer group, a binary log in the message queue is consumed by only one consumer, ensuring data consistency without additional storage or migration costs.
[0062] Setting up different message consumption channels for different time-sensitivity tags is a low-cost modification. Taking the above example of setting up a first and second message consumption channel, the second channel handles the change stream of binary logs to be written to lists with the time-sensitivity tag "slow," while the first channel handles the change stream of binary logs to be written to lists with the time-sensitivity tag "fast." Only the time-sensitivity tag is differentiated; the rest of the operations, such as reading the table, managing the coroutine pool, and writing to Elasticsearch (ES), remain consistent with the original operations, resulting in minimal code intrusion. Differentiating business processes through different message consumption channels (i.e., different consumer groups) also enables hardware isolation and strong scalability. Since lists with different time-sensitivity tags are already processed by different message consumption channels, when the table column level grows again, additional containers or machine instances can be used to handle the distributed (Kafka) message processing of large tables. Processors and memory can be configured independently, providing strong scalability and enabling the handling of regional expansion and growth of the business.
[0063] In some embodiments, timeliness tags are configured for lists in the first database based on business scenarios and data volume, distinguishing them into high-timeliness tags and low-timeliness tags, including:
[0064] For each list in the first database, if the business scenario of the list is real-time feedback, or the number of documents in the list corresponding to a single change event is less than a preset threshold, then the list will be marked with a high timeliness tag; or
[0065] If the business scenario of the list is non-real-time feedback, or if the number of documents in the list corresponding to a single change event exceeds a preset threshold, the list will be marked with a low timeliness tag.
[0066] For example, if the business scenario of the list is real-time feedback, that is, data changes need to be quickly reflected in the business system, and the timeliness of data updates is highly required, such as customer queries, allocation status viewing, etc., these scenarios have extremely high requirements for data timeliness, so the list is marked with a high timeliness tag.
[0067] For example, if the number of documents in the list corresponding to a single change event is less than a preset threshold (such as 10), it means that the data change frequency of the list is relatively low, but each change may have a significant impact on the business. Therefore, it is also necessary to mark it as a high-timeliness tag to ensure timely data updates.
[0068] For example, if the business scenario of the list is non-real-time feedback, that is, data changes do not need to be reflected in the business system immediately, and the timeliness requirement for data updates is low, such as periodic data retrieval from the data warehouse and historical data analysis, these scenarios have low requirements for data timeliness, so the list is marked with a low timeliness label.
[0069] For example, if the number of documents in the list corresponding to a single change event exceeds a preset threshold (such as 10), it means that the data in the list changes frequently, but each change may have a relatively small impact on the business. Therefore, it can be marked as low timeliness to reduce the pressure on the system to process data.
[0070] In some embodiments, different message consumption channels are configured for lists with different timeliness tags, including:
[0071] Configure the first message consumption channel for the list of high-time-sensitivity tags;
[0072] Configure a second message consumption channel for the list of low-timeliness tags;
[0073] The first message consumption channel and the second message consumption channel reuse the same message queue topic and partition, but are isolated by the message consumption channel identifier.
[0074] For example, the system configures different message consumption channels for lists with different timeliness tags to ensure that data can be processed according to its timeliness requirements. In some embodiments, the configuration method is as follows:
[0075] The list of high-time-sensitivity tags is configured with the primary message consumption channel. This channel has higher priority and faster processing speed to ensure that data changes to the high-time-sensitivity list can be quickly captured, processed, and written to the secondary database.
[0076] Configure a second message consumption channel for the list of low-timeliness tags. This channel may have a relatively lower priority and processing speed because data changes to the low-timeliness list are less time-sensitive.
[0077] It is worth noting that, in order to reduce system complexity and storage costs, the first and second message consumption channels reuse the same message queue topic and partition. However, the system isolates these two channels through message consumption channel identifiers, ensuring that they can process their respective message streams independently without interfering with each other.
[0078] In some embodiments, the timeliness labels of different lists can be adaptively adjusted in real time based on the changed fields corresponding to the currently occurring change event, flexibly handling updated data and improving data processing efficiency. In some embodiments, configuring timeliness labels for lists in the first database according to business scenarios and data volume may include: in response to a change event, obtaining the changed fields of the change event; determining a first processing priority factor for the list based on the business scenario of the list in the first database; simultaneously, obtaining the field data volume of different fields in the list, and determining a second processing priority factor for the list based on the field data volume of the changed field and the field data volume of other fields besides the changed field; and determining the timeliness label of the list based on the first processing priority factor and the second processing priority factor.
[0079] The first processing priority factor is used to indicate the timeliness requirement of the business functions storing the business data in the corresponding list for data updates. For example, the larger the first processing priority factor, the higher the timeliness requirement of the business functions storing the business data in the corresponding list for data updates. In some embodiments, different processing priority factors can be preset for different business scenarios. After obtaining the business scenarios of the list, the corresponding first processing priority factor is obtained based on the mapping relationship between different business scenarios and different processing priority factors.
[0080] For example, there may be four business scenarios. The processing priority factor is 0.25 in business scenario A, 0.5 in business scenario B, 0.75 in business scenario C, and 1 in business scenario D.
[0081] The second processing priority factor indicates the magnitude of the impact of the data volume of the business data in the corresponding list on the timeliness of data updates. For example, the smaller the second processing priority factor, the greater the impact of the data volume of the business data in the corresponding list on the timeliness of data updates. The field data volume refers to the number of values that can be taken in a given field. In some embodiments, after obtaining the number of values for different fields in the list, the second processing priority factor of the list can be determined using the following formula:
[0082] Where Q2 represents the second processing priority factor, num binlog Indicates the data level of the changed field, field iThis represents the data size of the i-th field (excluding the changed field), and n represents the number of fields in the list. It can be understood that, for the changed field, the maximum ratio of its data size to that of other fields is 1, meaning that a value of the changed field can be found in one record corresponding to any other field in the list. A ratio less than 1 means that a value of the changed field can be found in multiple records corresponding to any other field. The smaller the ratio, the more records corresponding to any changed field can be found in the list. In this case, the data size of the business data that needs to be updated in the corresponding list for that change event is larger, requiring more time and resources, and having a greater impact on the timeliness of data updates.
[0083] In some embodiments, timeliness labels corresponding to different processing priority factors can be preset; for example, a target processing priority factor greater than 0.5 can be determined as a high timeliness label, and a target processing priority factor less than or equal to 0.5 can be determined as a low timeliness label.
[0084] After determining the first and second processing priority factors, a weighted average can be calculated to obtain the target timeliness label for the list. Then, the corresponding timeliness label can be determined based on the target processing priority factor. The weights of the first and second processing priority factors can be set according to empirical values.
[0085] In some embodiments, the method further includes:
[0086] Different concurrency parameters are configured for different message consumption channels. These concurrency parameters include at least one of the following: coroutine pool size, query concurrency of the second database, and write concurrency of the first database.
[0087] To further optimize the data processing flow and ensure the system's stability and performance under high concurrency, the method also includes configuring different concurrency parameters for different message consumption channels. These concurrency parameters cover at least one of the following: coroutine pool size, query concurrency of the second database (such as MySQL), and write concurrency of the first database (such as Elasticsearch).
[0088] As shown in Figure 5, the process from binlog change stream to the processed Es document involves multiple complex steps. Due to the large data volume, these steps are typically handled concurrently using a coroutine pool. However, while increasing concurrency can reduce latency and improve processing speed, it requires more coroutines. For example, a single transaction order list Es document may require querying multiple MySQL tables to retrieve the original data before processing. Therefore, higher concurrency puts greater query pressure on the MySQL cluster. Simultaneously, the Es cluster has a write limit; excessive write concurrency increases read latency, further exacerbating the fuzzy search query latency of the list. Therefore, to balance latency and database cluster read / write pressure, appropriate concurrency parameters need to be configured for different message consumption channels (i.e., lists with different timeliness tags).
[0089] Regarding the configuration of the coroutine pool size: For lists with high timeliness tags, since data changes need to be processed quickly, a larger coroutine pool size can be configured to ensure sufficient concurrent processing capacity to respond quickly to data changes. For lists with low timeliness tags, since data changes are less time-sensitive, the coroutine pool size can be appropriately reduced to decrease system resource consumption and concurrency pressure.
[0090] Regarding the configuration of query concurrency for the second database (such as MySQL): Considering the query pressure on the MySQL cluster, for lists with high timeliness tags, the query concurrency can be moderately controlled to avoid excessive concurrency leading to a performance degradation of the MySQL cluster. For lists with low timeliness tags, since their latency requirements are lower, the query concurrency can be further reduced to alleviate the burden on the MySQL cluster.
[0091] Regarding the configuration of write concurrency for the primary database (such as Elasticsearch): Elasticsearch clusters have a write limit. Excessive write concurrency can lead to increased read latency, impacting the performance of fuzzy search queries on the list. Therefore, for lists with high time-sensitivity tags, write concurrency needs to be configured appropriately to ensure fast writes without unduly affecting Elasticsearch cluster performance. For lists with low time-sensitivity tags, since their write pressure is relatively low, write concurrency can be appropriately reduced to optimize overall system performance.
[0092] For example, you can configure concurrency parameters by differentiating time-sensitive tags according to their association ratio.
[0093] For example, if the number of documents in a single Es index table corresponding to a binlog change event exceeds a preset threshold (e.g., 10), the list is marked as low timeliness and its concurrency parameter is reduced accordingly.
[0094] For example, for low-timeliness lists tagged as "slow," the concurrency configuration strategy should prioritize system stability rather than excessively pursuing low latency. In some embodiments, the number of binlog goroutines in a low-timeliness consumer group processing low-timeliness lists is reduced to 5 or fewer compared to a high-timeliness consumer group processing high-timeliness lists. This is to reduce the consumption of system resources during concurrent processing and avoid system instability caused by excessive concurrency. Within the low-timeliness consumer group, the number of concurrent processing at the list level is set to 2 or less. This setting helps to further reduce system load and ensure stable system operation during low-timeliness list processing. For each document in the low-timeliness consumer group, the concurrency of its processing queries and writes is also limited to 5 or fewer. This measure aims to reduce the pressure on the database and storage system and prevent performance degradation or system crashes caused by excessive concurrency.
[0095] At the same time, parameters need to be optimized according to the hardware configuration of different clusters. By detecting and analyzing system performance data, the values of concurrency parameters are continuously adjusted to find an optimal balance between list update speed and cluster load saturation.
[0096] In some embodiments, different concurrency parameters are configured for different message consumption channels, including:
[0097] The size of the coroutine pool corresponding to the first message consumption channel is larger than the size of the coroutine pool corresponding to the second message consumption channel.
[0098] The query concurrency of the second database corresponding to the first message consumption channel is greater than the query concurrency of the second database corresponding to the second message consumption channel.
[0099] The write concurrency of the first database corresponding to the first message consumption channel is greater than the write concurrency of the first database corresponding to the second message consumption channel.
[0100] For example, regarding the size of the coroutine pool, the coroutine pool size corresponding to the first message consumption channel is configured to be larger than that corresponding to the second message consumption channel. This is because the first message consumption channel processes lists with high timeliness tags, whose data changes require rapid response and processing. Therefore, more coroutines are needed to execute tasks concurrently to reduce latency and improve processing speed. Conversely, the second message consumption channel processes lists with low timeliness tags, whose data changes are less time-sensitive. Therefore, the system resource consumption and concurrency pressure can be reduced by decreasing the coroutine pool size.
[0101] For example, regarding the query concurrency of the second database, the query concurrency of the second database corresponding to the first message consumption channel is also set to be higher than that of the second message consumption channel. This is because data processing for high-time-sensitivity lists often requires querying multiple MySQL tables to obtain the raw data and performing complex calculations and processing. To improve processing efficiency, it is necessary to increase the query concurrency to obtain the required data in parallel. For low-time-sensitivity lists, since their data changes less frequently and the time requirements are lower, the query concurrency can be reduced to alleviate the burden on the MySQL cluster and avoid performance degradation caused by excessive concurrency.
[0102] For the write concurrency of the first database, the write concurrency of the first message consumption channel is also configured to be higher than that of the second message consumption channel. This is because data changes to high-time-sensitivity lists need to be quickly reflected in storage systems such as Elasticsearch for subsequent queries and analysis. Therefore, it is necessary to increase the write concurrency to quickly write the processed data to the first database. For low-time-sensitivity lists, since their data changes have lower time requirements, the performance of the Elasticsearch cluster can be optimized by reducing the write concurrency, avoiding excessive write operations that could lead to increased read latency or system crashes.
[0103] By configuring different concurrency parameters for different message consumption channels, it is possible to more effectively balance latency, database cluster read / write pressure, and system performance, ensuring the efficient and stable operation of the data processing flow and meeting the requirements of different business needs and data volumes.
[0104] In some embodiments, the method further includes: dynamically adjusting the concurrency parameters of the first message consumption channel and the second message consumption channel according to preset monitoring indicators, wherein the preset monitoring indicators include at least one of the following:
[0105] Container resource utilization;
[0106] The query response time and number of active connections for the second database;
[0107] Write throughput of the first database;
[0108] The update speed of each list in the first database;
[0109] The backlog of messages with different time-sensitive tags in the message queue.
[0110] In some embodiments, the concurrency parameters of the first message consumption channel and the second message consumption channel are dynamically adjusted according to preset monitoring indicators, including:
[0111] When the container resource utilization rate exceeds the first preset utilization rate threshold (e.g., 80%), the utilization rate of the first message consumption channel is reduced by a first percentage (e.g., 10%) of the current coroutine pool size until the container resource utilization rate drops below the second preset utilization rate threshold (e.g., 75%); and / or the utilization rate of the second message consumption channel is reduced by a second percentage (e.g., 15%) of the current coroutine pool size until the container resource utilization rate drops below the second preset utilization rate threshold (e.g., 75%); the first preset utilization rate threshold is greater than the second preset utilization rate threshold, and the first percentage is less than the second percentage;
[0112] When the container memory usage exceeds the third preset usage threshold (e.g., 85%), the coroutines processing low-priority messages (e.g., non-real-time feedback, logs) in the first message consumption channel are forcibly terminated; for the second message consumption channel, the memory swapping and compression mechanism is enabled, and the memory reservation ratio of batch processing tasks is reduced; the third preset usage threshold is greater than the first preset usage threshold.
[0113] In some embodiments, the concurrency parameters of the first message consumption channel and the second message consumption channel are dynamically adjusted according to preset monitoring indicators, including:
[0114] When the query response time of the second database exceeds the preset response time threshold (e.g., 500ms), for the first message consumption channel, the query concurrency of the second database corresponding to the first message consumption channel is reduced to the third percentage of the current query concurrency (e.g., 50%); and / or for the second message consumption channel, the query result caching mechanism is enabled and the cache expiration time is extended.
[0115] When the number of active connections to the second database exceeds the fourth percent (e.g., 80%) of the maximum number of connections to the second database, for the first message consumption channel, connections that have been idle for more than a first preset time (e.g., 30 seconds) are forcibly released from the connection pool; and / or for the second message consumption channel, connection reuse technology is used to split a single query into multiple stages for execution.
[0116] In some embodiments, the concurrency parameters of the first message consumption channel and the second message consumption channel are dynamically adjusted according to preset monitoring indicators, including:
[0117] When the write throughput of the first database is lower than the fifth percent (e.g., 70%) of the target throughput for N consecutive (e.g., 3) monitoring periods, an asynchronous write merging mechanism is enabled for the first message consumption channel to merge small batches of writes into large batches greater than or equal to 1MB; and / or for the second message consumption channel, the write concurrency of the first database corresponding to the second message consumption channel is reduced to the sixth percent (e.g., 30%) of the current write concurrency, and a write buffer queue is enabled.
[0118] In some embodiments, the concurrency parameters of the first message consumption channel and the second message consumption channel are dynamically adjusted according to preset monitoring indicators, including:
[0119] When the update speed of the list is lower than the preset update speed threshold (e.g., 2 seconds), for the first message consumption channel, the real-time update of the list is paused and switched to asynchronous compensation mode; and / or for the second message consumption channel, the index pre-computation service is enabled to generate index fragments for high-frequency queries in advance.
[0120] In some embodiments, the concurrency parameters of the first message consumption channel and the second message consumption channel are dynamically adjusted according to preset monitoring indicators, including:
[0121] When the backlog of messages with high timeliness tags exceeds 7% (e.g., 20%) of the partition capacity, the first message consumption channel will be expanded to 1.5 times its current size, and multi-threaded parallel consumption will be enabled; alarm information will be automatically triggered, and if the situation is not resolved within a second preset time (e.g., 10 minutes), the backup message consumption channel will be started.
[0122] When the backlog of messages with low timeliness tags exceeds the eighth percent (e.g., 50%) of the partition capacity, a message compression and dumping mechanism is enabled for the second message consumption channel to migrate historical messages to cold storage; the message retention policy is dynamically adjusted to force cleanup of messages that have exceeded the preset number of days (e.g., 7 days); the eighth percent is greater than the seventh percent.
[0123] In some embodiments, the method further includes: when multiple monitoring indicators simultaneously trigger the adjustment strategy of concurrent parameters, executing them according to the following priority:
[0124] First priority: Container resource criticality alert > Database connection pool exhaustion > Message queue high backlog;
[0125] Second priority: Database query timeout > Index write delay > Batch write failure;
[0126] The adjustment process should be implemented smoothly, with each parameter change spaced at least 30 seconds apart, to avoid system oscillation.
[0127] Operation 120 retrieves the change stream of the binary log of the second database, which is used to correlate multiple target lists in the first database.
[0128] In some embodiments, the second database is a relational database, and obtaining the change stream of the binary log of the second database includes: obtaining the change stream of the binary log of the relational database through a change data capture subscription module.
[0129] For example, the Change Data Capture (CDC) tool can be used to subscribe to the binary log change stream of a relational (MySQL) database (i.e., the second database). The CDC tool can capture database change events in real time, including insert, update, and delete operations. The captured binlog change events are then converted into a structured binlog change stream for subsequent processing. Then, by parsing the binlog change events, the target lists in the first database that they are associated with are determined. For example, a change to a customer record might be associated with the customer list, account list, and transaction order list. Subsequently, based on the parsing results, the change events are distributed to the processing flows of the corresponding target lists.
[0130] As shown in Figure 4, the CDC tool can be implemented using a Canal instance. Canal is an open-source framework for incremental log parsing based on a MySQL database, providing incremental data subscription and consumption. It primarily synchronizes real-time data from a MySQL database to other data storage or systems. In this implementation, the Canal instance is an instance running the Canal service, responsible for connecting to the MySQL database, capturing and parsing the incremental logs (such as binlog change streams) of the MySQL database, and then sending these change streams as messages to a specified message queue (such as Kafka).
[0131] The binary log (binlog) is a log format used by MySQL to record data changes. It records every data modification operation that occurs in the database in detail. When data in the database changes, such as inserting, updating, or deleting records, MySQL writes these changes to the binlog file in binary form. Therefore, the binlog change stream is actually a real-time stream of these database modification operations.
[0132] For example, a binlog change stream typically includes event type, changed data, change time, table information, and other metadata.
[0133] For example, event types are used to indicate the type of change that occurred, such as INSERT, UPDATE, DELETE, etc. Event types are used to identify and process different data changes.
[0134] For example, changes to data from insert and update operations will include the specific changes, i.e., the content of the newly inserted or updated record. Changes to data from delete operations can include the unique identifier (such as a primary key) of the deleted record.
[0135] For example, change timestamps are used to record the timestamps of data changes, which helps determine the order and timing of changes during data synchronization or recovery.
[0136] For example, table information is used to indicate which table the change occurred on, including the table name, database name, etc., which is necessary for locating and processing data changes.
[0137] For example, other metadata includes additional metadata such as transaction IDs (identification), user information, etc., which are used for data recovery or auditing in certain scenarios.
[0138] Operation 130 pushes the change stream of the binary log to the message queue.
[0139] For example, after capturing and parsing the binary log change stream of a MySQL database, the change messages in the change stream are pushed to a message queue (such as a Kafka queue) through the Canal instance in the list service shown in Figure 4. The message queue, acting as an intermediate buffer layer, can store and forward a large number of change messages, ensuring the reliability and efficiency of data processing.
[0140] Operation 140 routes the change stream of the binary log in the message queue to different message consumption channels for data processing based on the timeliness tags corresponding to the target list.
[0141] As shown in Figure 4, in a message queue (such as a Kafka queue), the change messages of a change stream are routed to the corresponding message consumption channels based on the timeliness tags (fast or slow) of the target list in the change messages. Then, the binary logs of the change stream are processed by the consumer groups (high-timeliness consumer groups or low-timeliness consumer groups) within the message consumption channels. This is achieved through Kafka's routing mechanism, ensuring that data with different timeliness requirements is correctly distributed to their respective message consumption channels for processing.
[0142] Within the message consumption channel, any consumer in the consumer group within the channel can process the received change messages. This can include operations such as querying other related tables in the MySQL database, calculating combined data, and converting data formats to generate data that conforms to the requirements of the Elasticsearch list.
[0143] Operation 150 writes the processed data into the corresponding target list in the first database.
[0144] For example, after data processing, the generated data is written to the corresponding Elasticsearch list via Elasticsearch client or Application Programming Interface (API). This allows Elasticsearch to perform queries and aggregations based on the latest data, meeting business needs.
[0145] When writing data, factors such as the write limit and read latency of the Elasticsearch cluster also need to be considered. By adjusting concurrency parameters and hardware configurations, optimization measures can be taken to ensure the efficiency and stability of data writing while avoiding excessive pressure on the Elasticsearch cluster.
[0146] In some embodiments, before writing the processed data into the corresponding target list in the first database, the method further includes:
[0147] The processed data is validated and deduplicated.
[0148] Based on the results of verification and deduplication, the processed data that meets the requirements is formatted to conform to the storage format of the corresponding target list in the first database.
[0149] For example, pre-defined validation rules or algorithms can be used to check each item in the processed data. This includes checking for missing data fields, correct data types, and data values within a reasonable range. If the data does not conform to the validation rules, appropriate error handling or data correction will be performed.
[0150] For example, duplicate records can be identified and removed by comparing key fields of data records (such as unique identifiers, business primary keys, etc.). Common deduplication methods include hash deduplication, sorting deduplication, and set-based deduplication.
[0151] For example, the processed data can be converted and formatted according to the storage format requirements of the target list. This includes converting data field names to their corresponding field names in the target list, converting data types to those supported by the target list, and formatting the data according to the format required by the target list.
[0152] Through the above verification, deduplication, and formatting operations, it can be ensured that the processed data has undergone strict quality control and format conversion before being written into the corresponding target list in the first database. This guarantees the quality and consistency of the data, helps improve the reliability, accuracy, and usability of the data, and provides strong support for subsequent data querying, analysis, and application.
[0153] This application embodiment can tag different lists with timeliness labels based on their business latency sensitivity for differentiated processing. In CRM systems, different data lists have different latency requirements. For example, changes to customer lists and allocation lists typically originate from business operations on the browser side, thus requiring stronger timeliness and needing to be reflected in the lists as quickly as possible. Changes to transaction lists and order tables, on the other hand, may originate from data warehouse retrieval, with relatively lower timeliness requirements. To meet these differentiated needs, this embodiment configures different timeliness tags, such as "fast" and "slow," for different lists, enabling differentiated treatment during subsequent data processing. This ensures that data in high-timeliness lists is updated quickly, while data in low-timeliness lists can be updated while maintaining stability.
[0154] This embodiment of the application can handle the traffic of lists with different timeliness tags by establishing new consumer groups, without additional storage costs and with low code modification costs. In traditional data synchronization schemes, a single consumer group is usually used to handle all data changes. This causes list data of different magnitudes and latency requirements to compete for resources in the same channel, affecting system performance and stability. To solve this problem, this embodiment establishes multiple consumer groups, such as a "high timeliness consumer group" and a "low timeliness consumer group," to handle list traffic with high timeliness tags and low timeliness tags, respectively. The advantage of this is that list data with different timeliness tags can be processed in their respective consumer groups, avoiding resource contention and improving the system's concurrent processing capabilities. At the same time, since these consumer groups consume the same queues and partitions, there are no additional storage costs, and the code modification costs are relatively low.
[0155] This application proposes optimization of concurrency parameters for different time-sensitivity tags, taking into account the impact of various factors such as containers, MySQL clusters, Es clusters, and list update speed. During data processing, the setting of concurrency parameters has a crucial impact on system performance. Excessive concurrency increases the pressure on the database and storage system, while insufficient concurrency increases data update latency. To balance these two needs, this application proposes fine-tuning of concurrency parameters based on different time-sensitivity tags and specific business scenarios. For example, for lists with high time-sensitivity tags, concurrency parameters can be appropriately increased to improve data update speed; while for lists with low time-sensitivity tags, concurrency parameters can be appropriately decreased to reduce the pressure on the database and storage system. In this way, the stability and sustainability of the system are ensured while maintaining data update speed.
[0156] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0157] This embodiment of the application configures timeliness tags for lists in a first database based on business scenarios and data volume, and configures different message consumption channels for lists with different timeliness tags; it obtains change streams from binary logs in a second database, which are used to associate multiple target lists in the first database; it pushes the change streams from binary logs to a message queue; based on the timeliness tags corresponding to the target lists, it routes the change streams from binary logs in the message queue to different message consumption channels for data processing; and it writes the processed data into the corresponding target lists in the first database. This embodiment of the application, by configuring timeliness tags for lists in a first database based on business scenarios and data volume, and configuring different message consumption channels for lists with different timeliness tags, enables refined management and optimized processing of data. By obtaining the change streams from binary logs in the second database, pushing them to a message queue, and then routing the change streams to different message consumption channels for data processing based on timeliness tags, it effectively avoids competition for computing and bandwidth resources between different data volumes, balances the load between the first and second databases, and improves the processing efficiency and resource utilization of list updates in the databases.
[0158] To facilitate better implementation of the list updating method of this application embodiment, this application embodiment also provides a list updating device. Please refer to FIG6, which is a schematic diagram of the structure of the list updating device provided in this application embodiment. The list updating device 200 may include:
[0159] Configuration unit 210 is used to configure timeliness tags for lists in the first database according to business scenarios and data volume, and to configure different message consumption channels for lists with different timeliness tags.
[0160] The acquisition unit 220 is used to acquire the change stream of the binary log of the second database, and the change stream is used to associate multiple target lists in the first database;
[0161] Push unit 230 is used to push the change stream of binary logs to the message queue;
[0162] Processing unit 240 is used to route the change stream of binary logs in the message queue to different message consumption channels for data processing based on the timeliness tags corresponding to the target list;
[0163] The writing unit 250 is used to write the processed data into the corresponding target list in the first database.
[0164] In some embodiments, the configuration unit 210 is configured to: configure timeliness tags for lists in the first database according to business scenarios and data volume, distinguishing them into high timeliness tags and low timeliness tags; configure different message consumption channels for lists with different timeliness tags, wherein high timeliness tags correspond to the first message consumption channel and low timeliness tags correspond to the second message consumption channel.
[0165] In some embodiments, the configuration unit 210 is configured to configure timeliness tags for lists in the first database according to business scenarios and data volume. When distinguishing between high timeliness tags and low timeliness tags, the configuration unit 210 is configured to: for each list in the first database, if the business scenario of the list is real-time feedback, or the number of documents in the list corresponding to a single change event is less than a preset threshold, then the list is marked with a high timeliness tag; or if the business scenario of the list is non-real-time feedback, or the number of documents in the list corresponding to a single change event exceeds a preset threshold, then the list is marked with a low timeliness tag.
[0166] In some embodiments, the configuration unit 210 is configured to configure different message consumption channels for lists with different timeliness tags, including: configuring a first message consumption channel for lists with high timeliness tags; configuring a second message consumption channel for lists with low timeliness tags; wherein the first message consumption channel and the second message consumption channel reuse the same message queue topic and partition, but the first message consumption channel and the second message consumption channel are isolated by a message consumption channel identifier.
[0167] In some embodiments, the configuration unit 210 is further configured to configure different concurrency parameters for different message consumption channels. The concurrency parameters include at least one of the following: coroutine pool size, query concurrency of the second database, and write concurrency of the first database.
[0168] In some embodiments, the configuration unit 210 is configured to configure different concurrency parameters for different message consumption channels, including: the size of the coroutine pool corresponding to the first message consumption channel is greater than the size of the coroutine pool corresponding to the second message consumption channel; the query concurrency of the second database corresponding to the first message consumption channel is greater than the query concurrency of the second database corresponding to the second message consumption channel; and the write concurrency of the first database corresponding to the first message consumption channel is greater than the write concurrency of the first database corresponding to the second message consumption channel.
[0169] In some embodiments, the configuration unit 210 is further configured to dynamically adjust the concurrency parameters of the first message consumption channel and the second message consumption channel according to preset monitoring indicators. The preset monitoring indicators include at least one of the following: container resource utilization rate; query response time and number of active connections of the second database; write throughput of the first database; update speed of each list in the first database; and message backlog of different timeliness tags in the message queue.
[0170] In some embodiments, before writing the processed data to the corresponding target list in the first database, the writing unit 250 further includes: performing verification and deduplication on the processed data; and formatting the processed data that meets the requirements according to the result of the verification and deduplication to conform to the storage format of the corresponding target list in the first database.
[0171] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0172] It should be understood that the list updating device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. In some embodiments, the list updating device can execute the above-described list updating method embodiments, and the foregoing and other operations and / or functions of each unit in the list updating device respectively implement the corresponding processes of the above-described method embodiments. For the sake of brevity, they will not be repeated here.
[0173] Optionally, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the operations described in the above method embodiments.
[0174] Figure 7 is a schematic diagram of the structure of a computer device provided in an embodiment of this application. This computer device can be a terminal or a server. As shown in Figure 7, the computer device 300 may include: a communication interface 301, a memory 302, a processor 303, and a communication bus 304. The communication interface 301, memory 302, and processor 303 communicate with each other via the communication bus 304. The communication interface 301 is used for data communication between the computer device 300 and external devices. The memory 302 can be used to store software programs and modules, and the processor 303 runs the software programs and modules stored in the memory 302, such as the software programs for corresponding operations in the aforementioned method embodiments.
[0175] Optionally, the processor 303 can invoke software programs and modules stored in the memory 302 to perform the following operations: configure timeliness tags for lists in the first database according to the business scenario and data volume, and configure different message consumption channels for lists with different timeliness tags; obtain the change stream of binary logs in the second database, which is used to associate multiple target lists in the first database; push the change stream of binary logs to the message queue; route the change stream of binary logs in the message queue to different message consumption channels for data processing according to the timeliness tags corresponding to the target lists; and write the processed data into the corresponding target lists in the first database.
[0176] Those skilled in the art will understand that all or part of the operations in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a non-volatile computer-readable storage medium and loaded and executed by a processor.
[0177] Therefore, embodiments of this application provide a non-volatile computer-readable storage medium storing multiple computer programs that can be loaded by a processor to perform operations in any of the list update methods provided in this application. Specific implementations of the above operations can be found in the preceding embodiments and will not be repeated here.
[0178] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0179] Since the computer program stored in the storage medium can perform the operations in any of the list update methods provided in the embodiments of this application, the beneficial effects that any of the list update methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0180] This application also provides a non-volatile computer program product, which includes computer instructions stored in a non-volatile computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in any of the list update methods described in this application. For simplicity, further details are omitted here.
[0181] This application also provides a computer program comprising computer instructions stored in a non-volatile computer-readable storage medium. A processor of a computer device reads the computer instructions from the non-volatile computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding process in any of the list update methods described in this application. For simplicity, further details are omitted here.
[0182] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A list updating method, wherein, The method comprises: According to the business scenario and the data magnitude, the list in the first database is configured with a timeliness label, and different message consumption channels are configured for lists with different timeliness labels; Obtain the change stream of the binary log of the second database, and the change stream is used to associate a plurality of target lists in the first database; Push the change stream of the binary log to the message queue; According to the timeliness label corresponding to the target list, the change stream of the binary log in the message queue is routed to different message consumption channels for data processing; The processed data is written into the corresponding target list in the first database.
2. The list updating method of claim 1, wherein, According to the business scenario and the data magnitude, the list in the first database is configured with a timeliness label, and different message consumption channels are configured for lists with different timeliness labels, comprising: According to the business scenario and the data magnitude, the list in the first database is configured with a timeliness label, and is divided into high timeliness label and low timeliness label; Different message consumption channels are configured for lists with different timeliness labels, wherein the high timeliness label corresponds to a first message consumption channel, and the low timeliness label corresponds to a second message consumption channel.
3. The list updating method of claim 2, wherein, According to the business scenario and the data magnitude, the list in the first database is configured with a timeliness label, and is divided into high timeliness label and low timeliness label, comprising: For each list in the first database, if the business scenario of the list is real-time feedback, or the number of documents corresponding to a single change event in the list is less than a preset threshold, the list is marked as the high timeliness label; or If the business scenario of the list is non-real-time feedback, or the number of documents corresponding to a single change event in the list exceeds the preset threshold, the list is marked as the low timeliness label.
4. The list updating method of claim 2, wherein, Different message consumption channels are configured for lists with different timeliness labels, comprising: The first message consumption channel is configured for the list with the high timeliness label; The second message consumption channel is configured for the list with the low timeliness label; The first message consumption channel and the second message consumption channel share the same topic and partition of the message queue, but are isolated by the message consumption channel identifier.
5. The list updating method of claim 2, wherein, The method further comprises: Different concurrency parameters are configured for different message consumption channels, including at least one of the coroutine pool size, the query concurrency degree of the second database, and the write concurrency degree of the first database.
6. The list updating method of claim 5, wherein, The different concurrency parameters are configured for different message consumption channels, comprising: The coroutine pool size corresponding to the first message consumption channel is greater than the coroutine pool size corresponding to the second message consumption channel; The query concurrency degree of the second database corresponding to the first message consumption channel is greater than the query concurrency degree of the second database corresponding to the second message consumption channel; The write concurrency degree of the first database corresponding to the first message consumption channel is greater than the write concurrency degree of the first database corresponding to the second message consumption channel.
7. The list updating method of claim 6, wherein, The method further comprises: According to a preset monitoring index, the concurrency parameters of the first message consumption channel and the second message consumption channel are dynamically adjusted, and the preset monitoring index includes at least one of the following: Container resource usage rate; Query response time and active connection number of the second database; Write throughput of the first database; Update speed of each list in the first database; Message backlog of messages with different time effectiveness labels in the message queue.
8. The list updating method of claim 1, wherein, Before the processed data is written into the corresponding target list in the first database, the method further includes: Verifying and deduplicating the processed data; According to the verification and deduplication result, the processed data meeting the requirements is formatted to meet the storage format of the corresponding target list in the first database.
9. A list updating apparatus, wherein, The apparatus includes: A configuration unit configured to configure time effectiveness labels for lists in the first database according to business scenarios and data magnitudes, and configure different message consumption channels for lists with different time effectiveness labels; An acquisition unit configured to acquire a change stream of a binary log of a second database, the change stream being used to associate a plurality of target lists in the first database; A pushing unit configured to push the change stream of the binary log to a message queue; A processing unit configured to route the change stream of the binary log in the message queue to different message consumption channels for data processing according to time effectiveness labels corresponding to the target lists; A writing unit configured to write the processed data into corresponding target lists in the first database.
10. The list updating apparatus of Claim 9, wherein The configuration unit is configured to configure time effectiveness labels for lists in the first database according to business scenarios and data magnitudes, including distinguishing high-time-effectiveness labels and low-time-effectiveness labels.
11. The list updating apparatus of Claim 10, wherein The configuration unit is configured to configure time effectiveness labels for lists in the first database according to business scenarios and data magnitudes, including: For each list in the first database, if the business scenario of the list is real-time feedback, or the number of documents in the list corresponding to a single change event is less than a preset threshold, the list is marked as the high-time-effectiveness label; or if the business scenario of the list is non-real-time feedback, or the number of documents in the list corresponding to a single change event exceeds the preset threshold, the list is marked as the low-time-effectiveness label.
12. The list updating apparatus of Claim 9, wherein The configuration unit is configured to configure different concurrency parameters for different message consumption channels, and the concurrency parameters include at least one of the following: coroutine pool size, query concurrency degree of the second database, and write concurrency degree of the first database; and the message consumption channels include a first message consumption channel and a second message consumption channel.
13. The list updating apparatus of Claim 12, wherein The configuration unit is configured to configure different concurrency parameters for different message consumption channels, including: the size of the coroutine pool corresponding to the first message consumption channel is greater than the size of the coroutine pool corresponding to the second message consumption channel; the query concurrency of the second database corresponding to the first message consumption channel is greater than the query concurrency of the second database corresponding to the second message consumption channel; the write concurrency of the first database corresponding to the first message consumption channel is greater than the write concurrency of the first database corresponding to the second message consumption channel.
14. The list updating apparatus of Claim 12, wherein The first message consumption channel and the second message consumption channel share the same topic and partition of the message queue.
15. The list updating apparatus of Claim 12, wherein, The first message consumption channel and the second message consumption channel are isolated by message consumption channel identification.
16. The list updating apparatus of Claim 12, wherein The configuration unit is configured to dynamically adjust the concurrency parameters of the first message consumption channel and the second message consumption channel according to preset monitoring indicators, and the preset monitoring indicators include at least one of the following: container resource usage; query response time and active connection number of the second database; write throughput of the first database; update speed of each list in the first database; and message backlog of messages with different timeliness labels in the message queue. The write unit is configured to, before writing the processed data into the corresponding target list in the first database, perform the following operations: checking and deduplicating the processed data; and performing format processing on the processed data meeting the requirements according to the checking and deduplicating result, so as to conform to the storage format of the corresponding target list in the first database.
17. The list updating apparatus of Claim 9, wherein The computer device includes a processor and a memory, and the memory stores a computer program. The processor is configured to execute the list update method according to any one of claims 1-8 by calling the computer program stored in the memory.
18. A computer device, wherein, The non-volatile computer readable storage medium stores a computer program, and the computer program is adapted to be loaded by a processor to execute the list update method according to any one of claims 1-8.
19. A non-transitory computer readable storage medium, wherein, The computer instructions are executed by the processor to implement the list update method according to any one of claims 1-8.
20. A computer program product comprising computer instructions, wherein,
