Retrospective data storage method, device and computer equipment

By writing the traceback data server to the local disk and sending incremental logs to the message queue, it solves the problem of slow storage and retrieval of massive traceback data in insurance transactions, achieves fast reporting and real-time retrieval, reduces storage costs, and supports large-scale Data processing at scale.

CN115348160BActive Publication Date: 2024-09-27SHENZHEN HAND BACK TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210829799.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-15
Publication Date
2024-09-27
Estimated Expiration
2042-07-15

AI Technical Summary

Technical Problem

Existing technology cannot meet the needs for fast storage and real-time retrieval of massive retrospective data generated during insurance transactions. The database has problems such as limited capacity, high maintenance costs, and slow retrieval speed when storing massive data.

Method used

By determining multiple service nodes on the backtracking data server to receive the data to be stored, and writing it to the log file on the local disk, the incremental log is monitored and sent to the message queue. The message queue is used to retrieve the data from the remote database. Subscribe to the object storage server for storage to achieve distributed storage and real-time retrieval of data.

Benefits of technology

It achieves rapid reporting and real-time retrieval of traceback data, reduces storage costs, and dynamically scales the number of service nodes through the container cluster management system, avoiding dependence on external conditions and supporting rapid storage and long-term storage of large-scale traceback data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115348160B
    Figure CN115348160B
Patent Text Reader

Abstract

The embodiment of the present application is applicable to the field of data storage technology, and provides a retrospective data storage method, device and computer equipment, which can be applied to the retrospective data service end, including: determining multiple service nodes; receiving the retrospective data to be stored through multiple service nodes; writing the retrospective data to be stored into the log file of the local disk; when the incremental log is detected in the log file, the incremental log is sent to the message queue, and the message queue is used to be subscribed by the remote retrieval database and object storage server to store the incremental log in the retrieval database and the object storage server. The above method can realize the rapid upload of retrospective data, and ensure the high availability of retrospective data, meeting the demand for real-time retrieval of retrospective data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application belong to the field of data storage technology, and in particular, relate to a method, device, and computer equipment for backtracking data storage. Background Art

[0002] In the process of online insurance transactions, in order to protect the interests of users and resolve transaction disputes, the website front end will record the interaction data of users during the use of the website for retrospective interaction. The recorded data is the retrospective data. The style change information stored in the retrospective data can be played back on the server to form a retrospective video. The generated retrospective video can be used to resolve transaction disputes, guide transactions online on the same screen, and other scenarios. Therefore, there are certain requirements for the rapid upload and real-time query of retrospective data.

[0003] In the prior art, retrospective data is mostly stored directly in a database, but the database has problems such as limited capacity, high maintenance cost, and slow retrieval speed when storing massive data. Using a database for storage cannot meet the needs of fast storage and real-time retrieval of the massive retrospective data generated during insurance transactions. Summary of the invention

[0004] In view of this, the embodiments of the present application provide a retrospective data storage method, apparatus and computer equipment to meet the needs of rapid storage and real-time retrieval of massive retrospective data generated during insurance transactions.

[0005] A first aspect of an embodiment of the present application provides a retrospective data storage method, which is applied to a retrospective data service end. The method includes:

[0006] Determine multiple service nodes;

[0007] Receiving the backtracking data to be stored through the plurality of service nodes;

[0008] Writing the backtracking data to be stored into a log file on a local disk;

[0009] When it is monitored that there is an incremental log in the log file, the incremental log is sent to a message queue, and the message queue is used to be subscribed by a remote retrieval database and an object storage server to store the incremental log in the retrieval database and the object storage server.

[0010] A second aspect of an embodiment of the present application provides a method for storing traceback data, which is applied to a retrieval database, and the method includes:

[0011] Subscribe to a message queue, where the message queue is associated with a remote backtracking data server;

[0012] If there is an incremental log in the message queue, the incremental log is obtained and stored. The incremental log is sent to the message queue by the backtracking data server when the incremental log exists in the log file of the local disk monitored;

[0013] The historical data in the retrieval database is cleared periodically.

[0014] A third aspect of an embodiment of the present application provides a retrospective data storage method, which is applied to an object storage server, and the method includes:

[0015] Subscribe to a message queue, where the message queue is associated with a remote backtracking data server;

[0016] If there is an incremental log in the message queue, the incremental log is obtained and compressed. The incremental log is sent to the message queue by the backtracking data server when the incremental log exists in the log file of the local disk monitored by the backtracking data server.

[0017] Storing the compressed incremental log;

[0018] The stored incremental log is written to the physical disk.

[0019] A fourth aspect of the embodiments of the present application provides a retrospective data storage device, which is applied to a retrospective data service end, and the device includes:

[0020] A service node determination module, used to determine multiple service nodes;

[0021] A backtracking data receiving module, used for receiving the backtracking data to be stored through a plurality of the service nodes;

[0022] A backtracking data cache module, used to write the backtracking data to be stored into a log file on a local disk;

[0023] The backtracking data storage module is used to send the incremental log to the message queue when it is monitored that there is an incremental log in the log file. The message queue is used to be subscribed by a remote retrieval database and an object storage server to store the incremental log in the retrieval database and the object storage server.

[0024] A fifth aspect of the embodiments of the present application provides a retrospective data storage device, which is applied to a retrieval database, and the device includes:

[0025] A subscription module, used to subscribe to a message queue, wherein the message queue is associated with a remote backtracking data server;

[0026] An incremental log storage module is used to obtain and store an incremental log if there is an incremental log in the message queue. The incremental log is sent to the message queue by the backtracking data server when the incremental log exists in the log file of the local disk monitored by the backtracking data server.

[0027] The data clearing module is used to regularly clear the historical data in the retrieval database.

[0028] A sixth aspect of an embodiment of the present application provides a backtracking data storage device, which is applied to an object storage server, and the device includes:

[0029] A subscription module, used to subscribe to a message queue, wherein the message queue is associated with a remote backtracking data server;

[0030] An incremental log acquisition module is used to acquire and compress the incremental log if there is an incremental log in the message queue. The incremental log is sent to the message queue by the backtracking data server when the incremental log exists in the log file of the local disk monitored by the backtracking data server.

[0031] An incremental log storage module, used to store the compressed incremental log;

[0032] The incremental log writing module is used to write the stored incremental log into the physical disk.

[0033] A seventh aspect of an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the retrospective data storage method as described in the first aspect, the second aspect, and / or the third aspect is implemented.

[0034] An eighth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the retrospective data storage method as described in the first aspect, the second aspect and / or the third aspect is implemented.

[0035] A ninth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device executes the retrospective data storage method described in the first aspect, the second aspect and / or the third aspect.

[0036] Compared with the prior art, the embodiments of the present application have the following advantages:

[0037] In an embodiment of the present application, after the backtracking data to be stored is written into the log file of the local disk of the backtracking data service end through the service node, the newly written backtracking data can be cached in the message queue as the incremental log in the log file, and the retrieval database and the object storage server can obtain the above incremental log by subscribing to the message queue, thereby realizing the storage of the backtracking data. The backtracking data stored in the retrieval database can meet the needs of real-time retrieval, and the backtracking data stored in the object storage server can be stored for a long time. Since the number of service nodes can be managed by the container cluster management system during the reporting process of the backtracking data, and the backtracking data is directly written to the local disk after reporting, it is not necessary to rely on external conditions to realize the rapid reporting of large-scale backtracking data and realize horizontal expansion. In addition, the embodiment of the present application realizes real-time retrieval of short-term hot data by collecting new logs in real time and writing the collected new logs into the retrieval database through a distributed message queue. Finally, the embodiment of the present application compresses the data and writes it into a mechanical hard disk to ensure that the data can be stored for a long time, reducing the storage cost of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 It is a schematic diagram of a retrospective data storage method provided by an embodiment of the present application;

[0040] Figure 2 This is a schematic diagram of an implementation of S101 in a retrospective data storage method provided in an embodiment of the present application;

[0041] Figure 3 is a schematic diagram of another retrospective data storage method provided in an embodiment of the present application;

[0042] Figure 4 It is a schematic diagram of another method for storing backtracking data provided in an embodiment of the present application;

[0043] Figure 5 This is a schematic diagram of a process of storing traceback data in a traceback data server provided by an embodiment of the present application;

[0044] Figure 6 It is a schematic diagram of a process of storing traceback data in an object storage server and a retrieval database provided by an embodiment of the present application;

[0045] Figure 7is a schematic diagram of a retrospective data storage device provided in an embodiment of the present application;

[0046] Figure 8 is a schematic diagram of another retrospective data storage device provided in an embodiment of the present application;

[0047] Fig. 9 is a schematic diagram of another retrospective data storage device provided in an embodiment of the present application;

[0048] Fig.10 It is a schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the present application.

[0050] The technical solution of the present application is described below through specific embodiments.

[0051] Reference Figure 1 , shows a schematic diagram of a retrospective data storage method provided in an embodiment of the present application, the method is applied to a retrospective data service end, and specifically may include the following steps:

[0052] S101. Determine multiple service nodes.

[0053] It should be noted that the service node in the embodiment of the present application can be used to provide an access entry of the traceback data service end for the traceback data to be stored.

[0054] The retrospective data in the embodiment of the present application can be a structured JSON data, which can store information such as style changes, and the style change information stored in the retrospective data can be played back by the server to form a retrospective video. Since the obtained retrospective video shows the complete interactive process and display snapshots of the user using the website to conduct transactions, the retrospective video obtained from the retrospective data can be used to resolve transaction disputes and to guide users to operate online on the same screen.

[0055] In some examples, the retrospective data may be generated during a user's online insurance transaction process, or may be generated during a user's online shopping process, that is, the retrospective data in the embodiments of the present application may be insurance transaction retrospective data, or may be online shopping retrospective data or other types of retrospective data. The embodiments of the present application do not limit the specific type of retrospective data.

[0056] In an embodiment of the present application, the traceback data is reported to the server through the service node, so the required service node can be determined according to the reported amount of the traceback data. After determining the reported amount of the traceback data, the dynamic scaling of the service node can be achieved through a container cluster management system, such as Kubernetes technology.

[0057] In a possible implementation of the embodiment of the present application, as Figure 2 As shown, determining multiple service nodes in S101 may specifically include the following steps S1011-S1015:

[0058] S1011. Obtain the total amount of the backtracking data to be stored.

[0059] In the embodiment of the present application, the total amount of the backtracking data to be stored in a unit time can be obtained by regularly counting the backtracking data to be reported.

[0060] S1012: Determine an average reporting value of a plurality of configured service nodes according to the total amount of data.

[0061] In an embodiment of the present application, the configured service node may be a service node currently used for backtracking data reporting service. The reporting average value of the configured service node may be obtained by dividing the total amount of backtracking data to be stored per unit time by the number of existing configured service nodes.

[0062] S1013: Determine whether the reported average value is greater than a set threshold.

[0063] In an embodiment of the present application, the threshold value may be set arbitrarily according to actual needs. In one example, the threshold value may be set to be the optimal reporting amount of the service node, that is, when the reporting amount of the service node exceeds the set threshold value, the speed of reporting the traceback data to the server side will decrease. Users will generate a large amount of traceback data while browsing the website, so in order to realize the real-time query function of the traceback data, it is necessary to quickly upload the traceback data collected by the website front end to the server side. By maintaining the reported average value of the service node below the set threshold value, rapid reporting of the traceback data can be achieved.

[0064] If the reported average value is greater than the set threshold, S1014 may be executed to add at least one service node; if the reported average value is less than the set threshold, S1015 may be executed to reduce at least one service node.

[0065] S1014. Add at least one of the service nodes.

[0066] In an embodiment of the present application, when the average reported value of the configured service nodes is greater than the set service node reporting threshold, the container cluster management system can be used to increase service nodes to reduce the average reported value of each service node. The number of service nodes to be increased can be determined based on the specific number of backtracking data reports. If, after increasing the service nodes, the average reported value of each service node is still greater than the set service node reporting threshold, service nodes can continue to be increased until the average reported value of each service node is less than or equal to the set service node reporting threshold.

[0067] In the embodiment of the present application, if it is determined that the average reporting amount of the currently configured service nodes is equal to the set threshold, which means that the currently configured service nodes are at the optimal reporting amount, there is no need to adjust the number of service nodes.

[0068] S1015. Reduce at least one of the service nodes.

[0069] In the embodiment of the present application, if it is determined that the average value reported by the currently configured service nodes is less than the set threshold, there may be a situation where the service nodes are redundant, and the number of service nodes may need to be reduced. Therefore, when it is found that the average value reported by the currently configured service nodes is less than the set threshold, it is necessary to first determine whether the service nodes are redundant.

[0070] In the embodiment of the present application, after reducing the service nodes, the number of remaining service nodes needs to be greater than or equal to the minimum configured number of service nodes. If the number of service nodes is already the minimum configured number of service nodes, that is, there is no redundancy in the service nodes, then even if it is determined that the average reporting value of the currently configured service nodes is less than the set service node reporting threshold, there is no need to reduce the number of service nodes.

[0071] In an embodiment of the present application, the number of service nodes to be reduced can be determined by calculating whether the reported average value of the remaining service nodes after reducing a specific number of service nodes is less than a set threshold. In an embodiment of the present application, the reported average value of the remaining service nodes can be obtained by dividing the total amount of traceback data to be stored per unit time by the number of remaining service nodes. If the reported average value of the remaining service nodes obtained is less than or equal to the set threshold, and the number of remaining service nodes after reduction is greater than or equal to the minimum configuration number of service nodes, there is redundancy in the service nodes, and the specific number of service nodes can be reduced. The specific number of service nodes to be reduced can be set by the developer according to actual conditions. If the reported average value of the remaining service nodes obtained is less than the set threshold, but the number of remaining service nodes after reduction is less than the minimum configuration number of service nodes, the number of service nodes is reduced to the minimum configuration number of service nodes. If the obtained average reporting value of the remaining service nodes is greater than the set threshold, the number of remaining service nodes can be increased by one, and the average reporting value of the remaining service nodes can be calculated again until the obtained average reporting value of the remaining service nodes meets the condition of being less than or equal to the set threshold and the number of remaining service nodes after reduction is greater than or equal to the minimum configured number of service nodes. At this time, the number of service nodes subtracted is the actual redundancy of the configured service nodes, subtracting the redundant service nodes from the configured service nodes.

[0072] In an embodiment of the present application, the number of service nodes is dynamically scaled up and down by the container cluster management system at the backtracking data service end, which can ensure that the reporting process of the backtracking data does not need to rely on external conditions, that is, the reporting of the backtracking data can be realized only by the backtracking data service end itself. In addition, since the container cluster management system can adjust the number of service nodes so that the average value of the configured service node reporting is always close to the set service node reporting threshold, a large amount of backtracking data can be quickly uploaded to the backtracking data service end.

[0073] S102: Receive the traceback data to be stored through a plurality of the service nodes.

[0074] In the embodiment of the present application, after adjusting the number of service nodes and ensuring that the load of each service node is balanced, the backtracking data server can receive the backtracking data to be stored through the service nodes.

[0075] S103: Write the backtracking data to be stored into a log file on the local disk.

[0076] After receiving the backtrace data to be stored reported by the service node, the backtrace data server may write the backtrace data to be stored into a log file on the local disk to achieve caching of the backtrace data.

[0077] S104. When it is monitored that there is an incremental log in the log file, the incremental log is sent to a message queue, and the message queue is used to be subscribed by a remote retrieval database and an object storage server to store the incremental log in the retrieval database and the object storage server.

[0078] In an embodiment of the present application, a log collection agent, such as Logtail, can be used to collect newly added log files asynchronously in real time. The log collection agent can dynamically monitor the log files in the local disk of the backtracking data service end, and read and parse the newly added logs in real time. When Logtail monitors that there are newly added logs in the log files of the local disk, the newly added logs can be collected asynchronously in real time by polling and event coexistence and the collected newly added logs can be stored in a message queue, such as a Kafka message queue. In the log collection system, polling refers to collecting logs by regularly detecting whether the log files are updated, and events refer to collecting logs by relying on event notifications of the operating system. The log collection agent can trigger log reading behavior in the form of events within the system, and then regularly traverse the folders and generate incremental logs through an independent polling module. Combining the two log collection technologies to collect the newly added logs on the local disk can ensure the efficiency, reliability and stability of the log collection process. In an embodiment of the present application, the function of the message queue is equivalent to a transfer station, which can write the incremental logs cached on the local disk of the retrospective data server to the message queue. Subsequent retrieval databases and object storage servers can obtain the incremental logs stored on the message queue by subscribing to the message queue.

[0079] In an embodiment of the present application, the reporting process of the backtracking data can be completed only through the local disk of the backtracking data service end, and the number of service nodes reporting the backtracking data can be dynamically scaled through the container cluster management system during the reporting process, so it can cope with the situation of large-scale backtracking data at the same time. The backtracking data to be stored can be stored in the local disk, message queue, retrieval database and object storage server of the backtracking data service end at the same time. Since the data is stored in multiple different servers at the same time, even if the business stops running in a short time, the backtracking data stored in the past can still be restored after the business is restored, which improves the robustness of the backtracking data storage system. In addition, through the log collection system and the message queue, the backtracking data to be stored can be efficiently written into the retrieval database, thereby realizing the real-time retrieval function of the backtracking data, so that the backtracking data storage method can be applied to the situation where the backtracking data needs to be retrieved in real time, expanding the applicability of the backtracking data storage system. When writing data to the retrieval database and object storage server, the embodiment of the present application can use hot and cold tiered storage technology to write short-term hot data into the retrieval database to ensure real-time retrieval of short-term data. At the same time, data that needs to be stored for a long time can be compressed and written to the mechanical hard disk of the object storage server for long-term storage, thereby greatly reducing the storage cost of retrospective data.

[0080] Reference Figure 3 , shows a schematic diagram of a backtracking data storage method provided in an embodiment of the present application, the method is applied to a retrieval database, and specifically may include the following steps:

[0081] S301, subscribing to a message queue, wherein the message queue is associated with a remote traceability data server.

[0082] In an embodiment of the present application, the retrieval database may be an analytical column-based database ClickHouse or other databases, and the retrieval database may obtain incremental logs by subscribing to a message queue.

[0083] S302: If there is an incremental log in the message queue, obtain and store the incremental log, where the incremental log is sent to the message queue by the backtracking data server when the incremental log is detected to exist in the log file of the local disk.

[0084] In an embodiment of the present application, after the retrieval database subscribes to a message queue, if there is an incremental log in the message queue, the retrieval database can obtain the backtracking data to be stored by consuming the new log in the message queue in real time.

[0085] In an embodiment of the present application, any legal date expression can be used to specify that the retrieval database partitions the backtracking data by storage time when creating a table in the retrieval database, so as to subsequently clear the historical data in the retrieval database. For example, in the analytical columnar database ClickHouse, the partition function toYYYYMM() is used to partition the data by month.

[0086] S303: Periodically clear the historical data in the retrieval database.

[0087] In an embodiment of the present application, after the retrospective data written into the retrieval database is partitioned and stored according to the storage time, the data of the historical partitions in the retrieval database can be regularly cleared. For example, in the analytical columnar database ClickHouse, the storage partitions can be managed by TTL to eliminate expired partition data.

[0088] In the embodiment of the present application, the retrieval database obtains the newly added logs cached on the local disk of the retrospective data service end in real time by subscribing to the message queue, which can meet the demand for real-time retrieval of retrospective data when generating retrospective videos. In addition, since the retrospective data stored in the retrieval database is partitioned and the expired partitioned data is regularly cleared, it can effectively avoid the situation where the retrieval speed decreases due to excessive data stored in the retrieval database when retrieving data. At the same time, due to the periodic expiration of historical data, the amount of data stored in the retrieval database can be kept within a reasonable range, and there is no need to expand the retrieval database.

[0089] Reference Figure 4 , shows a schematic diagram of a retrospective data storage method provided in an embodiment of the present application, the method is applied to an object storage server, and specifically may include the following steps:

[0090] S401, subscribing to a message queue, wherein the message queue is associated with a remote backtracking data server.

[0091] In an embodiment of the present application, an object storage server, such as OSS, can obtain incremental logs in a message queue by subscribing to the message queue.

[0092] S402: If there is an incremental log in the message queue, obtain and compress the incremental log, where the incremental log is sent to the message queue by the backtracking data server when the incremental log is detected to exist in the log file of the local disk.

[0093] In an embodiment of the present application, after the object storage server subscribes to a message queue, if there is an incremental log in the message queue, the object storage server can obtain the traceback data to be stored by consuming the new log in the message queue in real time.

[0094] S403: Store the compressed incremental log.

[0095] After obtaining the compressed incremental log, the object storage server can write the compressed incremental log to the object storage server for caching.

[0096] S404: Write the stored incremental log into a physical disk.

[0097] In an embodiment of the present application, the newly added log written to the object storage server can be written to the mechanical hard disk of the object storage server through the off-site replication technology. Through the off-site replication technology, the newly added log can be written to the physical disk located in different regions for long-term storage. For example, the mechanical hard disk located in city A can be set as the first node to store the backtracking data, and the mechanical hard disk located in city B can be set as the second storage node to store the same batch of backtracking data for a long time.

[0098] In an embodiment of the present application, by selecting physical disks in different regions for long-term storage of retrospective data through off-site replication technology, the probability of data loss due to extreme situations such as fire and power outage can be reduced, thereby reducing data storage costs while improving the availability of retrospective data.

[0099] For ease of understanding, the following introduces the retrospective data storage method provided in the embodiment of the present application with reference to a specific example.

[0100] like Figure 5 As shown, when the backtrace data to be stored begins to be reported, the container cluster management system will first determine whether the conditions for scaling the service nodes are met based on the amount of data of the backtrace data to be stored and the number of configured service nodes, that is, whether the number of service nodes needs to be adjusted. If the scaling conditions are met, that is, the number of service nodes is redundant or the number of service nodes is insufficient, resulting in an overload of the service nodes, the service nodes are dynamically scaled through the container cluster management system to balance the load of the service nodes. After the service nodes are load balanced, the backtrace data to be stored is reported through the service nodes, the backtrace data to be stored is reported to the backtrace data server, and the backtrace data to be stored is written to the local disk of the backtrace data server in the form of a log file. If the scaling conditions are not met, that is, the service node has reached load balancing, the backtrace data reporting service is started directly, and the backtrace data to be stored is written to the local disk of the backtrace data server in the form of a log file.

[0101] like Figure 6As shown, logtail technology is used to asynchronously and in real time collect incremental logs on the local disk of the retrospective data server through a proxy, and the collected incremental logs are reported to the message queue for caching. The incremental logs cached in the message queue are consumed by the object storage server and the analytical column database by subscribing to the message queue to obtain incremental logs. The incremental logs consumed by the object storage server are compressed and archived to the local hard disk for long-term storage in the object storage server. The incremental logs consumed by the analytical column database are partitioned and saved in the database based on time. The database will regularly delete the retrospective data in the expired partition to maintain the database retrieval speed and the amount of data stored. Through the analytical column database, the retrospective data in the database can be retrieved in real time to generate a retrospective video. The above-mentioned analytical column database can be the retrieval database in each of the aforementioned embodiments.

[0102] Reference Figure 7 , shows a schematic diagram of a backtracking data storage device provided in an embodiment of the present application, which may specifically include a service node determination module 701, a backtracking data receiving module 702, a backtracking data caching module 703, and a backtracking data storage module 704, wherein:

[0103] A service node determination module 701 is used to determine multiple service nodes;

[0104] A backtracking data receiving module 702, configured to receive the backtracking data to be stored through a plurality of the service nodes;

[0105] The backtracking data cache module 703 is used to write the backtracking data to be stored into a log file on a local disk;

[0106] The backtracking data storage module 704 is used to send the incremental log to the message queue when it is monitored that there is an incremental log in the log file. The message queue is used to be subscribed by the remote retrieval database and object storage server to store the incremental log in the retrieval database and the object storage server.

[0107] In a possible implementation of an embodiment of the present application, the service node determination module 501 can be specifically used to: obtain the total amount of traceback data to be stored; determine the reported average value of multiple configured service nodes based on the total amount of data; determine whether the reported average value is greater than a set threshold; if the reported average value is greater than the set threshold, add at least one service node; if the reported average value is less than the set threshold, reduce at least one service node.

[0108] In another possible implementation of the embodiment of the present application, the service node determination module 501 can also be used to: determine the number of service nodes to be reduced; calculate whether the reported average value of the remaining service nodes after the reduced number of service nodes is still less than a set threshold, wherein the number of remaining service nodes is greater than or equal to the minimum configured number of service nodes; if the reported average value of the remaining service nodes is still less than the set threshold, reduce the number of service nodes; otherwise, adjust the number of service nodes to be reduced, and repeat the step of calculating whether the reported average value of the remaining service nodes after the reduced number of service nodes is still less than the set threshold.

[0109] In a possible implementation of an embodiment of the present application, the backtracking data storage module 504 can be specifically used to: monitor whether the incremental log exists in the log file; if the incremental log exists in the log file, obtain the incremental log through polling and / or event coexistence; and send the incremental log to the message queue.

[0110] Reference Figure 8 , shows a schematic diagram of another backtracking data storage device provided in an embodiment of the present application, which may specifically include a subscription module 801, an incremental log storage module 802 and a data clearing module 803, wherein:

[0111] Subscription module 801, used to subscribe to a message queue, the message queue is associated with a remote backtracking data server;

[0112] The incremental log storage module 802 is used to obtain and store the incremental log if there is an incremental log in the message queue. The incremental log is sent to the message queue by the backtracking data server when the incremental log exists in the log file of the local disk monitored by the backtracking data server.

[0113] The data clearing module 803 is used to periodically clear the historical data in the retrieval database.

[0114] Reference Fig. 9 , shows a schematic diagram of another backtracking data storage device provided in an embodiment of the present application, which may specifically include a subscription module 901, an incremental log acquisition module 902, an incremental log storage module 903 and an incremental log writing module 904, wherein:

[0115] Subscription module 901, used to subscribe to a message queue, the message queue is associated with a remote backtracking data server;

[0116] The incremental log acquisition module 902 is used to acquire and compress the incremental log if there is an incremental log in the message queue. The incremental log is sent to the message queue by the backtracking data server when the incremental log exists in the log file of the local disk monitored by the backtracking data server.

[0117] The incremental log storage module 903 is used to store the compressed incremental log;

[0118] The incremental log writing module 904 is used to write the stored incremental log into the physical disk.

[0119] In a possible implementation of the embodiment of the present application, the incremental log writing module 904 can also be used to: write the stored incremental logs to multiple different physical disks at the same time through off-site replication technology, and the multiple different physical disks are located in different regions.

[0120] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.

[0121] Reference Fig.10 , shows a schematic diagram of a computer device provided by an embodiment of the present application. Fig.10 As shown, the terminal device 1000 in the embodiment of the present application includes: a processor 1010, a memory 1020, and a computer program 1021 stored in the memory 1020 and executable on the processor 1010. When the processor 1010 executes the computer program 1021, the steps in each embodiment of the above-mentioned backtracking data storage method are implemented, such as Figure 1 Alternatively, when the processor 1010 executes the computer program 1021, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 7 Functions of modules 701 to 704 are shown.

[0122] Exemplarily, the computer program 1021 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 1020 and executed by the processor 1010 to complete the present application. The one or more modules / units may be a series of computer program instruction segments that can perform specific functions, and the instruction segments may be used to describe the execution process of the computer program 1021 in the terminal device 1000. For example, the computer program 1021 may be divided into a service node determination module, a backtracking data receiving module, a backtracking data caching module, and a backtracking data storage module, and the specific functions of each module are as follows:

[0123] A service node determination module, used to determine multiple service nodes;

[0124] A backtracking data receiving module, used for receiving the backtracking data to be stored through multiple service nodes;

[0125] A backtracking data cache module is used to write the backtracking data to be stored into a log file on a local disk;

[0126] The backtracking data storage module is used to send the incremental log to the message queue when it detects the existence of incremental log in the log file. The message queue is used to be subscribed by the remote retrieval database and object storage server to store the incremental log in the retrieval database and object storage server.

[0127] The computer device 1000 may be a computer device for implementing the above-mentioned various method embodiments, and the computer device 1000 may be a computing device such as a desktop computer, a cloud server, etc. The computer device 1000 may include, but is not limited to, a processor 1010 and a memory 1020. Those skilled in the art will understand that Fig.10 This is only an example of the computer device 1000 and does not constitute a limitation of the computer device 1000. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 1000 may also include input and output devices, network access devices, buses, etc.

[0128] The processor 1010 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0129] The memory 1020 may be an internal storage unit of the computer device 1000, such as a hard disk or memory of the computer device 1000. The memory 1020 may also be an external storage device of the computer device 1000, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 1000. Further, the memory 1020 may also include both an internal storage unit of the computer device 1000 and an external storage device. The memory 1020 is used to store the computer program 1021 and other programs and data required by the computer device 1000. The memory 1020 may also be used to temporarily store data that has been output or is to be output.

[0130] An embodiment of the present application further discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the retrospective data storage method described in the above embodiments is implemented.

[0131] The embodiment of the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the retrospective data storage method as described in the above embodiments is implemented.

[0132] The embodiment of the present application further discloses a computer program product. When the computer program product is run on a computer device, the computer device executes the retrospective data storage method described in the above embodiments.

[0133] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for storing retrospective data, characterized in that: Applied to the backtracking data service end, the method includes: Determine multiple service nodes; The backtracking data to be stored is received through the plurality of service nodes; the backtracking data is a structured JSON data storing style change information; the backtracking data is used to play back the style change information to form a backtracking video; the backtracking video is used to display the complete interaction process and display snapshots of the user using the website to conduct transactions; Writing the backtracking data to be stored into a log file on a local disk; When it is monitored that there is an incremental log in the log file, the incremental log is sent to a message queue, and the message queue is used to be subscribed by a remote retrieval database and an object storage server, so as to store the incremental log in the retrieval database and the object storage server; the object storage server is used to obtain and compress the incremental log when there is an incremental log in the message queue, store the compressed incremental log, and write the stored incremental log to a physical disk; the retrieval database is used to obtain and store the incremental log when there is an incremental log in the message queue, and regularly clear the historical data in the retrieval database; The determining of the plurality of service nodes comprises: Obtaining the total amount of the backtracking data to be stored; Determine, according to the total amount of data, a reporting average value of a plurality of configured service nodes; Determine whether the reported average value is greater than a set threshold; If the reported average value is greater than the set threshold, adding at least one of the service nodes; If the reported average value is less than the set threshold, at least one of the service nodes is reduced.

2. The method according to claim 1, characterized in that The reducing at least one of the service nodes comprises: Determining the number of the service nodes to be reduced; Calculating whether the reported average value of the remaining service nodes after reducing the number of the service nodes is still less than the set threshold, wherein the number of the remaining service nodes is greater than or equal to the minimum configured number of the service nodes; If the reported average value of the remaining service nodes is still less than the set threshold, reduce the number of the service nodes; otherwise, adjust the number of the service nodes to be reduced, and repeat the step of calculating whether the reported average value of the remaining service nodes is still less than the set threshold after reducing the number of service nodes.

3. The method according to claim 1, characterized in that When the incremental log is detected in the log file, the incremental log is sent to the message queue, including: Monitor whether the incremental log exists in the log file; If the incremental log exists in the log file, the incremental log is obtained by polling and event coexistence; The incremental log is sent to the message queue.

4. A retrospective data storage device, characterized in that: Applied to the backtracking data service end, the device comprises: A service node determination module, used to determine multiple service nodes; A retrospective data receiving module is used to receive the retrospective data to be stored through the plurality of service nodes; the retrospective data is a structured JSON data storing style change information; the retrospective data is used to play back the style change information to form a retrospective video; the retrospective video is used to display the complete interactive process and display snapshots of the user using the website to conduct transactions; A backtracking data cache module, used to write the backtracking data to be stored into a log file on a local disk; The backtracking data storage module is used to send the incremental log to the message queue when it is monitored that there is an incremental log in the log file, and the message queue is used to be subscribed by the remote retrieval database and the object storage server to store the incremental log in the retrieval database and the object storage server; the object storage server is used to obtain and compress the incremental log when there is an incremental log in the message queue, store the compressed incremental log, and write the stored incremental log to the physical disk; the retrieval database is used to obtain and store the incremental log when there is an incremental log in the message queue, and regularly clear the historical data in the retrieval database; The determining of the plurality of service nodes comprises: Obtaining the total amount of the backtracking data to be stored; Determine, according to the total amount of data, a reporting average value of a plurality of configured service nodes; Determine whether the reported average value is greater than a set threshold; If the reported average value is greater than the set threshold, adding at least one of the service nodes; If the reported average value is less than the set threshold, at least one of the service nodes is reduced.

5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the retrospective data storage method according to any one of claims 1 to 3 is implemented.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the retrospective data storage method according to any one of claims 1 to 3 is implemented.