WO2021208228A1 - Data processing method and apparatus, and computer device and storage medium - Google Patents

Data processing method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2021208228A1
WO2021208228A1 PCT/CN2020/096997 CN2020096997W WO2021208228A1 WO 2021208228 A1 WO2021208228 A1 WO 2021208228A1 CN 2020096997 W CN2020096997 W CN 2020096997W WO 2021208228 A1 WO2021208228 A1 WO 2021208228A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
data
commodity
service data
target
Prior art date
Application number
PCT/CN2020/096997
Other languages
French (fr)
Chinese (zh)
Inventor
邰华运
吕勇
万鹏程
Original Assignee
苏宁易购集团股份有限公司
苏宁云计算有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏宁易购集团股份有限公司, 苏宁云计算有限公司 filed Critical 苏宁易购集团股份有限公司
Priority to CA3177218A priority Critical patent/CA3177218A1/en
Publication of WO2021208228A1 publication Critical patent/WO2021208228A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/14Fourier, Walsh or analogous domain transformations, e.g. Laplace, Hilbert, Karhunen-Loeve, transforms
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R29/00Arrangements for measuring or indicating electric quantities not covered by groups G01R19/00 - G01R27/00
    • G01R29/26Measuring noise figure; Measuring signal-to-noise ratio
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/02Preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/08Feature extraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2218/00Aspects of pattern recognition specially adapted for signal processing
    • G06F2218/12Classification; Matching

Definitions

  • This application relates to the technical field of commodity service data processing, in particular to a data processing method, device, computer equipment and storage medium of commodity service data.
  • the main value of the Internet commodity service management platform is to provide commodity information data services, including data distribution and reception, storage, cache preheating, data services, downstream system service push notifications and other basic data services.
  • the platform stores the service data in multi-dimensional database and table according to business scenarios. Therefore, it is easy to cause the platform to monitor the data processing of the commodity service data is not precise enough. In particular, there is a lack of monitoring of the data processing process of synchronizing the service data in the database to the cache service data.
  • the traditional monitoring method is to manually detect that there is a data inconsistency between the service data of the database and the cached service data in the production environment, manually input the corresponding input parameters, and synchronize the service data in the database to the corresponding input parameters according to the corresponding input parameters. Cache service data.
  • the manual monitoring and manual operation methods result in low timeliness of data processing of commodity service data.
  • a data processing method for commodity service data comprising:
  • the data obtains the second commodity service data of the target commodity service from the cached service data; when the first commodity service data is not the same as the second commodity service data, update the warm-up table of the target commodity service according to the first service input data
  • the second service input parameter data, the warm-up table is used to store the corresponding service input parameter data when the service data of the database is synchronized to the cache service data, and the second service input parameter data is the service corresponding to the second commodity service data in the warm-up table Input parameter data; according to the updated second service input parameter data in the warm-up table, the service data of the database corresponding to the target commodity service is synchronized to the cache service data.
  • first service input parameter data there are multiple first service input parameter data, and obtaining the first commodity service data of the target commodity service from the service data of the database according to the first service input parameter data includes:
  • Obtaining the second commodity service data of the target commodity service from the cached service data according to the first service input parameter includes:
  • update the second service entry data in the warm-up table of the target product service according to the first service entry data including:
  • synchronizing the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table includes;
  • the method further includes:
  • the fourth service entry data in the warm-up table the fourth service entry is the service entry corresponding to the fourth commodity service data in the warm-up table; according to the updated fourth service entry database in the warm-up table
  • the service data is synchronized to the cache service data.
  • obtaining incremental data of the target commodity service includes:
  • a sliding time window is created according to the update time of the commodity service data of the target commodity service; the incremental data is obtained from the commodity data of the stored target commodity service through the sliding time window.
  • the method further includes:
  • the method further includes:
  • the first product service data When the first product service data is different from the second product service data, generate a data log according to the first service input data; write the data log to the search service platform; call the data query interface through the front-end display page to pass the data query interface Query the data log in the search service platform, and display the data log in the search service platform on the front-end display page.
  • a data processing device for commodity service data comprising:
  • the first obtaining module is used to obtain the first service input parameter data of the target commodity service from the full data of the target commodity service; the second obtaining module is used to obtain the target commodity from the service data of the database according to the first service input data The first commodity service data of the service; the third obtaining module is used to obtain the second commodity service data of the target commodity service from the cached service data according to the first service input parameter data; the update module is used to compare the first commodity service data with When the second commodity service data is not the same, update the second service input parameter data in the warm-up table of the target commodity service according to the first service input parameter data.
  • the warm-up table is used to store and synchronize the service data of the database to the cached service data.
  • the corresponding service input parameter data, the second service input parameter data is the service input parameter data corresponding to the second commodity service data in the warm-up table; the synchronization module is used to change the second service input parameter data according to the updated second service input data in the warm-up table
  • the service data of the database corresponding to the target commodity service is synchronized to the cache service data.
  • a computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor.
  • the processor implements the steps of the method in any of the foregoing embodiments when the processor executes the computer program.
  • the above-mentioned data processing method, device, computer equipment and storage medium of the commodity service data obtain the first service entry data of the target commodity service from the full data of the target commodity service, and respectively obtain the service data from the database according to the first service entry data Obtain the first commodity service data and obtain the second commodity service data of the target commodity service from the cached service data.
  • the second service entry data in the warm-up table of the target commodity service is updated according to the first service entry data.
  • the service data of the database is synchronized to the cache service data according to the updated second service entry in the warm-up table.
  • the data processing method of the commodity service data does not need to manually update the cached service data, and automatically corresponds to the target commodity service in the commodity service data and the cached service data in the database through the update of the service input parameter data in the warm-up table
  • the comparison of commodity service data is monitored, and the service data in the database is automatically synchronized to the cache service data through the updated service input data in the warm-up table, and the cache update of the commodity service data corresponding to the target commodity service is completed, reducing
  • the cost of artificial maintenance of commodity service data is reduced, the number of manual interventions is reduced, and the timeliness of data processing of commodity service data is improved.
  • Figure 1 is an application environment diagram of a data processing method for commodity service data in an embodiment
  • FIG. 2 is a schematic flowchart of a data processing method for commodity service data in an embodiment
  • FIG. 3 is a schematic flowchart of a data processing method for commodity service data in another embodiment
  • FIG. 4 is a schematic diagram of a partial flow of a data processing method for commodity service data in another embodiment
  • FIG. 5 is a schematic flowchart of a part of a data processing method for commodity service data in another embodiment
  • FIG. 6 is a schematic diagram of a partial flow of a data processing method for commodity service data in another embodiment
  • Figure 7 is a structural block diagram of a data processing device for commodity service data in an embodiment
  • Fig. 8 is an internal structure diagram of a computer device in an embodiment.
  • the data processing method of commodity service data provided in this application can be applied to the application environment as shown in FIG. 1.
  • the database 10 stores a variety of commodity service data, and each commodity service data may be separately stored in the database 10 in the form of a commodity service data storage table.
  • the cache device 30 stores commodity service data used for cache processing in the database 10. Generally, it is necessary to filter out part of the commodity service data from the commodity service data of the database 10, and synchronously cache it in the storage and cache device 30, and perform pre-heat treatment on the commodity service data, so as to improve the reading speed of this part of commodity service data.
  • the server 50 obtains the first service entry data of the target product service from the full data of the target product service in the database 10, and obtains the first product service data of the target product service and the first product service data from the database 10 according to the first service entry data. Obtain the second commodity service data of the target commodity service from the cached service data. When it is determined that the first product service data is different from the second product service data, the second service entry data in the warm-up table of the target product service in the database 10 is updated according to the first service entry data.
  • the warm-up table of the target commodity service in the database 10 is used to store the corresponding service input parameters when the service data of the database 10 is synchronized to the cached service data in the cache device 30, and the second service-input parameter data is the first in the warm-up table. 2.
  • the server 50 synchronizes the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table.
  • the server 50 may be implemented by an independent server or a server cluster composed of multiple servers.
  • a data processing method for commodity service data is provided. Taking the method applied to the server in FIG. 1 as an example for description, the method includes the following steps:
  • S100 Obtain the first service entry data of the target commodity service from the full amount of data of the target commodity service.
  • the server filters out the corresponding first service entry data from the full data of the target commodity service.
  • the full data of the target commodity service includes the commodity service data of the target commodity service and the service entry data used to read the commodity service data.
  • the full amount of data of the target commodity service may be the full amount of data stored in the database.
  • the full amount of data can include offline data of the platform.
  • the first service entry data of the target commodity service may be one or more.
  • the task computing capability of the big data platform is used to extract the offline full amount of data of the target commodity service to the temporary table of the big data platform, and the full amount of commodity service data of each dimension of the target commodity service is calculated to obtain the first service entry data.
  • S300 Acquire the first commodity service data of the target commodity service from the service data of the database according to the first service entry data.
  • the commodity service management platform When the commodity service management platform receives the commodity service data, it stores the commodity service data in the database.
  • the server receives the service acquisition request containing the service input parameter data, it retrieves the corresponding commodity service data from the database according to the service input parameter data.
  • the server obtains the first commodity service data of the target commodity service from the service data of the database.
  • the server stores the service entry data of the target commodity service and the correspondence relationship of the commodity service data, and the correspondence relationship between the two is stored in the server in the form of a commodity service information storage table.
  • the server can obtain the corresponding first commodity service data according to the first service input parameter data.
  • S500 Acquire second commodity service data of the target commodity service from the cached service data according to the first service input parameter data.
  • the commodity service management platform pre-heats part of the commodity service data in the database according to business requirements, and stores the part of the service data as cache service data in the cache device.
  • the server reads the second commodity service data of the target commodity service from the cached service data according to the first service input parameter data.
  • the second commodity service data is commodity service data obtained by synchronizing the first commodity service data from the database to the caching device for caching.
  • the commodity service data of the database will be updated according to the received new commodity service data, and there is a difference between the updated second commodity service data and the first commodity service data.
  • the server sets a corresponding warm-up table according to the characteristics of the target commodity service.
  • the warm-up table stores the corresponding service input data when synchronizing the service data of the database to the corresponding service input data when the service data is cached. That is, the server performs a warm-up operation on the commodity service data of the target commodity service according to the service entry data in the warm-up table.
  • the server detects that the first commodity service data is different from the second commodity service data, it updates the second service entry data in the warm-up table of the target commodity service according to the first service entry data.
  • a message format unsorted comparison algorithm is used to calculate the first commodity service data and the second commodity service data.
  • S900 Synchronize the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table.
  • the server when the server performs data warm-up on the commodity service data of the target commodity service, it reads the updated second service input parameter data from the warm-up table.
  • the corresponding commodity service data is read from the service data of the database through the second service input data, and the corresponding commodity service data is synchronized to the cache service data. Therefore, it is possible to automatically detect the update of the product service data in the database corresponding to the target product service without manual monitoring, and synchronize the product service data in the database to the cache service data when the data is updated.
  • S900 includes: reading the updated second service input parameter data in the warm-up table according to a preset period, and synchronizing the service data of the database to the cache service data according to the read second service input parameter data.
  • the above-mentioned data processing method of commodity service data obtains the first service input parameter data of the target commodity service from the full data of the target commodity service, and obtains the first commodity service data from the service data in the database according to the first service input parameter data, and Obtain the second commodity service data of the target commodity service from the cached service data.
  • the second service entry data in the warm-up table of the target commodity service is updated according to the first service entry data.
  • the service data of the database is synchronized to the cache service data according to the updated second service entry in the warm-up table.
  • the data processing method of the commodity service data does not need to manually update the cached service data, and automatically corresponds to the target commodity service in the commodity service data and the cached service data in the database through the update of the service input parameter data in the warm-up table
  • the comparison of commodity service data is monitored, and the service data in the database is automatically synchronized to the cache service data through the updated service input data in the warm-up table, and the cache update of the commodity service data corresponding to the target commodity service is completed, reducing
  • the cost of artificial maintenance of commodity service data is reduced, the number of manual interventions is reduced, and the timeliness of data processing of commodity service data is improved.
  • S300 includes steps:
  • S301 Acquire multiple first commodity service data from the service data of the database according to the respective first service input data.
  • S500 includes steps:
  • S501 Acquire multiple second commodity service data of the target commodity service from the cached service data according to each first service input parameter.
  • S700 includes steps:
  • the server obtains multiple first service input parameter data of the target commodity service from the full data of the target commodity service, and obtains multiple first service input parameter data from the service data of the database according to each first service input parameter data.
  • the commodity service data and a plurality of second commodity service data of the target commodity service obtained from the cached service data. Further, each corresponding first commodity service data and second commodity service data are respectively compared. When any comparison result shows that the first product service data and the second product service data are different, the first service entry data corresponding to the result is used to update the corresponding second service entry data in the warm-up table. At this time, there are also multiple input parameter data for the second service.
  • the service data of the database is synchronized to the cache service data according to all the updated second service entries in the warm-up table. Therefore, it is possible to automatically monitor the update status of all product service data corresponding to the target product service, and automatically synchronize the service data of the database to the cache service data according to the update result.
  • the temporary table of the big data platform is designed, and the full amount of basic data of the database is extracted to the temporary table through database middleware, such as Mycat middleware.
  • database middleware such as Mycat middleware.
  • the table structure of different temporary tables is designed according to the dimensions of different goods and services and their associated data, which is different from the difference between the data types of temporary tables and database tables, and the specific field types in the temporary tables can be mapped.
  • the target commodity service is a commodity basic information service
  • the first service entry data is a commodity code.
  • the commodity code is extracted from the commodity basic information table of the commodity basic information service.
  • the merchant code is used as the key field for service query and cache query.
  • the temporary table creation statement is designed as follows:
  • the above can create a temporary table, through the big data platform, extract the required field data in the basic information table of the Mycat data source product, and then on the big data platform, through the data exploration tool, you can query the data integrity in the hive_product_base_info table to verify The correctness of the service data extraction process.
  • product basic information service create a new SparkWarmProductBaseInfoHivejava class, write a main function, create SparkConf, JavaSparkContext, and HiveContext in turn to implement configuration read and load initialization, HiveContext instance sqlContext, support Spark SQL query, extract Hive table hive_product_base_info, generate Dataset ⁇ Row>
  • the data source is transformed into a javaRDD object, the table data is traversed, each row of data is obtained in the loop body, the basic information service data of the goods in the cache and the database are respectively queried, and the message format unsorted comparison algorithm is used to compare whether the service data in the cache and the database are Completely consistent, write inconsistent service data into the newly created comparison result Hive table.
  • Pack the SparkWarmProductBaseInfoHive class to generate a jar file, upload it to the big data platform, get the Hive table of the comparison result after running, and then write the service input parameter data into the database warm-up table in the form of data exchange, monitor all service data in the process, and generate Logs are written into the real-time data stream.
  • the method further includes the following steps:
  • S1400 Obtain third commodity service data of the target commodity service from the service data of the database according to the third service input parameter data, and obtain fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter.
  • S1800 Synchronize the service data of the database to the cache service data according to the updated fourth service entry in the warm-up table.
  • the subsequent server after the server executes the above S100 to S900 according to the full data of the target commodity service, the subsequent server only needs to monitor the incremental data of the target commodity service when monitoring the commodity service data of the target commodity service. . Specifically, obtain the third service entry data from the incremental data, obtain the third product service data of the target product service from the service data of the database according to the third service entry data, and obtain the target product service data from the cached service data The fourth commodity service data.
  • the third commodity service data may be commodity service data in incremental data.
  • the fourth service entry data in the warm-up table of the target product service is updated according to the third service entry data.
  • the service data of the database is synchronized to the cache service data according to the updated fourth service entry in the warm-up table. Therefore, it is possible to monitor the update of the commodity service data in the incremental data of the subsequent target commodity service in the platform, and automatically update the corresponding cache service data.
  • S1000 includes: creating a sliding time window according to the update time of the commodity service data of the target commodity service, and obtaining incremental data from the commodity data of the stored target commodity service through the sliding time window.
  • the incremental data of the commodity service data of the target commodity service is obtained through a sliding time window.
  • a sliding time window is created, and the sliding time window can be dynamically configured.
  • the value range of the sliding time window is determined according to the update time of the commodity service data table of the target commodity service.
  • the value range of the sliding time window is expressed as: start time ⁇ N*window time, end time ⁇ N*window time.
  • the specific way to obtain incremental data from the commodity service storage table storing the commodity service data of the target commodity service through the sliding time window is: obtain the commodity service data of the target commodity service from the commodity service storage table corresponding to the target commodity and service in the database.
  • Table update time, the update time is within the range of [start time ⁇ N*window time, end time ⁇ N*window time) to obtain the commodity data of the target commodity service, and the obtained commodity data is the incremental data.
  • the warm-up logic is: store the inconsistent service entry data into the warm-up table of the target commodity service, and the service entry parameters in the warm-up table
  • the data triggers real-time calculations through timed tasks.
  • the commodity service data corresponding to the service input parameter data in the database is taken in real time to update the currently cached commodity service data.
  • the update time in the warm-up table is added as the version number of the cached data . In order to obtain the inconsistency of the product and service data through the comparison result of the version number when the data is compared next time, reduce the execution time of the comparison algorithm, and improve the comparison efficiency.
  • the commodity service data of the target commodity service is obtained through a sliding time window, and the consistency of the commodity service data in the cache and the database is compared.
  • inconsistent the service input data is extracted and written back to re-warm, in order to realize the commodity service data Operation and maintenance monitoring.
  • commodity service data is updated due to delays, physical machine downtime, database master-slave unsynchronization, etc., inconsistencies are caused, through this technical means, the process is monitored, the commodity service data is operated and maintained, and the commodity service data accurate service is provided. .
  • the secondary warm-up task abstract class implements data source definition, current service definition, service data query by time slice, cache key generation, cache query, database table General methods such as service data query, message format unsorted comparison algorithm, process status monitoring method, etc.
  • create a new rewarmer package create a new base package under it, and create a new AbstractRewarmer abstract class, which completes the automatic assembly instantiation of the Mycat data source, and defines the following abstract methods:
  • getService used to obtain the service to which the secondary warm-up belongs
  • queryChangeData used to query the change data in the specific service table
  • generalCacheKey used to call the cache CacheKey template generator to generate the cache key
  • compareData an algorithm used to compare packet formats without ordering consistency
  • insert2Warmer used to write parameter data into the warm-up table in batches
  • getInitParams used to obtain the initial parameter list, including the time range startTime, endTime;
  • historyCacheKeyGenerator used to generate historical information record cache key
  • runHistoryTimeCacheKeyGenerator used to generate historical run time range cache key
  • stateCacheKeyGenerator used to generate the state cache key for the second preheating job of the service
  • totalCacheKeyGenerator used to generate the cache key for the total preheated data volume of the service's secondary warm-up job history every day;
  • getRunningState used to get the running status of the job
  • the target commodity service is commodity basic information service: Create a new RewarmerProductBaseInfo under the revarmer package to implement the abstract methods in the abstract class and the basic definition of the realization class.
  • the implemented business logic queries the commodity service data within the agreed time range (such as the last 5 minutes) of the current job operation from the commodity basic information table, and queries the commodity service data from the cache for comparison according to the CacheKey. If the product and service data is inconsistent, the service data is written into the warm-up table, and the current service status of the cache is updated at the same time. The execution time range of the next stage Job will move forward for 5 minutes.
  • an abstract class of preheating tasks is developed to realize general methods such as reading of preheating tables, updating and writing of cache, querying of database service data, and business logic calculation methods of commodity service data.
  • the AbstractWarmer abstract class is inherited under the warmer package according to different services to realize the preheating function of each specific service.
  • the timed task is configured with the above steps to complete the preheating function of the service data.
  • the method further includes:
  • S105 Call the data query interface through the front-end display page to query the product service data in the search service platform through the data query interface, and display the product service data in the search service platform on the front-end display page.
  • S107 Call the abnormal data statistics interface through the front-end display page to query the abnormal commodity service data counted in the search service platform through the abnormal data statistics interface, and display the commodity abnormal service data counted in the search service platform on the front-end display page.
  • the server writes the cached service data as the commodity basic data of the target commodity service into the search service platform.
  • the server increases the monitoring of the receipt and storage of the basic commodity data of the target commodity service, and the basic commodity data received is generated into a log and written into the real-time data stream. Further, it is verified whether the real-time data stream is written into the search service platform by middleware consumption, and the normal writing ends verification.
  • a data query interface and an abnormal data statistics interface are developed based on the search service platform for the front-end display page to call. Display the commodity service data in the search service platform and display the commodity abnormal service data counted in the search service platform through the front-end display page.
  • monitoring is added to the receipt and storage of commodity basic data of the target commodity service, and the received data is generated into a log and written into the real-time data stream.
  • a system configuration switch can be added to the receive data method class execute of the abstract class AbstractMessageReceiveService for XML message reception processing, and the specific switch name can be set to log.switch.
  • the switch is a disaster recovery method to control abnormal conditions. Disaster recovery methods such as abnormalities or sharp increases in data volume. Use the switch to realize the analysis of the received message and the conversion of the object format, and then encapsulate it into the message format data for real-time data stream transmission specified by the protocol.
  • MonitorLogDto Set the transmission object name to MonitorLogDto, including fields: serial number, service type, service code, processing time, number of message items, creation time, abnormal information, message content, etc.
  • the data transmission method is not limited to bytes The form of flow.
  • the data stream GroupId is defined as groupid_system_monitor_log.
  • the QueryBuilders provided by the es client jar package are used, including wildcardQuery fuzzy query, termQuery precise query, boolQuery combined query, fliter filter query, etc., and AggregationBuilders, including sum sum, avg average, count count, dateHistogram aggregation query Wait. From the monitoring perspective, multi-dimensional data query and statistics functions are realized.
  • the front-end monitoring page verifies whether the controller interface designed in Spring rest style can normally call the data, and multiple interfaces are designed to complete the data needs of the front-end page. The details are as follows (the following interface Both support Http request in Get mode):
  • queryData according to the input service code and time range, query the monitoring data of es by time range aggregation
  • queryGroupData according to the input service code and time range, query the monitoring data of es grouped by time range;
  • queryTodayData according to the entered service code, query all the service data of the monitoring and statistics of the day;
  • queryExceptionData according to the input service code, time range, paging condition (large amount of data, support paging query), message keyword, query the monitored service exception data.
  • the method further includes the following steps:
  • S905 Call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
  • the data log refers to the data log used for statistical analysis, and the dimensions are also specific to the dimensions of each commodity and service.
  • the data is normally written into the database.
  • the data is recorded in the form of logs, written into the real-time data stream, and the search service platform is the result data Provide retrieval and statistical analysis, so that the front-end monitoring page can display the monitoring results more friendly. Therefore, the monitoring of the commodity service data of the target commodity service is more refined, which is beneficial to improve the timeliness of the data processing of the commodity service data of the target commodity service.
  • a data processing device for commodity service data which includes a first acquisition module 11, a second acquisition module 13, a third acquisition module 15, an update module 17, and a synchronization module 19. .
  • the first obtaining module 11 is configured to obtain the first service entry data of the target commodity service from the full amount of data of the target commodity service.
  • the second obtaining module 13 is configured to obtain the first commodity service data of the target commodity service from the service data of the database according to the first service input data.
  • the third obtaining module 15 is configured to obtain the second commodity service data of the target commodity service from the cached service data according to the first service input parameter data.
  • the update module 17 is used to update the second service input parameter data in the warm-up table of the target merchandise service according to the first service input parameter data when the first commodity service data is different from the second commodity service data.
  • the second service input parameter data is the service input parameter data corresponding to the second commodity service data in the warm-up table.
  • the synchronization module 19 is configured to synchronize the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service input data in the preheating table.
  • the second acquiring module 13 may include (not shown in FIG. 7):
  • the second obtaining unit is configured to obtain a plurality of first commodity service data from the service data of the database according to the respective first service input data.
  • the third acquisition module 15 includes:
  • the third obtaining unit is configured to obtain multiple second commodity service data of the target commodity service from the cached service data according to the respective first service input parameters.
  • Update module 17 including:
  • the updating unit is configured to update the target commodity service according to any one of the first service input parameters when the first commodity service data corresponding to any one of the first service input parameters is different from the second commodity service data The corresponding second service input parameter data in the warm-up table of.
  • the synchronization module 19 includes (not shown in Fig. 7):
  • the reading unit is configured to read the updated second service input parameter data in the warm-up table according to a preset period.
  • the update unit is used to synchronize the service data of the database to the cache service data according to the read second service input parameter data.
  • a data processing device for commodity service data may include (not shown in Fig. 7):
  • the fourth acquiring module is used to acquire incremental data of the target commodity service.
  • the fifth acquiring module is used to acquire the third service entry data of the target commodity service from the incremental data.
  • the sixth obtaining module is used to obtain the third commodity service data of the target commodity service from the service data of the database according to the third service input parameter data, and obtain the fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter Commodity service data.
  • the replacement module is used to update the fourth service entry data in the warm-up table of the target product service according to the third service entry data when the third product service data is different from the fourth product service data. Enter the service parameter corresponding to the fourth commodity service data in the warm-up table.
  • the preheating module is used for synchronizing the service data of the database to the cached service data according to the updated fourth service entry in the preheating table.
  • the fourth acquiring module may include (not shown in FIG. 7):
  • the creation unit is used to create a sliding time window according to the update time of the commodity service data of the target commodity service;
  • the fourth acquiring unit is configured to acquire incremental data from the product data of the stored target product service through a sliding time window.
  • a data processing device for commodity service data may include (not shown in Fig. 7):
  • the cache module is used to write cache service data into the search service platform.
  • the development module is used to develop the data query interface and abnormal data statistics interface of the search service platform.
  • the first display module is configured to call the data query interface through the front-end display page to query the product service data in the search service platform through the data query interface, and display the product service data in the search service platform on the front-end display page.
  • the second display module is used to call the abnormal data statistics interface through the front-end display page to query the abnormal commodity service data counted in the search service platform through the abnormal data statistics interface, and display the abnormality counted in the search service platform on the front-end display page Commodity service data.
  • a data processing device for commodity service data may include (not shown in Fig. 7):
  • the generating module is used to generate a data log according to the first service input data when the first commodity service data is different from the second commodity service data.
  • the writing module is used to write the data log to the search service platform.
  • the third display module is used to call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
  • Each module in the above-mentioned data processing device for commodity service data can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 8.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store relevant data of the target commodity service, such as service entry data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize a data processing method of commodity service data.
  • FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • a computer device including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer program:
  • the data obtains the second commodity service data of the target commodity service from the cached service data; when the first commodity service data is not the same as the second commodity service data, update the warm-up table of the target commodity service according to the first service input data
  • the second service input parameter data, the warm-up table is used to store the corresponding service input parameter data when the service data of the database is synchronized to the cache service data, and the second service input parameter data is the service corresponding to the second commodity service data in the warm-up table Input parameter data; according to the updated second service input parameter data in the warm-up table, the service data of the database corresponding to the target commodity service is synchronized to the cache service data.
  • first service input parameter data there are multiple first service input parameter data
  • the processor executes the computer program to implement the above-mentioned step of obtaining the first product service data of the target product service from the service data of the database according to the first service input parameter data
  • the following steps are specifically implemented: obtaining multiple first commodity service data from the service data in the database according to each first service input parameter data; the processor executes the computer program to realize the above-mentioned obtaining target from the cache service data according to the first service input parameter
  • the second commodity service data step of commodity service the following steps are specifically implemented: obtain multiple second commodity service data of the target commodity service from the cached service data according to each first service input parameter; the processor executes the computer program to realize the above
  • the first commodity service data is different from the second commodity service data
  • the second service entry data step in the warm-up table of the target commodity service is updated according to the first service entry data
  • the following steps are specifically implemented: When the first product service data corresponding to any one of the first service input parameters in the first service input parameter is different
  • the processor executes the computer program to realize the step of synchronizing the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table
  • the following steps are specifically implemented : Read the updated second service input parameter data in the warm-up table according to the preset period; synchronize the service data of the database to the cache service data according to the read second service input parameter data.
  • the processor executes the computer program to implement the following steps: obtain incremental data of the target commodity service; obtain the third service entry data of the target commodity service from the incremental data; obtain the third service entry data from the database according to the third service entry data Obtain the third commodity service data of the target commodity service from the service data, and obtain the fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter; when the third commodity service data and the fourth commodity service data When they are not the same, update the fourth service entry data in the warm-up table of the target product service according to the third service entry data, and the fourth service entry is the service entry corresponding to the fourth product service data in the warm-up table; The updated fourth service entry in the warm-up table synchronizes the service data of the database to the cache service data.
  • the processor when the processor executes the computer program to implement the above step of obtaining the incremental data of the target commodity service, it specifically implements the following steps: creating a sliding time window according to the update time of the commodity service data of the target commodity service; using the sliding time window Obtain incremental data from the product data of the storage target product service.
  • the processor executes the computer program to implement the following steps: write cache service data into the search service platform; develop the data query interface and abnormal data statistics interface of the search service platform; call the data query interface through the front-end display page to pass The data query interface queries the product service data in the search service platform, and displays the product service data in the search service platform on the front-end display page; calls the abnormal data statistics interface through the front-end display page to query the statistics in the search service platform through the abnormal data statistics interface
  • the abnormal commodity and service data that is generated, and the abnormal commodity and service data counted in the search service platform are displayed on the front-end display page.
  • the processor executes the computer program to implement the following steps: when the first commodity service data is different from the second commodity service data, generate a data log according to the first service input data; write the data log into the search Service platform: call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the data processing method for commodity service data described in any of the above embodiments is implemented.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the data obtains the second commodity service data of the target commodity service from the cached service data; when the first commodity service data is not the same as the second commodity service data, update the warm-up table of the target commodity service according to the first service input data
  • the second service input parameter data, the warm-up table is used to store the corresponding service input parameter data when the service data of the database is synchronized to the cache service data, and the second service input parameter data is the service corresponding to the second commodity service data in the warm-up table Input parameter data; according to the updated second service input parameter data in the warm-up table, the service data of the database corresponding to the target commodity service is synchronized to the cache service data.
  • the computer program is executed by the processor to realize the above-mentioned step of obtaining the first product service data of the target product service from the service data of the database according to the first service input parameter data.
  • the computer program is executed by the processor to realize the above-mentioned cached service data according to the first service input parameter
  • the following steps are specifically implemented: obtaining multiple second commodity service data of the target commodity service from the cached service data according to each first service input parameter; the computer program is executed by the processor
  • the above-mentioned step of updating the second service entry data in the warm-up table of the target product service according to the first service entry data when the first product service data is different from the second product service data is implemented, the following steps are specifically implemented: When the first product service data corresponding to any one of the first service
  • the computer program when executed by the processor to realize the step of synchronizing the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service input parameter data in the warm-up table, the following is specifically realized Steps: reading the updated second service input parameter data in the warm-up table according to the preset period; and synchronizing the service data of the database to the cache service data according to the read second service input parameter data.
  • the computer program is executed by the processor to achieve the following steps: obtain incremental data of the target commodity service; obtain the third service entry data of the target commodity service from the incremental data; Obtain the third commodity service data of the target commodity service from the service data of the database, and obtain the fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter; when the third commodity service data and the fourth commodity service data When the data is not the same, update the fourth service entry data in the warm-up table of the target product service according to the third service entry data, and the fourth service entry is the service entry corresponding to the fourth product service data in the warm-up table;
  • the service data of the database is synchronized to the cache service data according to the updated fourth service entry in the warm-up table.
  • the following steps are specifically implemented: creating a sliding time window according to the update time of the commodity service data of the target commodity service; The window obtains incremental data from the product data of the stored target product service.
  • the computer program is executed by the processor to implement the following steps: write cache service data into the search service platform; develop the data query interface and abnormal data statistics interface of the search service platform; call the data query interface through the front-end display page to Query the product service data in the search service platform through the data query interface, and display the product service data in the search service platform on the front-end display page; call the abnormal data statistics interface through the front-end display page to query the search service platform through the abnormal data statistics interface Statistics of abnormal commodity and service data, and display the abnormal commodity and service data counted in the search service platform on the front-end display page.
  • the computer program is executed by the processor to implement the following steps: when the first commodity service data is different from the second commodity service data, generate a data log according to the first service input data; write the data log to the Search service platform; call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Abstract

A data processing method and apparatus for commodity service data, and a computer device and a storage medium. The method comprises: obtaining first service input-parameter data of a target commodity service from full data of the target commodity service (S100); obtaining, according to the first service input-parameter data, first commodity service data of the target commodity service from service data of a database (S300), and obtaining, according to the first service input-parameter data, second commodity service data of the target commodity service from cache service data (S500); when the first commodity service data is different from the second commodity service data, updating, according to the first service input-parameter data, second service input-parameter data in a pre-warming table of the target commodity service; and synchronizing, according to the updated second service input-parameter data in the pre-warming table, the service data of the database corresponding to the target commodity service with the cache service data (S900). The method can automatically monitor the process of updating and caching the commodity service data.

Description

数据处理方法、装置、计算机设备和存储介质Data processing method, device, computer equipment and storage medium 技术领域Technical field
本申请涉及商品服务数据处理技术领域,特别是涉及一种商品服务数据的数据处理方法、装置、计算机设备和存储介质。This application relates to the technical field of commodity service data processing, in particular to a data processing method, device, computer equipment and storage medium of commodity service data.
背景技术Background technique
互联网商品服务管理平台主要价值在提供商品信息的数据服务,其中包括数据的分发接收,入库,缓存预热,数据服务,下游系统服务推送通知等基础功能的数据服务。但是,由于商品服务数据存在服务的区分,平台根据业务场景多维度分库分表存储服务数据。因此,容易造成平台对商品服务数据的数据处理的监控不够精细。特别是,缺乏对将数据库中服务数据同步到缓存服务数据的数据处理过程的监控。对于该数据处理过程,传统监控的方式为,人工检测到生产环境中数据库的服务数据与缓存服务数据存在数据不一致的情况时,手工输入对应入参,根据对应入参将数据库中服务数据同步到缓存服务数据。该人工监控以及人工操作的方式,导致商品服务数据的数据处理的时效性低。The main value of the Internet commodity service management platform is to provide commodity information data services, including data distribution and reception, storage, cache preheating, data services, downstream system service push notifications and other basic data services. However, due to the distinction of services in commodity service data, the platform stores the service data in multi-dimensional database and table according to business scenarios. Therefore, it is easy to cause the platform to monitor the data processing of the commodity service data is not precise enough. In particular, there is a lack of monitoring of the data processing process of synchronizing the service data in the database to the cache service data. For this data processing process, the traditional monitoring method is to manually detect that there is a data inconsistency between the service data of the database and the cached service data in the production environment, manually input the corresponding input parameters, and synchronize the service data in the database to the corresponding input parameters according to the corresponding input parameters. Cache service data. The manual monitoring and manual operation methods result in low timeliness of data processing of commodity service data.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种能够自动化监控商品服务数据更新缓存的处理过程并提高更新缓存商品服务数据的时效性的商品服务数据的数据处理方法、装置、计算机设备和存储介质。Based on this, it is necessary to address the above technical problems to provide a data processing method, device, computer equipment and storage medium for commodity service data that can automatically monitor the processing process of updating the cache of commodity service data and improve the timeliness of updating the cached commodity service data .
一种商品服务数据的数据处理方法,该方法包括:A data processing method for commodity service data, the method comprising:
从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据;根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据;根据第一服务入参数数据从缓存服务数据中获取目标商品服务的第二商品服务数据;当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据,预热表用于存储将数据库的服务数据同步至缓存服务数据时对应的服务入参数据,第二服务入参数据为预热表中第二商品服务数据对应的服务入参数据;根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据。Obtain the first service entry data of the target product service from the full data of the target product service; obtain the first product service data of the target product service from the service data of the database according to the first service entry data; According to the first service entry parameter The data obtains the second commodity service data of the target commodity service from the cached service data; when the first commodity service data is not the same as the second commodity service data, update the warm-up table of the target commodity service according to the first service input data The second service input parameter data, the warm-up table is used to store the corresponding service input parameter data when the service data of the database is synchronized to the cache service data, and the second service input parameter data is the service corresponding to the second commodity service data in the warm-up table Input parameter data; according to the updated second service input parameter data in the warm-up table, the service data of the database corresponding to the target commodity service is synchronized to the cache service data.
在其中一个实施例中,第一服务入参数据为多个,根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据,包括:In one of the embodiments, there are multiple first service input parameter data, and obtaining the first commodity service data of the target commodity service from the service data of the database according to the first service input parameter data includes:
分别根据各第一服务入参数据从数据库的服务数据中获取多个第一商品服务数据;Acquire multiple first commodity service data from the service data of the database according to the respective first service input data;
根据第一服务入参数从缓存服务数据中获取目标商品服务的第二商品服务数据,包括:Obtaining the second commodity service data of the target commodity service from the cached service data according to the first service input parameter includes:
分别根据各第一服务入参数从缓存服务数据中获取目标商品服务的多个第二商品服务数据;Acquire multiple second commodity service data of the target commodity service from the cached service data according to the respective first service input parameters;
当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据,包括:When the first product service data is different from the second product service data, update the second service entry data in the warm-up table of the target product service according to the first service entry data, including:
当多个第一服务入参数中任一第一服务入参数对应的第一商品服务数据与第二商品服务数据不相同时,根据任一第一服务入参数更新目标商品服务的预热表中对应的第二服务入参数据。When the first product service data corresponding to any one of the first service input parameters in the multiple first service input parameters is different from the second product service data, update the warm-up table of the target product service according to any of the first service input parameters The corresponding input parameter data of the second service.
在其中一个实施例中,根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据,包括;In one of the embodiments, synchronizing the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table includes;
按照预设周期读取预热表中更新的第二服务入参数据;根据读取到的第二服务入参数据将数据库的服务数据同步至缓存服务数据。Read the updated second service input parameter data in the warm-up table according to a preset period; and synchronize the service data of the database to the cache service data according to the read second service input parameter data.
在其中一个实施例中,该方法还包括:In one of the embodiments, the method further includes:
获取目标商品服务的增量数据;从增量数据中获取目标商品服务的第三服务入参数据;根据第三服务入参数据从数据库的服务数据中获取目标商品服务的第三商品服务数据,以及根据第三服务入参数从缓存服务数据中获取目标商品服务的第四商品服务数据;当第三商品服务数据与第四商品服务数据不相同时,根据第三服务入参数据更新目标商品服务的预热表中的第四服务入参数据,第四服务入参为预热表中第四商品服务数据对应的服务入参;根据预热表中更新后的第四服务入参将数据库的服务数据同步至缓存服务数据。Obtain the incremental data of the target commodity service; obtain the third service input parameter data of the target commodity service from the incremental data; obtain the third commodity service data of the target commodity service from the service data of the database according to the third service input data, And obtain the fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter; when the third commodity service data is different from the fourth commodity service data, update the target commodity service according to the third service input parameter data The fourth service entry data in the warm-up table, the fourth service entry is the service entry corresponding to the fourth commodity service data in the warm-up table; according to the updated fourth service entry database in the warm-up table The service data is synchronized to the cache service data.
在其中一个实施例中,获取目标商品服务的增量数据,包括:In one of the embodiments, obtaining incremental data of the target commodity service includes:
根据目标商品服务的商品服务数据的更新时间创建滑动时间窗口;通过滑动时间窗口从存储目标商品服务的商品数据中获取增量数据。A sliding time window is created according to the update time of the commodity service data of the target commodity service; the incremental data is obtained from the commodity data of the stored target commodity service through the sliding time window.
在其中一个实施例中,该方法还包括:In one of the embodiments, the method further includes:
将缓存服务数据写入搜索服务平台;开发搜索服务平台的数据查询接口和异常数 据统计接口;通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的商品服务数据,并在前端展示页面展示搜索服务平台中的商品服务数据;通过前端展示页面调用异常数据统计接口,以通过异常数据统计接口查询搜索服务平台中统计出的异常商品服务数据,并在前端展示页面展示搜索服务平台中统计出的异常商品服务数据。Write cache service data into the search service platform; develop the data query interface and abnormal data statistics interface of the search service platform; call the data query interface through the front-end display page to query the product service data in the search service platform through the data query interface, and The front-end display page displays the commodity service data in the search service platform; the abnormal data statistics interface is called through the front-end display page to query the abnormal commodity service data counted in the search service platform through the abnormal data statistics interface, and the search service is displayed on the front-end display page Abnormal commodity service data counted in the platform.
在其中一个实施例中,该方法还包括:In one of the embodiments, the method further includes:
当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据生成数据日志;将数据日志写入搜索服务平台;通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的数据日志,并在前端展示页面展示搜索服务平台中的数据日志。When the first product service data is different from the second product service data, generate a data log according to the first service input data; write the data log to the search service platform; call the data query interface through the front-end display page to pass the data query interface Query the data log in the search service platform, and display the data log in the search service platform on the front-end display page.
一种商品服务数据的数据处理装置,该装置包括:A data processing device for commodity service data, the device comprising:
第一获取模块,用于从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据;第二获取模块,用于根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据;第三获取模块,用于根据第一服务入参数数据从缓存服务数据中获取目标商品服务的第二商品服务数据;更新模块,用于当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据,预热表用于存储将数据库的服务数据同步至缓存服务数据时对应的服务入参数据,第二服务入参数据为预热表中第二商品服务数据对应的服务入参数据;同步模块,用于根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据。The first obtaining module is used to obtain the first service input parameter data of the target commodity service from the full data of the target commodity service; the second obtaining module is used to obtain the target commodity from the service data of the database according to the first service input data The first commodity service data of the service; the third obtaining module is used to obtain the second commodity service data of the target commodity service from the cached service data according to the first service input parameter data; the update module is used to compare the first commodity service data with When the second commodity service data is not the same, update the second service input parameter data in the warm-up table of the target commodity service according to the first service input parameter data. The warm-up table is used to store and synchronize the service data of the database to the cached service data. The corresponding service input parameter data, the second service input parameter data is the service input parameter data corresponding to the second commodity service data in the warm-up table; the synchronization module is used to change the second service input parameter data according to the updated second service input data in the warm-up table The service data of the database corresponding to the target commodity service is synchronized to the cache service data.
一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述任一实施例的方法的步骤。A computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor. The processor implements the steps of the method in any of the foregoing embodiments when the processor executes the computer program.
一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述任一实施例的方法的步骤。A computer-readable storage medium with a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method in any one of the above-mentioned embodiments are implemented.
上述商品服务数据的数据处理方法、装置、计算机设备和存储介质,从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据,根据第一服务入参数据分别从数据库的服务数据中获取第一商品服务数据以及从缓存服务数据中获取目标商品服务的第二商品服务数据。当对比出第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据。进一步地,根据预热表中更新后的第二服务入参将数据库的服务数据同步至缓存服务数据。因此, 该商品服务数据的数据处理方法,无需采用人工方式更新缓存服务数据,通过预热表中服务入参数据的更新情况自动化对目标商品服务对应在数据库中的商品服务数据和缓存服务数据中的商品服务数据的比对情况进行监控,并通过预热表中更新的服务入参数据自动化将数据库的服务数据同步至缓存服务数据,完成了目标商品服务对应的商品服务数据的缓存更新,降低了人为维护商品服务数据的成本,减少人工干预的次数,提升商品服务数据的数据处理的时效性。The above-mentioned data processing method, device, computer equipment and storage medium of the commodity service data obtain the first service entry data of the target commodity service from the full data of the target commodity service, and respectively obtain the service data from the database according to the first service entry data Obtain the first commodity service data and obtain the second commodity service data of the target commodity service from the cached service data. When the comparison of the first commodity service data and the second commodity service data is different, the second service entry data in the warm-up table of the target commodity service is updated according to the first service entry data. Further, the service data of the database is synchronized to the cache service data according to the updated second service entry in the warm-up table. Therefore, the data processing method of the commodity service data does not need to manually update the cached service data, and automatically corresponds to the target commodity service in the commodity service data and the cached service data in the database through the update of the service input parameter data in the warm-up table The comparison of commodity service data is monitored, and the service data in the database is automatically synchronized to the cache service data through the updated service input data in the warm-up table, and the cache update of the commodity service data corresponding to the target commodity service is completed, reducing The cost of artificial maintenance of commodity service data is reduced, the number of manual interventions is reduced, and the timeliness of data processing of commodity service data is improved.
附图说明Description of the drawings
图1为一个实施例中一种商品服务数据的数据处理方法的应用环境图;Figure 1 is an application environment diagram of a data processing method for commodity service data in an embodiment;
图2为一个实施例中一种商品服务数据的数据处理方法的流程示意图;2 is a schematic flowchart of a data processing method for commodity service data in an embodiment;
图3为另一个实施例中一种商品服务数据的数据处理方法的流程示意图;3 is a schematic flowchart of a data processing method for commodity service data in another embodiment;
图4为再一个实施例中一种商品服务数据的数据处理方法的部分流程示意图;FIG. 4 is a schematic diagram of a partial flow of a data processing method for commodity service data in another embodiment;
图5为又一个实施例中一种商品服务数据的数据处理方法的部分流程示意图;FIG. 5 is a schematic flowchart of a part of a data processing method for commodity service data in another embodiment;
图6为又一个实施例中一种商品服务数据的数据处理方法的部分流程示意图;FIG. 6 is a schematic diagram of a partial flow of a data processing method for commodity service data in another embodiment;
图7为一个实施例中一种商品服务数据的数据处理装置的结构框图;Figure 7 is a structural block diagram of a data processing device for commodity service data in an embodiment;
图8为一个实施例中计算机设备的内部结构图。Fig. 8 is an internal structure diagram of a computer device in an embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions, and advantages of this application clearer and clearer, the following further describes the application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
本申请提供的一种商品服务数据的数据处理方法,可以应用于如图1所示的应用环境中。数据库10存储有多种商品服务数据,每种商品服务数据可以以商品服务数据存储表的形式分别存储在数据库10中。缓存设备30存储有数据库10中用于做缓存处理的商品服务数据。一般地,需要从数据库10的商品服务数据中筛选出部分商品服务数据,同步缓存到存储缓存设备30中,对商品服务数据进行预热处理,以便提高该部分商品服务数据的读取速度。服务器50从数据库10中的目标商品服务的全量数据中获取目标商品服务的第一服务入参数据,根据该第一服务入参数据分别从数据库10中获取目标商品服务的第一商品服务数据以及从缓存服务数据中获取目标商品服务的第二商品服务数据。当确定第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新数据库10中目标商品服务的预热表中的第二服务入参数据。其 中,数据库10中目标商品服务的预热表用于存储将数据库10的服务数据同步至缓存设备30中缓存服务数据时对应的服务入参,第二服务入参数据为该预热表中第二商品服务数据对应的服务入参数据。最终,服务器50根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据。其中,服务器50可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The data processing method of commodity service data provided in this application can be applied to the application environment as shown in FIG. 1. The database 10 stores a variety of commodity service data, and each commodity service data may be separately stored in the database 10 in the form of a commodity service data storage table. The cache device 30 stores commodity service data used for cache processing in the database 10. Generally, it is necessary to filter out part of the commodity service data from the commodity service data of the database 10, and synchronously cache it in the storage and cache device 30, and perform pre-heat treatment on the commodity service data, so as to improve the reading speed of this part of commodity service data. The server 50 obtains the first service entry data of the target product service from the full data of the target product service in the database 10, and obtains the first product service data of the target product service and the first product service data from the database 10 according to the first service entry data. Obtain the second commodity service data of the target commodity service from the cached service data. When it is determined that the first product service data is different from the second product service data, the second service entry data in the warm-up table of the target product service in the database 10 is updated according to the first service entry data. Among them, the warm-up table of the target commodity service in the database 10 is used to store the corresponding service input parameters when the service data of the database 10 is synchronized to the cached service data in the cache device 30, and the second service-input parameter data is the first in the warm-up table. 2. The service entry data corresponding to the commodity service data. Finally, the server 50 synchronizes the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table. Among them, the server 50 may be implemented by an independent server or a server cluster composed of multiple servers.
在一个实施例中,如图2所示,提供了一种商品服务数据的数据处理方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2, a data processing method for commodity service data is provided. Taking the method applied to the server in FIG. 1 as an example for description, the method includes the following steps:
S100,从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据。S100: Obtain the first service entry data of the target commodity service from the full amount of data of the target commodity service.
在本实施例中,服务器从目标商品服务的全量数据中筛选出对应的第一服务入参数据。目标商品服务的全量数据包括目标商品服务的商品服务数据以及用于读取商品服务数据的服务入参数据。其中,目标商品服务的全量数据可以是存储在数据库中的全量数据。全量数据可以包括平台的离线数据。目标商品服务的第一服务入参数据可以是一个或多个。具体地,利用大数据平台的任务计算能力,将目标商品服务的离线全量数据抽取至大数据平台临时表,全量计算目标商品服务的各维度商品服务数据得到第一服务入参数据。In this embodiment, the server filters out the corresponding first service entry data from the full data of the target commodity service. The full data of the target commodity service includes the commodity service data of the target commodity service and the service entry data used to read the commodity service data. Among them, the full amount of data of the target commodity service may be the full amount of data stored in the database. The full amount of data can include offline data of the platform. The first service entry data of the target commodity service may be one or more. Specifically, the task computing capability of the big data platform is used to extract the offline full amount of data of the target commodity service to the temporary table of the big data platform, and the full amount of commodity service data of each dimension of the target commodity service is calculated to obtain the first service entry data.
S300,根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据。S300: Acquire the first commodity service data of the target commodity service from the service data of the database according to the first service entry data.
当商品服务管理平台接收到商品服务数据时,将商品服务数据存储到数据库中。服务器将接收到包含服务入参数据的服务获取请求时,根据服务入参数据从数据库中调取对应的商品服务数据。在本实施例中,服务器从数据库的服务数据中获取目标商品服务的第一商品服务数据。具体地,服务器存储有目标商品服务的服务入参数据以及商品服务数据的对应关系,两者的对应关系以商品服务信息存储表的形式存储在服务器中。服务器根据第一服务入参数据能够获取对应的第一商品服务数据。When the commodity service management platform receives the commodity service data, it stores the commodity service data in the database. When the server receives the service acquisition request containing the service input parameter data, it retrieves the corresponding commodity service data from the database according to the service input parameter data. In this embodiment, the server obtains the first commodity service data of the target commodity service from the service data of the database. Specifically, the server stores the service entry data of the target commodity service and the correspondence relationship of the commodity service data, and the correspondence relationship between the two is stored in the server in the form of a commodity service information storage table. The server can obtain the corresponding first commodity service data according to the first service input parameter data.
S500,根据第一服务入参数数据从缓存服务数据中获取目标商品服务的第二商品服务数据。S500: Acquire second commodity service data of the target commodity service from the cached service data according to the first service input parameter data.
在本实施例中,商品服务管理平台根据业务需求将数据库中部分商品服务数据进行预热处理,将该部分服务数据作为缓存服务数据存储在缓存设备中。服务器根据该第一服务入参数数据从缓存服务数据中读取出目标商品服务的第二商品服务数据。其中,第二商品服务数据是将第一商品服务数据从数据库同步到缓存设备以进行缓存的商品服务数据。但是,数据库的商品服务数据会根据接收到的新商品服务数据进行更 新,更新后的第二商品服务数据与第一商品服务数据存在差异。In this embodiment, the commodity service management platform pre-heats part of the commodity service data in the database according to business requirements, and stores the part of the service data as cache service data in the cache device. The server reads the second commodity service data of the target commodity service from the cached service data according to the first service input parameter data. Wherein, the second commodity service data is commodity service data obtained by synchronizing the first commodity service data from the database to the caching device for caching. However, the commodity service data of the database will be updated according to the received new commodity service data, and there is a difference between the updated second commodity service data and the first commodity service data.
S700,当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据,预热表用于存储将数据库的服务数据同步至缓存服务数据时对应的服务入参数据,第二服务入参数据为预热表中第二商品服务数据对应的服务入参数据。S700: When the first commodity service data is different from the second commodity service data, update the second service input parameter data in the warm-up table of the target commodity service according to the first service input parameter data, and the warm-up table is used to store the database The service data of is synchronized to the corresponding service entry data when the service data is cached, and the second service entry data is the service entry data corresponding to the second commodity service data in the warm-up table.
在本实施例中,服务器根据目标商品服务的特性设置对应的预热表。预热表中存储用于将数据库的服务数据同步至缓存服务数据时对应的服务入参数据时对应的服务入参数据。也即是,服务器根据预热表中的服务入参数据对目标商品服务的商品服务数据进行预热操作。服务器检测到第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据。具体地,采用报文格式无排序对比算法对第一商品服务数据与第二商品服务数据进行计算。当两者不一致时,回写预热表,将第一服务入参数据替换预热表中的第二服务入参数据,因此有效地减少了商品服务数据的不一致性产生的人力维护成本,提升了生产环境数据的精准度,降低了商家及用户因商品服务数据未及时更新而导致的投诉次数。In this embodiment, the server sets a corresponding warm-up table according to the characteristics of the target commodity service. The warm-up table stores the corresponding service input data when synchronizing the service data of the database to the corresponding service input data when the service data is cached. That is, the server performs a warm-up operation on the commodity service data of the target commodity service according to the service entry data in the warm-up table. When the server detects that the first commodity service data is different from the second commodity service data, it updates the second service entry data in the warm-up table of the target commodity service according to the first service entry data. Specifically, a message format unsorted comparison algorithm is used to calculate the first commodity service data and the second commodity service data. When the two are inconsistent, write back the warm-up table and replace the first service entry data with the second service entry data in the warm-up table, thus effectively reducing the labor maintenance cost caused by the inconsistency of commodity service data, and improving The accuracy of production environment data is reduced, and the number of complaints caused by merchants and users not being updated in time for product and service data is reduced.
S900,根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据。S900: Synchronize the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table.
在本实施例中,服务器对目标商品服务的商品服务数据执行数据预热时,从预热表中读取更新后的第二服务入参数据。通过第二服务入参数据从数据库的服务数据中读取出对应的商品服务数据,将该对应的商品服务数据同步至缓存服务数据中。因此,无需人工监控即可实现自动化检测到目标商品服务对应在数据库中的商品服务数据更新,并在数据更新时将数据库中的商品服务数据同步到缓存服务数据中。In this embodiment, when the server performs data warm-up on the commodity service data of the target commodity service, it reads the updated second service input parameter data from the warm-up table. The corresponding commodity service data is read from the service data of the database through the second service input data, and the corresponding commodity service data is synchronized to the cache service data. Therefore, it is possible to automatically detect the update of the product service data in the database corresponding to the target product service without manual monitoring, and synchronize the product service data in the database to the cache service data when the data is updated.
在一实施例中,S900包括:按照预设周期读取预热表中更新的第二服务入参数据,根据读取到的第二服务入参数据将数据库的服务数据同步至缓存服务数据。In an embodiment, S900 includes: reading the updated second service input parameter data in the warm-up table according to a preset period, and synchronizing the service data of the database to the cache service data according to the read second service input parameter data.
上述商品服务数据的数据处理方法,从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据,根据第一服务入参数据分别从数据库的服务数据中获取第一商品服务数据以及从缓存服务数据中获取目标商品服务的第二商品服务数据。当对比出第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据。进一步地,根据预热表中更新后的第二服务入参将数据库的服务数据同步至缓存服务数据。因此,该商品服务数据的数据处理方法,无需采用人工方式更新缓存服务数据,通过预热表中服务入参数据的更新情 况自动化对目标商品服务对应在数据库中的商品服务数据和缓存服务数据中的商品服务数据的比对情况进行监控,并通过预热表中更新的服务入参数据自动化将数据库的服务数据同步至缓存服务数据,完成了目标商品服务对应的商品服务数据的缓存更新,降低了人为维护商品服务数据的成本,减少人工干预的次数,提升商品服务数据的数据处理的时效性。The above-mentioned data processing method of commodity service data obtains the first service input parameter data of the target commodity service from the full data of the target commodity service, and obtains the first commodity service data from the service data in the database according to the first service input parameter data, and Obtain the second commodity service data of the target commodity service from the cached service data. When the comparison of the first commodity service data and the second commodity service data is different, the second service entry data in the warm-up table of the target commodity service is updated according to the first service entry data. Further, the service data of the database is synchronized to the cache service data according to the updated second service entry in the warm-up table. Therefore, the data processing method of the commodity service data does not need to manually update the cached service data, and automatically corresponds to the target commodity service in the commodity service data and the cached service data in the database through the update of the service input parameter data in the warm-up table The comparison of commodity service data is monitored, and the service data in the database is automatically synchronized to the cache service data through the updated service input data in the warm-up table, and the cache update of the commodity service data corresponding to the target commodity service is completed, reducing The cost of artificial maintenance of commodity service data is reduced, the number of manual interventions is reduced, and the timeliness of data processing of commodity service data is improved.
在一个实施例中,目标商品服务的全量数据中的第一服务入参数据为多个。如图3所示,S300包括步骤:In one embodiment, there are multiple first service entry data in the full data of the target commodity service. As shown in Figure 3, S300 includes steps:
S301:分别根据各第一服务入参数据从数据库的服务数据中获取多个第一商品服务数据。S301: Acquire multiple first commodity service data from the service data of the database according to the respective first service input data.
S500包括步骤:S500 includes steps:
S501:分别根据各第一服务入参数从缓存服务数据中获取目标商品服务的多个第二商品服务数据。S501: Acquire multiple second commodity service data of the target commodity service from the cached service data according to each first service input parameter.
S700包括步骤:S700 includes steps:
S701:当多个第一服务入参数中任一第一服务入参数对应的第一商品服务数据与第二商品服务数据不相同时,根据任一第一服务入参数更新目标商品服务的预热表中对应的第二服务入参数据。S701: When the first product service data corresponding to any one of the first service input parameters in the plurality of first service input parameters is different from the second product service data, update the warm-up of the target product service according to any one of the first service input parameters The corresponding entry data of the second service in the table.
在该实施例中,服务器从目标商品服务的全量数据中获取目标商品服务的多个第一服务入参数据,根据每个第一服务入参数据分别从数据库的服务数据中获取多个第一商品服务数据以及从缓存服务数据中获取目标商品服务的多个第二商品服务数据。进一步地,分别将各个对应的第一商品服务数据和第二商品服务数据进行对比。当任一对比结果显示第一商品服务数据和第二商品服务数据不同时,利用该结果对应的第一服务入参数据更新预热表中的对应的第二服务入参数据。此时,第二服务入参数据也为多个。最终,根据预热表中更新后的所有第二服务入参将数据库的服务数据同步至缓存服务数据。因此,可以自动化监控目标商品服务对应的所有商品服务数据的更新情况,并根据更新结果自动化将数据库的服务数据同步至缓存服务数据。In this embodiment, the server obtains multiple first service input parameter data of the target commodity service from the full data of the target commodity service, and obtains multiple first service input parameter data from the service data of the database according to each first service input parameter data. The commodity service data and a plurality of second commodity service data of the target commodity service obtained from the cached service data. Further, each corresponding first commodity service data and second commodity service data are respectively compared. When any comparison result shows that the first product service data and the second product service data are different, the first service entry data corresponding to the result is used to update the corresponding second service entry data in the warm-up table. At this time, there are also multiple input parameter data for the second service. Finally, the service data of the database is synchronized to the cache service data according to all the updated second service entries in the warm-up table. Therefore, it is possible to automatically monitor the update status of all product service data corresponding to the target product service, and automatically synchronize the service data of the database to the cache service data according to the update result.
在一具体实施方式中,设计大数据平台临时表,通过数据库中间件,如Mycat中间件,将数据库基础数据的全量数据抽取至临时表。其中,根据不同商品服务及其关联数据的维度设计不同的临时表的表结构,区别于临时表与数据库表数据类型的不同,可以对临时表中具体字段类型做映射。在一实施过程中,目标商品服务为商品基本信息服务,第一服务入参数据为商品编码。从商品基本信息服务的商品基本信息表中抽 取商品编码,商家编码作为服务查询和缓存查询的关键字段,设计临时表建表语句如下:In a specific implementation, the temporary table of the big data platform is designed, and the full amount of basic data of the database is extracted to the temporary table through database middleware, such as Mycat middleware. Among them, the table structure of different temporary tables is designed according to the dimensions of different goods and services and their associated data, which is different from the difference between the data types of temporary tables and database tables, and the specific field types in the temporary tables can be mapped. In an implementation process, the target commodity service is a commodity basic information service, and the first service entry data is a commodity code. The commodity code is extracted from the commodity basic information table of the commodity basic information service. The merchant code is used as the key field for service query and cache query. The temporary table creation statement is designed as follows:
CREATE TABLE`hive_product_base_info`(CREATE TABLE`hive_product_base_info`(
`partnumber`string COMMENT′商品编码′,`partnumber`string COMMENT' commodity code',
`suppliercode`string COMMENT′商家编码′,`suppliercode`string COMMENT'merchant code',
COMMENT′商品基本信息服务关键字段表′,COMMENT'Commodity basic information service key field table',
ROW FORMAT SERDEROW FORMAT SERDE
′org.apache.hadoop.hive.ql.io.orc.OrcSerde′′Org.apache.hadoop.hive.ql.io.orc.OrcSerde′
STORED AS INPUTFORMATSTORED AS INPUTFORMAT
′org.apache.hadoop.hive.ql.io.orc.OrcInputFormat′‘Org.apache.hadoop.hive.ql.io.orc.OrcInputFormat’
OUTPUTFORMATOUTPUTFORMAT
′org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat′);‘Org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat’);
以上即可创建临时表,通过大数据平台,将Mycat数据源商品基本信息表中的需要字段数据抽取出来,之后在大数据平台上,通过数据探查工具可以查询hive_product_base_info表中的数据完整性,验证服务数据抽取过程的正确性。The above can create a temporary table, through the big data platform, extract the required field data in the basic information table of the Mycat data source product, and then on the big data platform, through the data exploration tool, you can query the data integrity in the hive_product_base_info table to verify The correctness of the service data extraction process.
以上步骤完成后,利用大数据平台的计算能力,开发任务计算临时表数据,利用报文格式无排序对比算法,将数据库中的商品服务数据与缓存服务数据进行对比,数据不一致时将服务入参数据,如商品编码,写入新临时表。计算完成后将新临时表中的服务入参数据通过数据交换,回写预热表中服务入参,过程中设计监控逻辑,生成数据日志写入实时数据流。具体实施时,工程中新建spark包,新建具体服务的大数据任务计算类。如商品基本信息服务,新建SparkWarmProductBaseInfoHivejava类,编写main函数,依次创建SparkConf,JavaSparkContext,HiveContext来实现配置的读取加载初始化,HiveContext实例sqlContext,支持Spark SQL的查询,抽取Hive表hive_product_base_info,生成Dataset<Row>数据源,转化为javaRDD对象,遍历表数据,在循环体内获取每一行数据,分别查询缓存和数据库中商品基本信息服务数据,利用报文格式无排序对比算法,比较缓存和数据库中的服务数据是否完全一致,将不一致的服务数据写入新创建的对比结果Hive表。将SparkWarmProductBaseInfoHive类打包生成jar文件,上传至大数据平台,运行后获取比较结果的Hive表,再通过数据交换的形式将服务入参数据写入数据库预热表,监控过程中的所有服务数据,生成日志写入实时数据流,实施后,可以通过Hive表挑选部分数据进行验证,验证缓存和数据库中的服务数据是否一致即可。After the above steps are completed, use the computing power of the big data platform to develop tasks to calculate the temporary table data, and use the message format unsorted comparison algorithm to compare the commodity service data in the database with the cached service data. If the data is inconsistent, the service will be added to the reference. Data, such as commodity codes, are written into the new temporary table. After the calculation is completed, the service input data in the new temporary table is exchanged through data, and the service input parameters in the warm-up table are written back. In the process, the monitoring logic is designed, and the data log is generated and written into the real-time data stream. During specific implementation, a spark package is created in the project, and a big data task calculation class for a specific service is created. For example, product basic information service, create a new SparkWarmProductBaseInfoHivejava class, write a main function, create SparkConf, JavaSparkContext, and HiveContext in turn to implement configuration read and load initialization, HiveContext instance sqlContext, support Spark SQL query, extract Hive table hive_product_base_info, generate Dataset<Row> The data source is transformed into a javaRDD object, the table data is traversed, each row of data is obtained in the loop body, the basic information service data of the goods in the cache and the database are respectively queried, and the message format unsorted comparison algorithm is used to compare whether the service data in the cache and the database are Completely consistent, write inconsistent service data into the newly created comparison result Hive table. Pack the SparkWarmProductBaseInfoHive class to generate a jar file, upload it to the big data platform, get the Hive table of the comparison result after running, and then write the service input parameter data into the database warm-up table in the form of data exchange, monitor all service data in the process, and generate Logs are written into the real-time data stream. After implementation, you can select part of the data through the Hive table for verification, and verify that the service data in the cache and the database are consistent.
在一实施例中,如图4所示,S900之后,还包括步骤:In an embodiment, as shown in FIG. 4, after S900, the method further includes the following steps:
S1000:获取目标商品服务的增量数据。S1000: Obtain incremental data of the target commodity service.
S1200:从增量数据中获取目标商品服务的第三服务入参数据。S1200: Obtain the third service entry data of the target commodity service from the incremental data.
S1400:根据第三服务入参数据从数据库的服务数据中获取目标商品服务的第三商品服务数据,以及根据第三服务入参数从缓存服务数据中获取目标商品服务的第四商品服务数据。S1400: Obtain third commodity service data of the target commodity service from the service data of the database according to the third service input parameter data, and obtain fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter.
S1600:当第三商品服务数据与第四商品服务数据不相同时,根据第三服务入参数据更新目标商品服务的预热表中的第四服务入参数据,第四服务入参为预热表中第四商品服务数据对应的服务入参。S1600: When the third product service data is different from the fourth product service data, update the fourth service entry data in the warm-up table of the target product service according to the third service entry data, and the fourth service entry is the warm-up The service entry corresponding to the fourth commodity service data in the table.
S1800:根据预热表中更新后的第四服务入参将数据库的服务数据同步至缓存服务数据。S1800: Synchronize the service data of the database to the cache service data according to the updated fourth service entry in the warm-up table.
在该实施例中,服务器根据目标商品服务的全量数据执行上述S100至S900之后,后续服务器在对目标商品服务的商品服务数据进行监控时,只需要对目标商品服务的增量数据进行监控即可。具体地,从增量数据中获取第三服务入参数据,根据第三服务入参数据从数据库的服务数据中获取目标商品服务的第三商品服务数据,以及从缓存服务数据中获取目标商品服务的第四商品服务数据。其中,第三商品服务数据可以是增量数据中的商品服务数据。进一步地,当第三商品服务数据与第四商品服务数据不相同时,根据第三服务入参数据更新目标商品服务的预热表中的第四服务入参数据。最后根据预热表中更新后的第四服务入参将数据库的服务数据同步至缓存服务数据。因此,可以实现对平台中后续目标商品服务的增量数据中的商品服务数据更新情况进行监控,并自动化更新对应的缓存服务数据。In this embodiment, after the server executes the above S100 to S900 according to the full data of the target commodity service, the subsequent server only needs to monitor the incremental data of the target commodity service when monitoring the commodity service data of the target commodity service. . Specifically, obtain the third service entry data from the incremental data, obtain the third product service data of the target product service from the service data of the database according to the third service entry data, and obtain the target product service data from the cached service data The fourth commodity service data. Wherein, the third commodity service data may be commodity service data in incremental data. Further, when the third product service data is different from the fourth product service data, the fourth service entry data in the warm-up table of the target product service is updated according to the third service entry data. Finally, the service data of the database is synchronized to the cache service data according to the updated fourth service entry in the warm-up table. Therefore, it is possible to monitor the update of the commodity service data in the incremental data of the subsequent target commodity service in the platform, and automatically update the corresponding cache service data.
在该实施例的一个实施方式中,S1000包括:根据目标商品服务的商品服务数据的更新时间创建滑动时间窗口,通过滑动时间窗口从存储目标商品服务的商品数据中获取增量数据。In an implementation of this embodiment, S1000 includes: creating a sliding time window according to the update time of the commodity service data of the target commodity service, and obtaining incremental data from the commodity data of the stored target commodity service through the sliding time window.
在该实施例中,通过滑动时间窗口获取目标商品服务的商品服务数据的增量数据。具体地,创建滑动时间窗口,滑动时间窗口可动态配置。如根据目标商品服务的商品服务数据落表更新时间确定滑动时间窗口的取值范围。滑动时间窗口的取值范围表示为:开始时间±N*窗口时间,结束时间±N*窗口时间。通过滑动时间窗口从存储目标商品服务的商品服务数据的商品服务存储表中获取增量数据的具体方式为:从数据库对应目标商品服务的商品服务存储表中,获取目标商品服务的商品服务数据落表更新时 间,将更新时间在[开始时间±N*窗口时间,结束时间±N*窗口时间)范围内的获取目标商品服务的商品数据,获得的商品数据即为增量数据。In this embodiment, the incremental data of the commodity service data of the target commodity service is obtained through a sliding time window. Specifically, a sliding time window is created, and the sliding time window can be dynamically configured. For example, the value range of the sliding time window is determined according to the update time of the commodity service data table of the target commodity service. The value range of the sliding time window is expressed as: start time ±N*window time, end time ±N*window time. The specific way to obtain incremental data from the commodity service storage table storing the commodity service data of the target commodity service through the sliding time window is: obtain the commodity service data of the target commodity service from the commodity service storage table corresponding to the target commodity and service in the database. Table update time, the update time is within the range of [start time±N*window time, end time±N*window time) to obtain the commodity data of the target commodity service, and the obtained commodity data is the incremental data.
在该实施例的一个实施方式中,针对目标商品服务的增量数据,其预热逻辑为:将不一致的服务入参数据存入目标商品服务的预热表,预热表中的服务入参数据通过定时任务触发实时计算,计算时实时取数据库中的服务入参数据对应的商品服务数据,以更新当前缓存的商品服务数据,同时加上预热表中的更新时间作为缓存数据的版本号,以期下次对比数据时通过版本号的对比结果获取商品服务数据的不一致性,降低对比算法的执行时间,提升对比效率。In one implementation of this embodiment, for the incremental data of the target commodity service, the warm-up logic is: store the inconsistent service entry data into the warm-up table of the target commodity service, and the service entry parameters in the warm-up table The data triggers real-time calculations through timed tasks. During calculation, the commodity service data corresponding to the service input parameter data in the database is taken in real time to update the currently cached commodity service data. At the same time, the update time in the warm-up table is added as the version number of the cached data , In order to obtain the inconsistency of the product and service data through the comparison result of the version number when the data is compared next time, reduce the execution time of the comparison algorithm, and improve the comparison efficiency.
因此,通过滑动时间窗口获取目标商品服务的商品服务数据,比对缓存与数据库中的商品服务数据的一致性,不一致时将服务入参数据提取并回写重新预热,以期能实现商品服务数据的运维监控。在商品服务数据因更新延迟,物理机宕机,数据库主从不同步等导致不一致的情况下,通过该技术手段,对过程做监控,对商品服务数据做运维,提供商品服务数据的精准服务。Therefore, the commodity service data of the target commodity service is obtained through a sliding time window, and the consistency of the commodity service data in the cache and the database is compared. When inconsistent, the service input data is extracted and written back to re-warm, in order to realize the commodity service data Operation and maintenance monitoring. When commodity service data is updated due to delays, physical machine downtime, database master-slave unsynchronization, etc., inconsistencies are caused, through this technical means, the process is monitored, the commodity service data is operated and maintained, and the commodity service data accurate service is provided. .
针对该实施例,以下提供一具体实施方式:For this embodiment, a specific implementation is provided as follows:
开发服务的滑动时间窗口时间片二次预热任务抽象类,二次预热任务抽象类实现数据源定义、当前服务定义、按时间片的服务数据查询、缓存Key的生成、缓存查询、数据库表服务数据查询、报文格式无排序对比算法,过程状态监测方法等通用方法。具体实施时,新建rewarmer包,在其下新建base包,新建AbstractRewarmer抽象类,其中完成Mycat数据源的自动装配实例化,定义如下抽象方法:Develop the sliding time window time slice secondary warm-up task abstract class of the development service, and the secondary warm-up task abstract class implements data source definition, current service definition, service data query by time slice, cache key generation, cache query, database table General methods such as service data query, message format unsorted comparison algorithm, process status monitoring method, etc. In the specific implementation, create a new rewarmer package, create a new base package under it, and create a new AbstractRewarmer abstract class, which completes the automatic assembly instantiation of the Mycat data source, and defines the following abstract methods:
getService,用于获取二次预热所属服务;getService, used to obtain the service to which the secondary warm-up belongs;
queryChangeData,用于查询具体服务表中变更数据;queryChangeData, used to query the change data in the specific service table;
generalCacheKey,用于调用缓存CacheKey模板生成器生成缓存Key;generalCacheKey, used to call the cache CacheKey template generator to generate the cache key;
generalDBValue,用于调用Mycat数据源查询具体服务的基本信息;generalDBValue, used to call the Mycat data source to query the basic information of a specific service;
compareData,用于对比报文格式无排序一致性的算法;compareData, an algorithm used to compare packet formats without ordering consistency;
insert2Warmer,用于将参数数据批量写入预热表;insert2Warmer, used to write parameter data into the warm-up table in batches;
getInitParams,用于获取初始参数列表,包含时间范围startTime,endTime;getInitParams, used to obtain the initial parameter list, including the time range startTime, endTime;
historyCacheKeyGenerator,用于生成历史信息记录缓存key;historyCacheKeyGenerator, used to generate historical information record cache key;
runHistoryTimeCacheKeyGenerator,用于生成历史运行时间范围缓存key;runHistoryTimeCacheKeyGenerator, used to generate historical run time range cache key;
stateCacheKeyGenerator,用于生成服务二次预热job状态缓存key;stateCacheKeyGenerator, used to generate the state cache key for the second preheating job of the service;
totalCacheKeyGenerator,用于生成服务二次预热job历史每天总预热数据量缓存 key;totalCacheKeyGenerator, used to generate the cache key for the total preheated data volume of the service's secondary warm-up job history every day;
getRunningState,用于获取job运行状态;getRunningState, used to get the running status of the job;
定义实例方法:Define the instance method:
run,用于job的执行、获取状态锁,加锁及释放锁,异常捕捉;run, used for job execution, acquiring status locks, locking and releasing locks, and exception capture;
execute,用于job的整体执行,业务处理。execute, used for overall job execution and business processing.
抽象类定义完成后,需要新建实现类。例如目标商品服务为商品基本信息服务:在rewarmer包下新建RewarmerProductBaseInfo,以实现抽象类中的抽象方法以及实现类的基本定义。实现的业务逻辑从商品基本信息表中查询当前job运行约定时间范围内(如最近5分钟)的商品服务数据,根据CacheKey从缓存中查询商品服务数据进行比较。若商品服务数据不一致,则将服务数据写入预热表,同时更新缓存当前服务状态,下一阶段Job执行时间范围往后推移5分钟。After the abstract class definition is complete, you need to create a new implementation class. For example, the target commodity service is commodity basic information service: Create a new RewarmerProductBaseInfo under the revarmer package to implement the abstract methods in the abstract class and the basic definition of the realization class. The implemented business logic queries the commodity service data within the agreed time range (such as the last 5 minutes) of the current job operation from the commodity basic information table, and queries the commodity service data from the cache for comparison according to the CacheKey. If the product and service data is inconsistent, the service data is written into the warm-up table, and the current service status of the cache is updated at the same time. The execution time range of the next stage Job will move forward for 5 minutes.
任务定义完成后,配置Spring Quartz定时器设置工具,启动上述步骤配置的job,完成各服务的时间片二次预热功能,实现服务自运维的策略。具体实施时,可以配置Quartz的定时器CronExpression,每小时的第0分0秒开始,每5分钟触发一次。启动工程后,查看job的运行情况,验证对应时间范围内,缓存和数据库的商品服务数据不一致的情况下,数据是否会在计算后写入预热表,进行服务的二次预热,验证job第二次触发时,范围时间片是否会往后推移5分钟,查询后5分钟内的服务数据进行比较,将比较后不一致的服务数据写入预热表。After the task definition is completed, configure the Spring Quartz timer setting tool, start the job configured in the above steps, complete the time slice secondary warm-up function of each service, and implement the service self-operation and maintenance strategy. In specific implementation, you can configure Quartz's timer CronExpression, which starts at 0 minute and 0 second every hour and triggers every 5 minutes. After starting the project, check the running status of the job and verify that if the goods and service data in the cache and the database are inconsistent within the corresponding time range, whether the data will be written into the warm-up table after calculation, perform the second warm-up of the service, and verify the job When the second time is triggered, whether the range time slice will move 5 minutes later, compare the service data within 5 minutes after the query, and write the inconsistent service data after the comparison into the warm-up table.
任务完成后,开发预热任务抽象类,实现预热表的读取,缓存的更新写入,数据库服务数据的查询,商品服务数据的业务逻辑计算方法等通用方法。具体实施时,新建warmer包,在warmer包下新建base包,新建AbstractWarmer抽象类。定义以上抽象方法,抽象类完成后,在warmer包下根据不同的服务继承AbstractWarmer抽象类实现各具体服务的预热功能,完成后同上述步骤配置定时任务完成服务数据的预热功能。After the task is completed, an abstract class of preheating tasks is developed to realize general methods such as reading of preheating tables, updating and writing of cache, querying of database service data, and business logic calculation methods of commodity service data. For specific implementation, create a warmer package, a base package under the warmer package, and a new AbstractWarmer abstract class. Define the above abstract methods. After the abstract class is completed, the AbstractWarmer abstract class is inherited under the warmer package according to different services to realize the preheating function of each specific service. After completion, the timed task is configured with the above steps to complete the preheating function of the service data.
在一实施例中,如图5所示,S100之前,还包括:In an embodiment, as shown in FIG. 5, before S100, the method further includes:
S101:将缓存服务数据写入搜索服务平台。S101: Write the cache service data to the search service platform.
S103:开发搜索服务平台的数据查询接口和异常数据统计接口。S103: Develop a data query interface and an abnormal data statistics interface of the search service platform.
S105:通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的商品服务数据,并在前端展示页面展示搜索服务平台中的商品服务数据。S105: Call the data query interface through the front-end display page to query the product service data in the search service platform through the data query interface, and display the product service data in the search service platform on the front-end display page.
S107:通过前端展示页面调用异常数据统计接口,以通过异常数据统计接口查询 搜索服务平台中统计出的异常商品服务数据,并在前端展示页面展示搜索服务平台中统计出的商品异常服务数据。S107: Call the abnormal data statistics interface through the front-end display page to query the abnormal commodity service data counted in the search service platform through the abnormal data statistics interface, and display the commodity abnormal service data counted in the search service platform on the front-end display page.
在该实施例中,服务器将缓存服务数据作为目标商品服务的商品基础数据写入搜索服务平台。此外,服务器对目标商品服务的商品基础数据的接收入库增加监控,接收的商品基础数据生成日志写入实时数据流。进一步地,验证实时数据流是否被中间件消费写入搜索服务平台,正常写入结束验证。同时,基于搜索服务平台开发数据查询接口以及异常数据统计接口,供前端展示页面调用。通过前端展示页面展示搜索服务平台中的商品服务数据以及展示搜索服务平台中统计出的商品异常服务数据。In this embodiment, the server writes the cached service data as the commodity basic data of the target commodity service into the search service platform. In addition, the server increases the monitoring of the receipt and storage of the basic commodity data of the target commodity service, and the basic commodity data received is generated into a log and written into the real-time data stream. Further, it is verified whether the real-time data stream is written into the search service platform by middleware consumption, and the normal writing ends verification. At the same time, a data query interface and an abnormal data statistics interface are developed based on the search service platform for the front-end display page to call. Display the commodity service data in the search service platform and display the commodity abnormal service data counted in the search service platform through the front-end display page.
在一具体实施方式中,对目标商品服务的商品基础数据的接收入库增加监控,接收的数据生成日志写入实时数据流。具体实施时,可在XML消息接收处理抽象类AbstractMessageReceiveService的接收数据方法类execute中增加系统配置开关,具体开关名称可以设置为log.switch。开关为控制异常情况的一种容灾手段。如发生异常或数据量急剧增加时的容灾手段。利用开关实现对接收报文的解析及对象格式的转换,进而封装成协议规定的用于实时数据流传输的报文格式数据。设置传输对象名称为MonitorLogDto,包含字段:流水号,服务类型,服务编码,处理用时,报文单品条数,创建时间,异常信息,报文内容等,数据传输的方式采用而不仅限于字节流的形式。可以定义实时数据流为system_monitor_log,编写生产数据的工具类,即可将封装好的监控数据写入实时数据流队列。写入后可以在实时数据流管理平台模拟消费,验证数据及格式是否正确。完成监控数据写入实时数据流步骤后,继续验证实时数据流数据是否被消费写入搜索服务平台。实施中需要配置中间件来消费实时数据流队列中的数据,这里定义数据流GroupId为groupid_system_monitor_log。配置完成后,可以在搜索服务平台查看配置的索引及类型下是否有数据被消费写入平台,有数据写入且格式正确则验证完成。In a specific embodiment, monitoring is added to the receipt and storage of commodity basic data of the target commodity service, and the received data is generated into a log and written into the real-time data stream. During specific implementation, a system configuration switch can be added to the receive data method class execute of the abstract class AbstractMessageReceiveService for XML message reception processing, and the specific switch name can be set to log.switch. The switch is a disaster recovery method to control abnormal conditions. Disaster recovery methods such as abnormalities or sharp increases in data volume. Use the switch to realize the analysis of the received message and the conversion of the object format, and then encapsulate it into the message format data for real-time data stream transmission specified by the protocol. Set the transmission object name to MonitorLogDto, including fields: serial number, service type, service code, processing time, number of message items, creation time, abnormal information, message content, etc. The data transmission method is not limited to bytes The form of flow. You can define the real-time data stream as system_monitor_log, write the tool class of production data, and then write the encapsulated monitoring data into the real-time data stream queue. After writing, you can simulate consumption on the real-time data stream management platform to verify whether the data and format are correct. After completing the step of writing monitoring data into the real-time data stream, continue to verify whether the real-time data stream data is consumed and written into the search service platform. In the implementation, you need to configure middleware to consume the data in the real-time data stream queue. Here, the data stream GroupId is defined as groupid_system_monitor_log. After the configuration is completed, you can check the configured index and type on the search service platform to see if there is data written to the platform by consumption, and the verification is complete if there is data written and the format is correct.
验证完上述步骤后,需要基于搜索服务平台开发数据查询接口以及异常数据统计接口,供前端监控页面调用。具体实施时,配置项目工程,采用ElasticSearch(下面简称es)作为搜索服务平台,修改pom.xml配置文件,新增依赖groupId为org.elasticsearch.client,artifactId为transport。在工程中新增工具类包tool,创建es客户端工具类ElasticsearchConfig,配置完集群名称,ip地址及port端口号之后,创建es客户端连接,即可实现了es基本工具类。新建controller包,service包,实现es对监控业务数据接口的分页查询及统计功能。此时用到es客户端jar包提供的 QueryBuilders,包含wildcardQuery模糊查询,termQuery精确查询,boolQuery组合查询,fliter过滤查询等,以及AggregationBuilders,包含sum求和,avg求平均值,count计数,dateHistogram聚合查询等。从监控角度实现了多维度的数据查询和统计功能,前端监控页面验证Spring rest风格设计的controller接口能否正常调用到数据,设计多个接口来完成前端页面展现的数据需要,具体如下(以下接口均支持Get方式的Http请求):After verifying the above steps, it is necessary to develop a data query interface and an abnormal data statistics interface based on the search service platform for the front-end monitoring page to call. During the specific implementation, configure the project project, use ElasticSearch (hereinafter referred to as es) as the search service platform, modify the pom.xml configuration file, and add the dependency groupId to org.elasticsearch.client and artifactId to transport. Add the tool package tool to the project, create the es client tool class ElasticsearchConfig, configure the cluster name, ip address and port port number, and create the es client connection to implement the es basic tool class. Create a new controller package and service package to realize the paging query and statistics function of es on the monitoring business data interface. At this time, the QueryBuilders provided by the es client jar package are used, including wildcardQuery fuzzy query, termQuery precise query, boolQuery combined query, fliter filter query, etc., and AggregationBuilders, including sum sum, avg average, count count, dateHistogram aggregation query Wait. From the monitoring perspective, multi-dimensional data query and statistics functions are realized. The front-end monitoring page verifies whether the controller interface designed in Spring rest style can normally call the data, and multiple interfaces are designed to complete the data needs of the front-end page. The details are as follows (the following interface Both support Http request in Get mode):
queryData,根据入参服务编码及时间范围,查询按时间范围聚合查询es的监控数据;queryData, according to the input service code and time range, query the monitoring data of es by time range aggregation;
queryGroupData,根据入参服务编码及时间范围,查询按时间范围分组查询es的监控数据;queryGroupData, according to the input service code and time range, query the monitoring data of es grouped by time range;
queryTodayData,根据入参服务编码,查询当日监控统计的服务所有数据;queryTodayData, according to the entered service code, query all the service data of the monitoring and statistics of the day;
queryExceptionData,根据入参服务编码,时间范围,分页条件(数据量庞大,支持分页查询),消息关键字,查询监控的服务异常数据。queryExceptionData, according to the input service code, time range, paging condition (large amount of data, support paging query), message keyword, query the monitored service exception data.
在一实施例中,如图6所示,S900之后,还包括步骤:In an embodiment, as shown in FIG. 6, after S900, the method further includes the following steps:
S901:当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据生成数据日志。S901: When the first commodity service data is different from the second commodity service data, generate a data log according to the first service input data.
S903:将数据日志写入搜索服务平台。S903: Write the data log to the search service platform.
S905:通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的所述数据日志,并在前端展示页面展示搜索服务平台中的数据日志。S905: Call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
具体地,数据日志指的是用来做统计分析的数据日志,维度也是具体到各个商品服务维度。监控到第一商品服务数据与第二商品服务数据相同时,数据正常会写入数据库。但做数据统计分析时会存在性能瓶颈(如查询太慢,亿级的服务数据统计分析不出来),因此将数据以日志的形式记录下来,写入实时数据流,让搜索服务平台为结果数据提供检索及统计分析,以便前端监控页面能够更加友好的展示监控结果。因此,使得对目标商品服务的商品服务数据的监控更加精细,有利于提高目标商品服务的商品服务数据的数据处理的时效性。Specifically, the data log refers to the data log used for statistical analysis, and the dimensions are also specific to the dimensions of each commodity and service. When it is monitored that the first commodity service data is the same as the second commodity service data, the data is normally written into the database. However, there will be performance bottlenecks when doing statistical analysis of data (for example, the query is too slow, and the statistical analysis of billion-level service data cannot be obtained), so the data is recorded in the form of logs, written into the real-time data stream, and the search service platform is the result data Provide retrieval and statistical analysis, so that the front-end monitoring page can display the monitoring results more friendly. Therefore, the monitoring of the commodity service data of the target commodity service is more refined, which is beneficial to improve the timeliness of the data processing of the commodity service data of the target commodity service.
应该理解的是,虽然流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,流程图中至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同 一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowchart are displayed in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless specifically stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The order of execution of these sub-steps or stages It is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
在一个实施例中,如图7所示,提供了一种商品服务数据的数据处理装置,包括第一获取模块11、第二获取模块13、第三获取模块15、更新模块17和同步模块19。In one embodiment, as shown in FIG. 7, a data processing device for commodity service data is provided, which includes a first acquisition module 11, a second acquisition module 13, a third acquisition module 15, an update module 17, and a synchronization module 19. .
第一获取模块11,用于从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据。The first obtaining module 11 is configured to obtain the first service entry data of the target commodity service from the full amount of data of the target commodity service.
第二获取模块13,用于根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据。The second obtaining module 13 is configured to obtain the first commodity service data of the target commodity service from the service data of the database according to the first service input data.
第三获取模块15,用于根据第一服务入参数数据从缓存服务数据中获取目标商品服务的第二商品服务数据。The third obtaining module 15 is configured to obtain the second commodity service data of the target commodity service from the cached service data according to the first service input parameter data.
更新模块17,用于当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据,预热表用于存储将数据库的服务数据同步至缓存服务数据时对应的服务入参数据,第二服务入参数据为预热表中第二商品服务数据对应的服务入参数据。The update module 17 is used to update the second service input parameter data in the warm-up table of the target merchandise service according to the first service input parameter data when the first commodity service data is different from the second commodity service data. To store the corresponding service input parameter data when synchronizing the service data of the database to the cache service data, the second service input parameter data is the service input parameter data corresponding to the second commodity service data in the warm-up table.
同步模块19,用于根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据。The synchronization module 19 is configured to synchronize the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service input data in the preheating table.
在其中一个实施例中,第一服务入参数据为多个,第二获取模块13可以包括(图7未示出):In one of the embodiments, there are multiple input parameter data for the first service, and the second acquiring module 13 may include (not shown in FIG. 7):
第二获取单元,用于分别根据各第一服务入参数据从数据库的服务数据中获取多个第一商品服务数据。The second obtaining unit is configured to obtain a plurality of first commodity service data from the service data of the database according to the respective first service input data.
第三获取模块15,包括:The third acquisition module 15 includes:
第三获取单元,用于分别根据各第一服务入参数从缓存服务数据中获取目标商品服务的多个第二商品服务数据。The third obtaining unit is configured to obtain multiple second commodity service data of the target commodity service from the cached service data according to the respective first service input parameters.
更新模块17,包括: Update module 17, including:
更新单元,用于当多个第一服务入参数中任一第一服务入参数对应的第一商品服务数据与第二商品服务数据不相同时,根据任一第一服务入参数更新目标商品服务的预热表中对应的第二服务入参数据。The updating unit is configured to update the target commodity service according to any one of the first service input parameters when the first commodity service data corresponding to any one of the first service input parameters is different from the second commodity service data The corresponding second service input parameter data in the warm-up table of.
在其中一个实施例中,同步模块19,包括(图7未示出):In one of the embodiments, the synchronization module 19 includes (not shown in Fig. 7):
读取单元,用于按照预设周期读取预热表中更新的第二服务入参数据。The reading unit is configured to read the updated second service input parameter data in the warm-up table according to a preset period.
更新单元,用于根据读取到的第二服务入参数据将数据库的服务数据同步至缓存服务数据。The update unit is used to synchronize the service data of the database to the cache service data according to the read second service input parameter data.
在其中一个实施例中,一种商品服务数据的数据处理装置可以包括(图7未示出):In one of the embodiments, a data processing device for commodity service data may include (not shown in Fig. 7):
第四获取模块,用于获取目标商品服务的增量数据。The fourth acquiring module is used to acquire incremental data of the target commodity service.
第五获取模块,用于从增量数据中获取目标商品服务的第三服务入参数据。The fifth acquiring module is used to acquire the third service entry data of the target commodity service from the incremental data.
第六获取模块,用于根据第三服务入参数据从数据库的服务数据中获取目标商品服务的第三商品服务数据,以及根据第三服务入参数从缓存服务数据中获取目标商品服务的第四商品服务数据。The sixth obtaining module is used to obtain the third commodity service data of the target commodity service from the service data of the database according to the third service input parameter data, and obtain the fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter Commodity service data.
更换模块,用于当第三商品服务数据与第四商品服务数据不相同时,根据第三服务入参数据更新目标商品服务的预热表中的第四服务入参数据,第四服务入参为预热表中第四商品服务数据对应的服务入参。The replacement module is used to update the fourth service entry data in the warm-up table of the target product service according to the third service entry data when the third product service data is different from the fourth product service data. Enter the service parameter corresponding to the fourth commodity service data in the warm-up table.
预热模块,用于根据预热表中更新后的第四服务入参将数据库的服务数据同步至缓存服务数据。The preheating module is used for synchronizing the service data of the database to the cached service data according to the updated fourth service entry in the preheating table.
在其中一个实施例中,第四获取模块可以包括(图7未示出):In one of the embodiments, the fourth acquiring module may include (not shown in FIG. 7):
创建单元,用于根据目标商品服务的商品服务数据的更新时间创建滑动时间窗口;The creation unit is used to create a sliding time window according to the update time of the commodity service data of the target commodity service;
第四获取单元,用于通过滑动时间窗口从存储目标商品服务的商品数据中获取增量数据。The fourth acquiring unit is configured to acquire incremental data from the product data of the stored target product service through a sliding time window.
在其中一个实施例中,一种商品服务数据的数据处理装置可以包括(图7未示出):In one of the embodiments, a data processing device for commodity service data may include (not shown in Fig. 7):
缓存模块,用于将缓存服务数据写入搜索服务平台。The cache module is used to write cache service data into the search service platform.
开发模块,用于开发搜索服务平台的数据查询接口和异常数据统计接口。The development module is used to develop the data query interface and abnormal data statistics interface of the search service platform.
第一展示模块,用于通过前端展示页面调用所述数据查询接口,以通过数据查询接口查询搜索服务平台中的商品服务数据,并在前端展示页面展示搜索服务平台中的商品服务数据。The first display module is configured to call the data query interface through the front-end display page to query the product service data in the search service platform through the data query interface, and display the product service data in the search service platform on the front-end display page.
第二展示模块,用于通过前端展示页面调用异常数据统计接口,以通过异常数据统计接口查询搜索服务平台中统计出的异常商品服务数据,并在前端展示页面展示搜索服务平台中统计出的异常商品服务数据。The second display module is used to call the abnormal data statistics interface through the front-end display page to query the abnormal commodity service data counted in the search service platform through the abnormal data statistics interface, and display the abnormality counted in the search service platform on the front-end display page Commodity service data.
在其中一个实施例中,一种商品服务数据的数据处理装置可以包括(图7未示出):In one of the embodiments, a data processing device for commodity service data may include (not shown in Fig. 7):
生成模块,用于当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据生成数据日志。The generating module is used to generate a data log according to the first service input data when the first commodity service data is different from the second commodity service data.
写入模块,用于将数据日志写入搜索服务平台。The writing module is used to write the data log to the search service platform.
第三展示模块,用于通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的数据日志,并在前端展示页面展示搜索服务平台中的数据日志。The third display module is used to call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
关于一种商品服务数据的数据处理装置的具体限定可以参见上文中对于一种商品服务数据的数据处理方法的限定,在此不再赘述。上述一种商品服务数据的数据处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of a data processing device for commodity service data, please refer to the above definition of a data processing method for commodity service data, which will not be repeated here. Each module in the above-mentioned data processing device for commodity service data can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图8所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储目标商品服务的相关数据,如服务入参数据等。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种商品服务数据的数据处理方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 8. The computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store relevant data of the target commodity service, such as service entry data. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to realize a data processing method of commodity service data.
本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer program:
从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据;根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据;根据第一服务入参数数据从缓存服务数据中获取目标商品服务的第二商品服务数据;当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据,预热表用于存储将数据库的服务数据同步至缓存服务数据时对应的服务入参数据,第二服务入参数据为预热表中第二商品服务数据对应的服务入参数据;根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据。Obtain the first service entry data of the target product service from the full data of the target product service; obtain the first product service data of the target product service from the service data of the database according to the first service entry data; According to the first service entry parameter The data obtains the second commodity service data of the target commodity service from the cached service data; when the first commodity service data is not the same as the second commodity service data, update the warm-up table of the target commodity service according to the first service input data The second service input parameter data, the warm-up table is used to store the corresponding service input parameter data when the service data of the database is synchronized to the cache service data, and the second service input parameter data is the service corresponding to the second commodity service data in the warm-up table Input parameter data; according to the updated second service input parameter data in the warm-up table, the service data of the database corresponding to the target commodity service is synchronized to the cache service data.
在一个实施例中,第一服务入参数据为多个,处理器执行计算机程序实现上述的 根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据步骤时,具体实现以下步骤:分别根据各第一服务入参数据从数据库的服务数据中获取多个第一商品服务数据;处理器执行计算机程序实现上述的根据第一服务入参数从缓存服务数据中获取目标商品服务的第二商品服务数据步骤时,具体实现以下步骤:分别根据各第一服务入参数从缓存服务数据中获取目标商品服务的多个第二商品服务数据;处理器执行计算机程序实现上述的当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据步骤时,具体实现以下步骤:当多个第一服务入参数中任一第一服务入参数对应的第一商品服务数据与第二商品服务数据不相同时,根据任一第一服务入参数更新目标商品服务的预热表中对应的第二服务入参数据。In an embodiment, there are multiple first service input parameter data, and when the processor executes the computer program to implement the above-mentioned step of obtaining the first product service data of the target product service from the service data of the database according to the first service input parameter data, The following steps are specifically implemented: obtaining multiple first commodity service data from the service data in the database according to each first service input parameter data; the processor executes the computer program to realize the above-mentioned obtaining target from the cache service data according to the first service input parameter In the second commodity service data step of commodity service, the following steps are specifically implemented: obtain multiple second commodity service data of the target commodity service from the cached service data according to each first service input parameter; the processor executes the computer program to realize the above When the first commodity service data is different from the second commodity service data, when the second service entry data step in the warm-up table of the target commodity service is updated according to the first service entry data, the following steps are specifically implemented: When the first product service data corresponding to any one of the first service input parameters in the first service input parameter is different from the second product service data, the corresponding first product service data in the warm-up table of the target product service is updated according to any first service input parameter. 2. Service entry data.
在一个实施例中,处理器执行计算机程序实现上述的根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据步骤时,具体实现以下步骤:按照预设周期读取预热表中更新的第二服务入参数据;根据读取到的第二服务入参数据将数据库的服务数据同步至缓存服务数据。In one embodiment, when the processor executes the computer program to realize the step of synchronizing the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table, the following steps are specifically implemented : Read the updated second service input parameter data in the warm-up table according to the preset period; synchronize the service data of the database to the cache service data according to the read second service input parameter data.
在一个实施例中,处理器执行计算机程序实现以下步骤:获取目标商品服务的增量数据;从增量数据中获取目标商品服务的第三服务入参数据;根据第三服务入参数据从数据库的服务数据中获取目标商品服务的第三商品服务数据,以及根据第三服务入参数从缓存服务数据中获取目标商品服务的第四商品服务数据;当第三商品服务数据与第四商品服务数据不相同时,根据第三服务入参数据更新目标商品服务的预热表中的第四服务入参数据,第四服务入参为预热表中第四商品服务数据对应的服务入参;根据预热表中更新后的第四服务入参将数据库的服务数据同步至缓存服务数据。In one embodiment, the processor executes the computer program to implement the following steps: obtain incremental data of the target commodity service; obtain the third service entry data of the target commodity service from the incremental data; obtain the third service entry data from the database according to the third service entry data Obtain the third commodity service data of the target commodity service from the service data, and obtain the fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter; when the third commodity service data and the fourth commodity service data When they are not the same, update the fourth service entry data in the warm-up table of the target product service according to the third service entry data, and the fourth service entry is the service entry corresponding to the fourth product service data in the warm-up table; The updated fourth service entry in the warm-up table synchronizes the service data of the database to the cache service data.
在一个实施例中,处理器执行计算机程序实现上述的获取目标商品服务的增量数据步骤时,具体实现以下步骤:根据目标商品服务的商品服务数据的更新时间创建滑动时间窗口;通过滑动时间窗口从存储目标商品服务的商品数据中获取增量数据。In one embodiment, when the processor executes the computer program to implement the above step of obtaining the incremental data of the target commodity service, it specifically implements the following steps: creating a sliding time window according to the update time of the commodity service data of the target commodity service; using the sliding time window Obtain incremental data from the product data of the storage target product service.
在一个实施例中,处理器执行计算机程序实现以下步骤:将缓存服务数据写入搜索服务平台;开发搜索服务平台的数据查询接口和异常数据统计接口;通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的商品服务数据,并在前端展示页面展示搜索服务平台中的商品服务数据;通过前端展示页面调用异常数据统计接口,以通过异常数据统计接口查询搜索服务平台中统计出的异常商品服务数据,并在前端展示页面展示搜索服务平台中统计出的异常商品服务数据。In one embodiment, the processor executes the computer program to implement the following steps: write cache service data into the search service platform; develop the data query interface and abnormal data statistics interface of the search service platform; call the data query interface through the front-end display page to pass The data query interface queries the product service data in the search service platform, and displays the product service data in the search service platform on the front-end display page; calls the abnormal data statistics interface through the front-end display page to query the statistics in the search service platform through the abnormal data statistics interface The abnormal commodity and service data that is generated, and the abnormal commodity and service data counted in the search service platform are displayed on the front-end display page.
在一个实施例中,处理器执行计算机程序实现以下步骤:当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据生成数据日志;将数据日志写入所述搜索服务平台;通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的数据日志,并在前端展示页面展示所述搜索服务平台中的数据日志。In one embodiment, the processor executes the computer program to implement the following steps: when the first commodity service data is different from the second commodity service data, generate a data log according to the first service input data; write the data log into the search Service platform: call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述任一实施例所述的一种商品服务数据的数据处理方法。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the data processing method for commodity service data described in any of the above embodiments is implemented.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
从目标商品服务的全量数据中获取目标商品服务的第一服务入参数据;根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据;根据第一服务入参数数据从缓存服务数据中获取目标商品服务的第二商品服务数据;当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据,预热表用于存储将数据库的服务数据同步至缓存服务数据时对应的服务入参数据,第二服务入参数据为预热表中第二商品服务数据对应的服务入参数据;根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据。Obtain the first service entry data of the target product service from the full data of the target product service; obtain the first product service data of the target product service from the service data of the database according to the first service entry data; According to the first service entry parameter The data obtains the second commodity service data of the target commodity service from the cached service data; when the first commodity service data is not the same as the second commodity service data, update the warm-up table of the target commodity service according to the first service input data The second service input parameter data, the warm-up table is used to store the corresponding service input parameter data when the service data of the database is synchronized to the cache service data, and the second service input parameter data is the service corresponding to the second commodity service data in the warm-up table Input parameter data; according to the updated second service input parameter data in the warm-up table, the service data of the database corresponding to the target commodity service is synchronized to the cache service data.
在一个实施例中,第一服务入参数据为多个,计算机程序被处理器执行实现上述的根据第一服务入参数据从数据库的服务数据中获取目标商品服务的第一商品服务数据步骤时,具体实现以下步骤:分别根据各第一服务入参数据从数据库的服务数据中获取多个第一商品服务数据;计算机程序被处理器执行实现上述的根据第一服务入参数从缓存服务数据中获取目标商品服务的第二商品服务数据步骤时,具体实现以下步骤:分别根据各第一服务入参数从缓存服务数据中获取目标商品服务的多个第二商品服务数据;计算机程序被处理器执行实现上述的当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据更新目标商品服务的预热表中的第二服务入参数据步骤时,具体实现以下步骤:当多个第一服务入参数中任一第一服务入参数对应的第一商品服务数据与第二商品服务数据不相同时,根据任一第一服务入参数更新目标商品服务的预热表中对应的第二服务入参数据。In one embodiment, there are multiple first service input parameter data, and the computer program is executed by the processor to realize the above-mentioned step of obtaining the first product service data of the target product service from the service data of the database according to the first service input parameter data. , Specifically implement the following steps: obtain a plurality of first commodity service data from the service data of the database according to each first service input parameter data; the computer program is executed by the processor to realize the above-mentioned cached service data according to the first service input parameter In the step of obtaining the second commodity service data of the target commodity service, the following steps are specifically implemented: obtaining multiple second commodity service data of the target commodity service from the cached service data according to each first service input parameter; the computer program is executed by the processor When the above-mentioned step of updating the second service entry data in the warm-up table of the target product service according to the first service entry data when the first product service data is different from the second product service data is implemented, the following steps are specifically implemented: When the first product service data corresponding to any one of the first service input parameters in the multiple first service input parameters is different from the second product service data, update the warm-up table of the target product service according to any of the first service input parameters The corresponding input parameter data of the second service.
在一个实施例中,计算机程序被处理器执行实现上述的根据预热表中更新后的第二服务入参数据将目标商品服务对应的数据库的服务数据同步至缓存服务数据步骤 时,具体实现以下步骤:按照预设周期读取预热表中更新的第二服务入参数据;根据读取到的第二服务入参数据将数据库的服务数据同步至缓存服务数据。In one embodiment, when the computer program is executed by the processor to realize the step of synchronizing the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service input parameter data in the warm-up table, the following is specifically realized Steps: reading the updated second service input parameter data in the warm-up table according to the preset period; and synchronizing the service data of the database to the cache service data according to the read second service input parameter data.
在一个实施例中,计算机程序被处理器执行实现以下步骤:获取目标商品服务的增量数据;从增量数据中获取目标商品服务的第三服务入参数据;根据第三服务入参数据从数据库的服务数据中获取目标商品服务的第三商品服务数据,以及根据第三服务入参数从缓存服务数据中获取目标商品服务的第四商品服务数据;当第三商品服务数据与第四商品服务数据不相同时,根据第三服务入参数据更新目标商品服务的预热表中的第四服务入参数据,第四服务入参为预热表中第四商品服务数据对应的服务入参;根据预热表中更新后的第四服务入参将数据库的服务数据同步至缓存服务数据。In one embodiment, the computer program is executed by the processor to achieve the following steps: obtain incremental data of the target commodity service; obtain the third service entry data of the target commodity service from the incremental data; Obtain the third commodity service data of the target commodity service from the service data of the database, and obtain the fourth commodity service data of the target commodity service from the cached service data according to the third service input parameter; when the third commodity service data and the fourth commodity service data When the data is not the same, update the fourth service entry data in the warm-up table of the target product service according to the third service entry data, and the fourth service entry is the service entry corresponding to the fourth product service data in the warm-up table; The service data of the database is synchronized to the cache service data according to the updated fourth service entry in the warm-up table.
在一个实施例中,计算机程序被处理器执行实现上述的获取目标商品服务的增量数据步骤时,具体实现以下步骤:根据目标商品服务的商品服务数据的更新时间创建滑动时间窗口;通过滑动时间窗口从存储目标商品服务的商品数据中获取增量数据。In one embodiment, when the computer program is executed by the processor to achieve the above step of obtaining the incremental data of the target commodity service, the following steps are specifically implemented: creating a sliding time window according to the update time of the commodity service data of the target commodity service; The window obtains incremental data from the product data of the stored target product service.
在一个实施例中,计算机程序被处理器执行实现以下步骤:将缓存服务数据写入搜索服务平台;开发搜索服务平台的数据查询接口和异常数据统计接口;通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的商品服务数据,并在前端展示页面展示搜索服务平台中的商品服务数据;通过前端展示页面调用异常数据统计接口,以通过异常数据统计接口查询搜索服务平台中统计出的异常商品服务数据,并在前端展示页面展示搜索服务平台中统计出的异常商品服务数据。In one embodiment, the computer program is executed by the processor to implement the following steps: write cache service data into the search service platform; develop the data query interface and abnormal data statistics interface of the search service platform; call the data query interface through the front-end display page to Query the product service data in the search service platform through the data query interface, and display the product service data in the search service platform on the front-end display page; call the abnormal data statistics interface through the front-end display page to query the search service platform through the abnormal data statistics interface Statistics of abnormal commodity and service data, and display the abnormal commodity and service data counted in the search service platform on the front-end display page.
在一个实施例中,计算机程序被处理器执行实现以下步骤:当第一商品服务数据与第二商品服务数据不相同时,根据第一服务入参数据生成数据日志;将数据日志写入所述搜索服务平台;通过前端展示页面调用数据查询接口,以通过数据查询接口查询搜索服务平台中的数据日志,并在前端展示页面展示所述搜索服务平台中的数据日志。In one embodiment, the computer program is executed by the processor to implement the following steps: when the first commodity service data is different from the second commodity service data, generate a data log according to the first service input data; write the data log to the Search service platform; call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高 速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage. In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database, or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered as the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.

Claims (10)

  1. 一种商品服务数据的数据处理方法,所述方法包括:A data processing method for commodity service data, the method comprising:
    从目标商品服务的全量数据中获取所述目标商品服务的第一服务入参数据;Acquiring the first service entry data of the target commodity service from the full data of the target commodity service;
    根据所述第一服务入参数据从数据库的服务数据中获取所述目标商品服务的第一商品服务数据;Acquiring the first commodity service data of the target commodity service from the service data of the database according to the first service entry data;
    根据所述第一服务入参数数据从缓存服务数据中获取所述目标商品服务的第二商品服务数据;Acquiring second commodity service data of the target commodity service from cached service data according to the first service entry parameter data;
    当所述第一商品服务数据与所述第二商品服务数据不相同时,根据所述第一服务入参数据更新所述目标商品服务的预热表中的第二服务入参数据,所述预热表用于存储将所述数据库的服务数据同步至所述缓存服务数据时对应的服务入参数据,所述第二服务入参数据为所述预热表中所述第二商品服务数据对应的服务入参数据;When the first commodity service data is different from the second commodity service data, update the second service entry data in the warm-up table of the target commodity service according to the first service entry data, and the The warm-up table is used to store the corresponding service input parameter data when the service data of the database is synchronized to the cached service data, and the second service input parameter data is the second commodity service data in the warm-up table Corresponding service entry data;
    根据所述预热表中更新后的所述第二服务入参数据将所述目标商品服务对应的数据库的服务数据同步至所述缓存服务数据。Synchronizing the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service entry data in the warm-up table.
  2. 根据权利要求1所述的方法,其特征在于,所述第一服务入参数据为多个,所述根据所述第一服务入参数据从数据库的服务数据中获取所述目标商品服务的第一商品服务数据,包括:The method according to claim 1, wherein the first service entry data is multiple, and the first service entry data of the target commodity service is obtained from the service data of the database according to the first service entry data. 1. Commodity and service data, including:
    分别根据各所述第一服务入参数据从所述数据库的服务数据中获取多个第一商品服务数据;Acquiring a plurality of first commodity service data from the service data of the database according to each of the first service input data;
    所述根据所述第一服务入参数从缓存服务数据中获取所述目标商品服务的第二商品服务数据,包括:The obtaining the second commodity service data of the target commodity service from cached service data according to the first service input parameter includes:
    分别根据各所述第一服务入参数从缓存服务数据中获取所述目标商品服务的多个第二商品服务数据;Acquiring a plurality of second commodity service data of the target commodity service from cached service data according to each of the first service input parameters;
    所述当所述第一商品服务数据与所述第二商品服务数据不相同时,根据所述第一服务入参数据更新所述目标商品服务的预热表中的第二服务入参数据,包括:When the first commodity service data is different from the second commodity service data, updating the second service entry data in the warm-up table of the target commodity service according to the first service entry data, include:
    当多个所述第一服务入参数中任一所述第一服务入参数对应的所述第一商品服务数据与所述第二商品服务数据不相同时,根据所述任一所述第一服务入参数更新所述目标商品服务的预热表中对应的第二服务入参数据。When the first product service data corresponding to any one of the first service input parameters among the plurality of first service input parameters is different from the second product service data, according to any one of the first service input parameters The service input parameter updates the corresponding second service input parameter data in the warm-up table of the target commodity service.
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述预热表中更新后的所述第二服务入参数据将所述目标商品服务对应的数据库的服务数据同步至所述缓存服务数据,包括;The method according to claim 1, wherein the service data of the database corresponding to the target commodity service is synchronized to the cache according to the updated second service entry data in the warm-up table Service data, including;
    按照预设周期读取所述预热表中更新的第二服务入参数据;Read the updated second service input parameter data in the warm-up table according to a preset period;
    根据读取到的第二服务入参数据将所述数据库的服务数据同步至所述缓存服务数据。Synchronize the service data of the database to the cache service data according to the read second service input parameter data.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    获取所述目标商品服务的增量数据;Acquiring incremental data of the target commodity service;
    从所述增量数据中获取所述目标商品服务的第三服务入参数据;Acquiring the third service entry data of the target commodity service from the incremental data;
    根据所述第三服务入参数据从所述数据库的服务数据中获取所述目标商品服务的第三商品服务数据,以及根据所述第三服务入参数从所述缓存服务数据中获取所述目标商品服务的第四商品服务数据;Obtain the third commodity service data of the target commodity service from the service data of the database according to the third service input parameter data, and obtain the target from the cache service data according to the third service input parameter The fourth commodity service data of commodity service;
    当所述第三商品服务数据与所述第四商品服务数据不相同时,根据所述第三服务入参数据更新所述目标商品服务的预热表中的第四服务入参数据,所述第四服务入参为所述预热表中所述第四商品服务数据对应的服务入参;When the third commodity service data is different from the fourth commodity service data, the fourth service entry data in the warm-up table of the target commodity service is updated according to the third service entry data, and the The fourth service entry is the service entry corresponding to the fourth commodity service data in the warm-up table;
    根据所述预热表中更新后的所述第四服务入参将所述数据库的服务数据同步至所述缓存服务数据。Synchronizing the service data of the database to the cache service data according to the updated fourth service entry in the warm-up table.
  5. 根据权利要求4所述的方法,其特征在于,所述获取所述目标商品服务的增量数据,包括:The method according to claim 4, wherein said acquiring incremental data of said target commodity service comprises:
    根据所述目标商品服务的商品服务数据的更新时间创建滑动时间窗口;Creating a sliding time window according to the update time of the commodity service data of the target commodity service;
    通过滑动时间窗口从存储所述目标商品服务的商品数据中获取所述增量数据。The incremental data is obtained from the product data of the stored target product service through a sliding time window.
  6. 根据权利要求1至4任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    将所述缓存服务数据写入搜索服务平台;Writing the cache service data to the search service platform;
    开发所述搜索服务平台的数据查询接口和异常数据统计接口;Develop the data query interface and abnormal data statistics interface of the search service platform;
    通过前端展示页面调用所述数据查询接口,以通过所述数据查询接口查询所述搜索服务平台中的商品服务数据,并在所述前端展示页面展示所述搜索服务平台中的商品服务数据;Calling the data query interface through the front-end display page to query the product service data in the search service platform through the data query interface, and display the product service data in the search service platform on the front-end display page;
    通过前端展示页面调用所述异常数据统计接口,以通过所述异常数据统计接口查询所述搜索服务平台中统计出的异常商品服务数据,并在所述前端展示页面展示所述搜索服务平台中统计出的异常商品服务数据。Call the abnormal data statistics interface through the front-end display page to query the abnormal commodity service data counted in the search service platform through the abnormal data statistics interface, and display the statistics in the search service platform on the front-end display page Abnormal commodity service data.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    当所述第一商品服务数据与所述第二商品服务数据不相同时,根据所述第一服务入参数据生成数据日志;When the first commodity service data is different from the second commodity service data, generating a data log according to the first service entry data;
    将所述数据日志写入所述搜索服务平台;Writing the data log to the search service platform;
    通过前端展示页面调用所述数据查询接口,以通过所述数据查询接口查询所述搜索服务平台中的所述数据日志,并在所述前端展示页面展示所述搜索服务平台中的所述数据日志。Call the data query interface through the front-end display page to query the data log in the search service platform through the data query interface, and display the data log in the search service platform on the front-end display page .
  8. 一种商品服务数据的数据处理装置,其特征在于,所述装置包括:A data processing device for commodity service data, characterized in that the device comprises:
    第一获取模块,用于从目标商品服务的全量数据中获取所述目标商品服务的第一服务入参数据;The first obtaining module is configured to obtain the first service entry data of the target commodity service from the full data of the target commodity service;
    第二获取模块,用于根据所述第一服务入参数据从数据库的服务数据中获取所述目标商品服务的第一商品服务数据;The second obtaining module is configured to obtain the first commodity service data of the target commodity service from the service data of the database according to the first service entry data;
    第三获取模块,用于根据所述第一服务入参数数据从缓存服务数据中获取所述目标商品服务的第二商品服务数据;The third obtaining module is configured to obtain the second commodity service data of the target commodity service from the cached service data according to the first service input parameter data;
    更新模块,用于当所述第一商品服务数据与所述第二商品服务数据不相同时,根据所述第一服务入参数据更新所述目标商品服务的预热表中的第二服务入参数据,所述预热表用于存储将所述数据库的服务数据同步至所述缓存服务数据时对应的服务入参数据,所述第二服务入参数据为所述预热表中所述第二商品服务数据对应的服务入参数据;The update module is configured to update the second service entry in the warm-up table of the target product service according to the first service entry data when the first product service data is different from the second product service data Parameter data, the warm-up table is used to store the corresponding service input parameter data when synchronizing the service data of the database to the cached service data, and the second service input parameter data is the one in the warm-up table Service entry data corresponding to the second commodity service data;
    同步模块,用于根据所述预热表中更新后的所述第二服务入参数据将所述目标商品服务对应的数据库的服务数据同步至所述缓存服务数据。The synchronization module is configured to synchronize the service data of the database corresponding to the target commodity service to the cache service data according to the updated second service input data in the warm-up table.
  9. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至7中任一项所述方法的步骤。A computer device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor implements any one of claims 1 to 7 when the computer program is executed The steps of the method.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method according to any one of claims 1 to 7 when the computer program is executed by a processor.
PCT/CN2020/096997 2020-04-14 2020-06-19 Data processing method and apparatus, and computer device and storage medium WO2021208228A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CA3177218A CA3177218A1 (en) 2020-04-14 2020-06-19 Data processing method, device, computer equipment, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010287873.0 2020-04-14
CN202010287873.0A CN111222089B (en) 2020-04-14 2020-04-14 Data processing method, data processing device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021208228A1 true WO2021208228A1 (en) 2021-10-21

Family

ID=70830097

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/096997 WO2021208228A1 (en) 2020-04-14 2020-06-19 Data processing method and apparatus, and computer device and storage medium

Country Status (3)

Country Link
CN (1) CN111222089B (en)
CA (1) CA3177218A1 (en)
WO (1) WO2021208228A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080662A (en) * 2022-06-21 2022-09-20 浙江网商银行股份有限公司 Database switching method and device
CN115460227A (en) * 2022-11-14 2022-12-09 成都怡康科技有限公司 Method, device and system for synchronizing data, computer equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111222089B (en) * 2020-04-14 2020-07-31 苏宁云计算有限公司 Data processing method, data processing device, computer equipment and storage medium
CN112783901B (en) * 2021-03-01 2023-09-01 合沃物联技术(南京)有限公司 Internet of things time sequence big data processing method based on Internet of things middleware

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464895A (en) * 2009-01-21 2009-06-24 阿里巴巴集团控股有限公司 Method, system and apparatus for updating internal memory data
US20150058302A1 (en) * 2013-08-23 2015-02-26 Cisco Technology, Inc. Addressing cache coherence in updates to a shared database in a network environment
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system
CN110753099A (en) * 2019-10-12 2020-02-04 平安健康保险股份有限公司 Distributed cache system and cache data updating method
CN111222089A (en) * 2020-04-14 2020-06-02 苏宁云计算有限公司 Data processing method, data processing device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331986B (en) * 2010-07-12 2014-07-16 阿里巴巴集团控股有限公司 Database cache management method and database server
CN102244900B (en) * 2011-07-15 2014-01-22 上海华为技术有限公司 Method, device and system for synchronizing cached data heat value, and distributed caching method
CN108418851B (en) * 2018-01-12 2020-12-04 创新先进技术有限公司 Policy issuing system, method, device and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101464895A (en) * 2009-01-21 2009-06-24 阿里巴巴集团控股有限公司 Method, system and apparatus for updating internal memory data
US20150058302A1 (en) * 2013-08-23 2015-02-26 Cisco Technology, Inc. Addressing cache coherence in updates to a shared database in a network environment
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system
CN110753099A (en) * 2019-10-12 2020-02-04 平安健康保险股份有限公司 Distributed cache system and cache data updating method
CN111222089A (en) * 2020-04-14 2020-06-02 苏宁云计算有限公司 Data processing method, data processing device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080662A (en) * 2022-06-21 2022-09-20 浙江网商银行股份有限公司 Database switching method and device
CN115460227A (en) * 2022-11-14 2022-12-09 成都怡康科技有限公司 Method, device and system for synchronizing data, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111222089A (en) 2020-06-02
CA3177218A1 (en) 2021-10-21
CN111222089B (en) 2020-07-31

Similar Documents

Publication Publication Date Title
WO2021208228A1 (en) Data processing method and apparatus, and computer device and storage medium
US11249994B2 (en) Query task processing based on memory allocation and performance criteria
JP7453286B2 (en) Dynamic execution of parameterized applications that process keyed network data streams
US9519700B2 (en) Automatically synchronizing production data of a source system and a target system
US10956422B2 (en) Integrating event processing with map-reduce
WO2018178641A1 (en) Data replication system
AU2010232791B2 (en) Employing user-context in connection with backup or restore of data
US8577959B2 (en) Managing recurring appointments
CN109960560B (en) Index processing method and system
CN107463610B (en) Data warehousing method and device
WO2019047540A1 (en) Transaction data processing method and apparatus, storage medium, and computer device
CN115374102A (en) Data processing method and system
CN114416891B (en) Method, system, apparatus and medium for data processing in a knowledge graph
WO2022237506A1 (en) Method, apparatus, and device for monitoring online diagnosis service, and storage medium
US10545988B2 (en) System and method for data synchronization using revision control
US20130031050A1 (en) System, Method, and Computer Program Product for Accessing Manipulating Remote Datasets
CN114385760A (en) Method and device for real-time synchronization of incremental data, computer equipment and storage medium
CN114328759A (en) Data construction and management method and terminal of data warehouse
US20220044144A1 (en) Real time model cascades and derived feature hierarchy
CN113094406A (en) Power marketing data management method and system
CN112905676A (en) Data file importing method and device
US11372838B2 (en) Parallel processing of changes in a distributed system
CN114490865A (en) Database synchronization method, device, equipment and computer storage medium
CN111522729A (en) Method, device and system for determining rule release
CN112511493B (en) Service data message processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20931023

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 3177218

Country of ref document: CA

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20931023

Country of ref document: EP

Kind code of ref document: A1