Business processing method and device, equipment, storage medium and program product
Through external data association and double-check mechanisms, the high memory usage and data delay problems during multi-event stream association in real-time computing engine are solved, the business data processing capability and system stability are improved, and the efficient association and data of event streams are realized Integrity.
Patent Information
- Application Number
- CN202411208371.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
AI Technical Summary
In the prior art, when real-time computing engines process multi-event streams, memory resources are mainly used for data storage, resulting in reduced data processing capabilities, resulting in serious data delays, and problems with invalid memory usage and data integrity.
Through external data association methods, cache and external databases are used to reduce memory resource usage, and data double-check mechanism and pushback mechanism are adopted to realize event flow association, reduce memory dependence, and improve system stability and data integrity.
It effectively reduces the loss of memory resources, improves the business data processing capabilities and data integrity, solves the problems of high memory usage and data delay during multi-event stream association, and enhances the stability and response capabilities of the system.
Smart Images

Figure CN119088839A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a business processing method, device, equipment, storage medium and program product. Background Art
[0002] In event-driven applications, in order to monitor business status in real time or make real-time decisions, a real-time computing engine is currently usually used to correlate multiple event streams and perform real-time processing and analysis on multiple correlated event streams.
[0003] Related technologies will store data from different event streams in the state of the real-time computing engine for association. As business data grows, a large amount of memory resources are used for data storage, and only a small amount of memory resources are used for data processing, which directly reduces the data processing capability of the operator and causes serious data latency.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a business processing method, device, equipment, storage medium and program product, aiming to solve the technical problem that the storage of internal associated data of multiple event streams in business processing occupies a large amount of memory and affects business data processing.
[0006] To achieve the above objectives, the present application proposes a business processing method, which is applied to a business processing platform and includes:
[0007] Receive business processing requests;
[0008] The business processing request is executed based on a preset event stream external association relationship to obtain a business processing result, wherein the event stream external association relationship is obtained by performing external data association on multiple event streams to be associated related to the business processing request.
[0009] In one embodiment, before the step of executing the business processing request based on the preset event flow external association relationship to obtain the business processing result, the step further includes:
[0010] External data association is performed on multiple event flows to be associated that are related to the business processing request to obtain external association relations of the event flows.
[0011] In one embodiment, the step of performing external data association on a plurality of to-be-associated event flows related to the business processing request to obtain an external association relationship of the event flows includes:
[0012] Determine the main event flow and the auxiliary event flow of the business processing request according to the business logic relationship of the multiple event flows to be associated;
[0013] Writing the auxiliary event stream into an external database for storage;
[0014] Based on a preset data double-check mechanism, the main event stream is associated with the auxiliary event stream to obtain an event stream association relationship.
[0015] In one embodiment, the step of associating the main event stream with the auxiliary event stream based on a preset data double-check mechanism to obtain an event stream association relationship includes:
[0016] When the current stream data of the main event stream is processed for the first time, asynchronously querying the external database according to the current stream data;
[0017] If the external database hits the query, the auxiliary stream data of the auxiliary event stream corresponding to the current stream data in the external database is written into the internal cache database of the business processing platform for storage, so as to associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
[0018] In one embodiment, the step of associating the main event stream with the auxiliary event stream based on a preset data double-check mechanism to obtain an event stream association relationship includes:
[0019] When the current stream data of the main event stream is not processed for the first time, querying the internal cache database of the business processing platform according to the current stream data;
[0020] If the internal cache database does not hit the query, asynchronously query the external database according to the current stream data;
[0021] If the external database hits the query, the auxiliary stream data of the auxiliary event stream corresponding to the current stream data in the external database is written into the internal cache database for storage, so as to associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
[0022] In one embodiment, after the step of asynchronously querying the external database according to the current stream data, the method further includes:
[0023] Determine whether the main event stream satisfies a preset data back-pushing constraint condition, wherein the data back-pushing constraint condition includes at least one or more of a back-pushing time constraint condition, a back-pushing number constraint condition, and a time period constraint condition;
[0024] If the main event stream meets the data pushback constraint condition, the pushback interval time of the main event stream is calculated by using a preset pushback interval time model;
[0025] If the current system time satisfies the pushback interval, the following steps are performed: based on a preset data double-check mechanism, the main event stream is associated with the auxiliary event stream to obtain an event stream association relationship.
[0026] In addition, to achieve the above-mentioned purpose, the present application also proposes a service processing device, the service processing device comprising:
[0027] A receiving module, used for receiving a business processing request;
[0028] The processing module is used to execute the business processing request based on the preset event flow external association relationship to obtain the business processing result. The event flow external association relationship is obtained by external data association of multiple event flows to be associated related to the business processing request.
[0029] In addition, to achieve the above objectives, the present application also proposes a business processing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the business processing method described above.
[0030] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the business processing method described above are implemented.
[0031] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the business processing method described above are implemented.
[0032] The present application provides a business processing method. The present application first determines an event flow related to the business processing by receiving a request for business processing; based on an external association relationship of event flows obtained by performing external data association on multiple event flows to be associated related to the business processing request, the business processing request is executed to obtain a result of the business processing, so as to reduce the memory resource occupation of the business processing through external data association of multiple event flows, thereby ensuring the business data processing capability.
[0033] In summary, the present application solves the problem in the related technology that the internal associated data storage of multiple event streams in business processing occupies a large amount of memory and affects business data processing through business processing of external data association of multiple event streams, reduces the occupation of memory resources by multi-event stream data storage, and thus ensures business data processing capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 A flowchart of the first embodiment of the business processing method of the present application is provided;
[0037] Figure 2 A flowchart of the second embodiment of the business processing method of the present application is provided;
[0038] Figure 3 A flowchart of the third embodiment of the business processing method of the present application is provided;
[0039] Figure 4 A flowchart of the data double-check mechanism involved in the business processing method of this application;
[0040] Figure 5 A flowchart of the data pushback mechanism involved in the business processing method of this application;
[0041] Figure 6 A sample schematic diagram of the pushback interval trend involved in the business processing method of this application;
[0042] Figure 7 A sample schematic diagram of the abnormal data monitoring rule configuration interface involved in the business processing method of this application;
[0043] Figure 8 This is a schematic diagram of the module structure of the service processing device according to an embodiment of the present application;
[0044] Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the business processing method in the embodiment of the present application.
[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0047] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0048] The main solution of the embodiment of the present application is: receiving a business processing request; executing the business processing request based on a preset event flow external association relationship to obtain a business processing result, wherein the event flow external association relationship is obtained by performing external data association on multiple event flows to be associated related to the business processing request.
[0049] Technical terms involved in this application:
[0050] Event-driven framework: It is a software architecture pattern. Its core idea is that the functions and logical organization of the system are centered around events and event handlers. In this framework, events (or messages) refer to certain actions or state changes that occur in the system, while event handlers refer to code modules or functions that are responsible for responding to and processing these events.
[0051] Flink real-time computing engine: is a stream processing framework that focuses on processing and analyzing real-time data streams. It is designed to process large-scale streaming data and has the characteristics of high throughput, low latency, and exactly-once processing, making it suitable for various real-time data processing scenarios.
[0052] Multi-stream Join (multi-stream association): refers to the operation of processing multiple data streams simultaneously in stream processing and connecting or merging them for joint processing under certain conditions. In real-time computing engines such as Flink, multi-stream Join usually involves the joint operation of streams from different data sources to facilitate more complex and comprehensive data analysis and processing in the context of the stream.
[0053] The Connect operator of the State state is used to connect two different types of streams. It is a mechanism that can maintain and access the state during the connection process, allowing the state to be shared between the two connected streams and execute complex processing logic.
[0054] Window Join: refers to the joint processing of events from two or more streams in stream processing, where event time windows are a key concept. Windows can be defined as time periods of fixed size or triggered based on the number of events.
[0055] RocksDB: is an open source key-value storage library that provides persistent key-value storage and supports multiple data structures such as hashes, ordered sets, etc.
[0056] Checkpoint (snapshot): is a processing mechanism that allows Flink to periodically save the state of the application to persistent storage so that it can be restored to the previous state in the event of a failure without losing data or incurring duplicate processing.
[0057] Es / HBase: Hbase is a distributed, column-oriented NoSQL database designed to provide random real-time read / write access on large-scale data sets. Es (Elasticsearch) is a real-time distributed search and analysis engine designed to process structured and unstructured data. HBase and Es are suitable for storing large amounts of structured or semi-structured data and support complex queries and analysis.
[0058] Redis: is an open source in-memory data structure storage system, commonly used as a database, cache, and message broker. It is mainly used for fast access and storage of small amounts of data, especially for cache and session storage that requires fast reading and writing.
[0059] At present, there are two main types of mainstream solutions for multi-stream Join in Flink real-time computing engine: one is the Connect operator operation based on native State state; the other is the Join operation based on window, which can be further divided into Window Join (window association) and Interval Join (interval association). Regardless of which method is used, the underlying principle is to rely on Flink's State state storage, that is, by storing data in State and associating Join, and finally outputting the result. When this technical implementation method is applied to actual scenarios, it not only consumes a lot of memory resources, but also has the following problems:
[0060] 1. As business data grows, a large amount of memory is used for storage, and only a small amount of memory resources are used for data processing, which directly reduces the data processing capability of operators, causing serious data latency and making it impossible for business data to be reflected and fed back in real time;
[0061] 2. Even if the Flink job sets the state backend to RocksDb key-value storage mode and enables incremental snapshot backup, the CheckPoint snapshot will continue to grow as the data grows, which will gradually prolong the CheckPoint snapshot process and easily cause abnormal failure of real-time tasks. CheckPoint loss will not only lead to data consistency failure, but also frequent restarts caused by this will lead to the push of duplicate data, which will directly lead to incorrect statistics and reflection of business data.
[0062] 3. Multi-stream Join association often involves the problem of window alignment, which can easily cause data that should be associated to not be associated, directly leading to missing business element data and affecting data accuracy and completeness;
[0063] 4. When the relationship between event streams is "or", the data must also be kept in the window for invalid stay, which wastes memory usage. Take customer transaction data and transaction referrer data as an example: when a customer has transaction data, the referrer information may not be entered, which means that the transaction data may not have corresponding referrer data, but in order to be able to be associated with each other, both data must exist in the State. At this time, transaction data without a referrer will cause a worthless stay, and the longer the window time, the greater the waste.
[0064] In order to avoid the shortcomings of mainstream solutions, this application proposes a low-memory, multi-scenario, self-adjustable real-time stream data association solution, aiming to achieve the following goals:
[0065] 1. Break through the restrictions on high memory resource requirements, reduce memory resource requirements, avoid job exceptions caused by resource limitations, and improve job stability;
[0066] 2. Solve the problem of invalid memory usage when there is an "or" relationship between multiple event streams;
[0067] 3. Supports data deduplication and associated time windows without being limited by memory resources. It supports personalized adjustments through configurable parameters to reduce the impact of upstream abnormal fluctuations / data;
[0068] 4. Provides a general data pushback operator, supports diversified pushback scenarios, configurable pushback parameters, and automated pushback interval adjustment; at the same time, reduces the pressure on asynchronous access to external storage through a double-check mechanism;
[0069] 5. Support real-time monitoring of abnormal data and traceable analysis.
[0070] Through the business processing of external data association of multiple event streams, comprehensive utilization of high-speed cache, low-cost storage of external databases and high concurrent access, it is proposed to use external association to realize event stream association, which greatly reduces the loss of resources, breaks through the resource limitations of real-time operations to a certain extent, improves the stability of operations, the integrity and effectiveness of data, and provides strong guarantees for related real-time scenarios such as retail customer transactions and customer operations.
[0071] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a business processing device, etc. The following takes the business processing device as an example to illustrate this embodiment and the following embodiments.
[0072] Based on this, the present application embodiment provides a business processing method, referring to Figure 1 , Figure 1This is a flowchart of the first embodiment of the business processing method of the present application.
[0073] In this embodiment, the service processing method is applied to a service processing platform, including steps S10 to S20:
[0074] Step S10, receiving a business processing request;
[0075] It is understandable that, in order to perform business processing later, the business processing platform receives business operations or business processing requests that need to be responded to. The received business processing request may be a business request from an external user or system received through a network interface, usually including input data and instructions.
[0076] Step S20, executing the business processing request based on a preset event stream external association relationship to obtain a business processing result, wherein the event stream external association relationship is obtained by performing external data association on a plurality of event streams to be associated related to the business processing request.
[0077] It should be noted that the business processing platform adopts an event-driven data stream processing framework, and the external association relationship of the event stream is obtained by associating the external data of multiple event streams related to the business processing request. The multiple event streams related to the business processing request can be event streams from different external systems, databases or real-time databases, and external data association refers to the process of matching, merging or connecting data in different event streams.
[0078] It is understandable that the business processing platform will pre-configure the business processing requests that may be received, and associate the business processing requests with multiple event streams related to external user terminals or systems through external data association. After receiving such business processing requests, the business processing request is executed based on the external association relationship of these event streams to obtain the execution result of the business processing request.
[0079] In a feasible implementation manner, before the step of executing the business processing request based on the preset event flow external association relationship to obtain the business processing result, the step further includes:
[0080] Step S201 , external data association is performed on a plurality of event flows to be associated that are related to the business processing request to obtain an external association relationship of the event flows.
[0081] It is understandable that before executing a business processing request, the business processing platform will query multiple external event streams or data sources related to the received business processing request, and associate and merge the relevant data according to the preset association logic to form an external association relationship between multiple related event streams under the same type of business processing request.
[0082] In this embodiment, by externally associating multiple event streams related to business processing requests and integrating the external association of event streams into business processing, more complex business processing flows can be supported, enabling the system to quickly respond to business processing requests and improve processing efficiency.
[0083] In a feasible implementation manner, the step of performing external data association on a plurality of to-be-associated event flows related to the business processing request to obtain an external association relationship of the event flows includes:
[0084] Step S2011, determining the main event flow and the auxiliary event flow of the business processing request according to the business logic relationship of the multiple event flows to be associated;
[0085] It should be noted that the event processing logic of the business processing platform defines the processing method for event streams. For different business processing requests, there will be event processing logic corresponding to the request, and there will be business logic relationships between multiple event streams that need to be associated. Among them, the main event stream of the business processing request refers to the driving stream of the business event, and the main event stream can contain core data related to the business processing. The auxiliary event stream of the business processing is the event stream of the secondary or supporting nature of the business event, and the auxiliary event stream can include additional information or supplementary data related to the main event stream.
[0086] It can be understood that in order to perform external association operations on event flows related to business processing requests, main event flows and auxiliary event flows are identified according to business logic relationships among multiple event flows related to business processing requests.
[0087] Step S2012, writing the auxiliary event stream into an external database for storage;
[0088] It should be noted that the external database refers to an external database that is separated from the business processing platform. It can be a database of different business systems or a database for unified business data storage, which is used to store business data or achieve data separation.
[0089] It is understandable that the data in the auxiliary event stream is stored in an external database for subsequent access, management and processing.
[0090] Step S2013: Based on a preset data double-check mechanism, the main event stream is associated with the auxiliary event stream to obtain an event stream association relationship.
[0091] It should be noted that the data double-check mechanism refers to a mechanism for correlating multiple event flows by separately querying the internal cache of the business system and asynchronously accessing the external database.
[0092] It can be understood that by respectively querying the data of related event streams in the internal cache of the business system and the external database, the main event stream of the business processing and the corresponding auxiliary event stream stored in the external database are associated, and the association relationship between multiple event streams is determined.
[0093] Exemplarily, the business logic relationship of the multiple event flows to be associated includes at least one or more of the time sequence relationship of triggering the event flow, the belonging relationship between the event flows in business meaning, and the inevitable relationship between the event flows in objective existence.
[0094] For example, in an e-commerce system, the event streams of order-related processing such as order creation and payment completion can be regarded as the main event stream, because these event streams, as drivers of business events, directly trigger core business logic such as inventory updates and logistics arrangements; and the event streams related to users' browsing behavior, search history, etc., are used for personalized recommendations and behavior analysis, and have relatively low requirements for the real-time performance and processing priority of the system, and can be regarded as auxiliary event streams. In actual applications, event-driven business processing platforms usually reasonably divide the mainstream and auxiliary event streams according to business needs and system design in order to achieve efficient event processing and system operation.
[0095] In this implementation, by storing auxiliary event stream data in an independent external database and combining internal high-speed cache and asynchronous access to the external database data dual-check mechanism, external data association of multiple event streams is achieved, reducing the dependence of data storage on memory resource usage, achieving better concurrency performance, and improving the system's response speed and processing capabilities.
[0096] In a feasible implementation manner, the step of associating the main event stream with the auxiliary event stream based on a preset data double-check mechanism to obtain an event stream association relationship may include:
[0097] Step S20131, when the current stream data of the main event stream is processed for the first time, asynchronously querying the external database according to the current stream data;
[0098] It is understandable that the business processing platform can determine whether the current stream data of the main event stream is processed for the first time by setting a counter for business data processing. When the current stream data of the main event stream is processed for the first time, it can be considered that these data do not exist in the internal cache database of the business processing platform, and it is necessary to asynchronously access the external database to query whether there is data related to the current stream data in the external database.
[0099] Step S20132, if the external database hits the query, the auxiliary flow data of the auxiliary event flow corresponding to the current flow data in the external database is written into the internal cache database of the business processing platform for storage, so as to associate the main event flow with the auxiliary event flow to obtain an event flow association relationship.
[0100] It can be understood that if the asynchronous access query finds that there is auxiliary stream data of the auxiliary event stream related to the current data stream of the main event stream in the external database, the auxiliary stream data is written to the internal cache database of the business processing platform for storage to complete the association between the main event stream and the auxiliary event stream, thereby establishing the association relationship between multiple event streams related to the business processing request.
[0101] In this embodiment, when the event stream data is processed for the first time, an external database is accessed asynchronously, and the queried auxiliary stream data is written into the cache to establish an association relationship between the main event stream and the auxiliary event stream, thereby ensuring real-time or quasi-real-time association between the main event stream and the auxiliary event stream data, and maintaining data consistency and integrity.
[0102] In another feasible implementation manner, the step of associating the main event stream with the auxiliary event stream based on a preset data double-check mechanism to obtain an event stream association relationship may further include:
[0103] Step S20133, when the current stream data of the main event stream is not processed for the first time, query the internal cache database of the business processing platform according to the current stream data;
[0104] It is understandable that the business processing platform can determine whether the current stream data of the main event stream is processed for the first time by setting a counter for business data processing. When the current stream data of the main event stream is not processed for the first time, it is necessary to query whether the data exists in the internal cache database.
[0105] Step S20134, if the internal cache database does not hit the query, asynchronously query the external database according to the current stream data;
[0106] It is understandable that if the current stream data of the main event stream is not queried in the internal cache database, it is necessary to further query whether there is stream data related to the current stream data in the external database; and if the current stream data of the main event stream is queried in the internal cache database, it means that the external data association of the main event stream and the auxiliary event stream has been completed, and the auxiliary stream data in the internal cache database can be directly read for business logic processing when executing business processing requests.
[0107] Step S20135, if the external database hits the query, the auxiliary stream data of the auxiliary event stream corresponding to the current stream data in the external database is written into the internal cache database for storage, so as to associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
[0108] It can be understood that if stream data related to the current stream data is queried in the external database, the stream data related to the current stream data will be written into the internal cache library for storage to complete the association between the main event stream and the auxiliary event stream, thereby establishing the association relationship between multiple event streams related to the business processing request.
[0109] In this embodiment, when the event stream data is not processed for the first time, the internal cache database is queried, and the external database is asynchronously accessed when the internal cache database does not hit, and the queried auxiliary stream data is written into the cache to establish an association relationship between the main event stream and the auxiliary event stream, thereby ensuring real-time or quasi-real-time association between the main event stream and the auxiliary event stream data. Through the use of asynchronous query and internal cache, the delay of system business processing is reduced and the overall performance of the system is improved.
[0110] This embodiment provides a business processing method, which, through the business processing of external data association of multiple event streams, comprehensively utilizes the characteristics of high-speed cache, low-cost storage of external databases and high concurrent access, and proposes to use external association to realize event stream association, which greatly reduces resource loss, breaks through the resource limitation of real-time operations to a certain extent, improves the stability of operations, the integrity and effectiveness of data, and provides strong guarantees for relevant real-time scenarios such as retail customer transactions and customer operations.
[0111] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can refer to the above introduction, and will not be repeated in the following. Figure 3 , after the step of asynchronously querying the external database according to the current stream data, it also includes:
[0112] Step S20136, determining whether the main event stream satisfies a preset data back-pushing constraint condition, wherein the data back-pushing constraint condition includes at least one or more of a back-pushing time constraint condition, a back-pushing number constraint condition, and a time period constraint condition;
[0113] It should be noted that data pushback means that when data processing meets the pre-configured pushback conditions, the data can be pushed back to the step before the current step to re-execute the step operation. The step execution time threshold can be set as the pushback time constraint, the step repetition count threshold can be set as the pushback count constraint, and the step can be executed within a certain time period as a time period constraint.
[0114] It is understandable that after asynchronously accessing the external database and querying whether there is stream data related to the current data stream in the external database, it is necessary to determine whether the main event stream meets the constraints of data pushback. For example, the asynchronous query of the external database of the main event stream times out or fails, or the query is not hit. In order to avoid unexpected situations such as slow queries or data from the external database has not arrived, which leads to long-term occupation of memory resources and affects business processing, the main event stream that meets the data pushback constraints needs to be pushed back to ensure the smooth progress of other businesses.
[0115] Step S20137: if the main event stream meets the data pushback constraint condition, the pushback interval time of the main event stream is calculated by using a preset pushback interval time model;
[0116] It should be noted that the pushback time interval model is a pre-set mathematical model for calculating the rollback time interval. The current state of the main event flow, the current state of the system (such as memory usage, event queue status, etc.), database update cycle of other business systems, etc. can be used as input parameters of the mathematical model for calculation. The model calculates the output pushback interval time.
[0117] It can be understood that if the main event flow meets the above-mentioned data pushback constraints, the pushback time interval model is used to calculate the interval time required for the main event flow to be pushed back, so as to dynamically adjust the time for event flow re-pushback processing according to the actual situation of business processing, ensure that the pushback processing will not block other business processes and reduce the usage of memory resources.
[0118] Step S20138, if the current system time meets the pushback interval time, then execute the step: based on the preset data double-check mechanism, associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
[0119] It can be understood that when the current system time reaches the back-pushing interval time of the main event stream calculated by the back-pushing interval time model, the steps of external data association based on the data double-check mechanism will be re-executed, and the external data association operation of the main event stream and the auxiliary event stream will be re-tried.
[0120] In this embodiment, by setting up an abnormal data pushback mechanism for external database related queries and dynamically adjusting the retry strategy in combination with the pushback interval time model, the data pushback process can be effectively managed and optimized to ensure that the system can run stably and efficiently when facing asynchronous queries and pushback processing, while avoiding unnecessary impact on other business processes.
[0121] For example, in order to help understand the implementation process of the business processing method obtained by combining the first and second embodiments of this embodiment, in the third embodiment of this application, the same or similar contents as the first and second embodiments of this application can refer to the above introduction, and will not be repeated later. Figure 3 , Figure 3 A flowchart diagram of the third embodiment of the business processing method of this application is provided, specifically:
[0122] Taking the business processing scenario of multiple event streams associated with the real-time computing engine Flink as an example, it can be mainly divided into the following functions:
[0123] 1. Identification of primary and secondary streams: Based on the business logic relationship between event streams, the primary and secondary roles of event streams are determined, and the secondary event stream data is written to an external database in real time.
[0124] The primary and secondary roles of event flows are determined based on the business meaning of the event flow and the various relationships between data events. This can include but is not limited to the following aspects:
[0125] (1) The temporal order of the triggering event flow;
[0126] (2) The business relationship between event flows;
[0127] (3) The necessary relationship between event flows in terms of objective existence.
[0128] Under certain conditions and scenarios, the primary and secondary stream roles can be switched between each other.
[0129] 2. Configurable data deduplication: data deduplication and counting of primary / secondary data streams.
[0130] At present, the transaction data of customer products such as fund management and insurance in the industry are all sent in quasi-real time through database log collection tools. Any changes in the database will lead to quasi-real-time push of data. When the customer's personal information changes, the fields brought about by the product-related attributes are updated, etc., it will cause the same transaction flow to be pushed repeatedly, and such changes are not concerned by downstream or business. They will not only cause repeated data processing, increase operator pressure, and cause delays, but also bring difficulties to the calculation of various statistical indicators.
[0131] By storing only key / primary key fields, memory usage is reduced, allowing real-time jobs to support long-term data deduplication. At the same time, the deduplication time is extracted as a configurable parameter to form a separate module, which supports deduplication at different time granularities. The deduplication time can be modified through parameters according to specific business requirements, changes in upstream business characteristics, etc., to quickly respond to changes in demand and effectively shield the impact of changes in fields that are not of concern to the business.
[0132] 3. Data double-check association: The main event flow performs double-check association on external data. If the association fails, it enters the data pushback module and determines whether to push back based on the set pushback parameters.
[0133] like Figure 4 As shown, Figure 4 This is a flow chart of the data double-check mechanism involved in the business processing method of this application. The memory association of the event stream is converted into an external data association, and counting judgment is performed on the basis of data deduplication, and the data double-check mechanism is entered. Taking the real-time postal business data as an example, the postal transaction detail data and postal batch data are integrated:
[0134] (1) If it is determined that the current batch of data is being processed for the first time, the Hbase / Es database is directly accessed and queried asynchronously:
[0135] A. If the query is matched, the relevant data is cached in the Redis database and an expiration time is set (the expiration time can also be configured and adjusted);
[0136] B. If the query does not hit, the data enters the pushback module.
[0137] (2) To prevent the same data from being repeatedly written into Redis and causing useless access, a data deduplication module can be added as needed;
[0138] (3) If the data is not processed for the first time, the cache Redis is queried first:
[0139] A. If the query is matched, it can be directly output;
[0140] B. If the query does not hit, then further asynchronously query Hbase / Es.
[0141] The data double-check mechanism gives priority to querying Redis when it is not the first association, and uses short-term and low-space occupancy to reduce the pressure of asynchronous access concurrency of external storage, improve job throughput, and support different stream data through parameterized configuration of expiration time. Personalized configuration can be performed based on its own characteristics.
[0142] By making comprehensive use of the features of Redis cache, Es / Hbase low-cost storage and high concurrent access, it is proposed to use external association to realize event stream association, which greatly reduces the loss of resources, breaks through the resource limitations of real-time operations to a certain extent, improves the stability of operations, data integrity and effectiveness, and provides strong guarantees for relevant real-time scenarios such as retail customer transactions and customer operations. By pushing back the association of stream events, it solves the pain points such as high loss of memory resources caused by stream association, and realizes a low resource occupation, low latency, and highly stable event stream association solution.
[0143] 4. Data pushback: For data that does not meet the pushback conditions, you can enter the abnormal data analysis module and perform analysis based on specific data characteristics and specific business needs.
[0144] like Figure 5 As shown, Figure 5 This is a flow chart of the data pushback mechanism involved in the business processing method of this application. When the data cannot be associated with the external database, the data pushback module is entered. The pushback module constraints support multiple scenarios: pushback time constraints, pushback number constraints, and time period constraints. As shown in the following table, the application can be personalized according to its own needs.
[0145]
[0146] At the same time, an interval time model is designed for the pushback time, and the model basically follows the characteristics of the exponential function:
[0147] y=T×a [n / N]+1 (n≥1)
[0148] Where n represents the number of back-tests, T is the unit interval step, N represents the segment interval step, and [n / N] represents the divisor rounded down.
[0149] For example, Figure 6 As shown, Figure 6 This is a schematic diagram of a sample of the pushback interval trend involved in the business processing method of this application. Taking T=1, a=2, and N=3 as an example, it can be seen that when the data is in the initial stage of pushback, the pushback interval is short. As the number of pushbacks increases, the pushback interval will increase in a segmented exponential manner. By setting the interval step-related parameters T and N, the length and width of the interval can be controlled to meet different pushback interval requirements.
[0150] The design idea of this model is: if the event streams cannot be associated in a short period of time, there is reason to believe that the event streams are not closely related in the time dimension, and the associated time window should be expanded. The segmented design can support the event streams to be associated in a relatively stable frequency within a short time window; and the exponential growth can support the pushback without losing data, and the pushback traffic can be reduced exponentially, so as to achieve the purpose of not occupying the computing resources of the normal associated operators, greatly solve the back pressure caused by the pushback data, and achieve low-latency and high-fidelity output of business data.
[0151] A self-developed multi-scenario, multi-parameter, self-adjusting pushback model has been implemented. The segmented exponential model supports setting different pushback intervals in length and width to achieve adaptive adjustment. It can not only solve the problem of business data loss, but also achieve an exponential reduction in the impact of the pushback event flow on the main processing link.
[0152] Abnormal data can be screened out by setting pushback constraints; through configurable monitoring and analysis of abnormal data, you can quickly gain insight into abnormal situations and respond quickly, implement a data verification mechanism that does not rely on downstream feedback, achieve closed-loop verification of real-time data development, and improve data accuracy.
[0153] 5. Parameter configuration: In addition, it also supports personalized configuration of parameters for each function, including data deduplication, Redis cache time, and abnormal data monitoring rule parameters.
[0154] 6. Can monitor / trace back abnormal data analysis.
[0155] like Figure 7 As shown, Figure 7 This is a sample diagram of the abnormal data monitoring rule configuration interface involved in the business processing method of this application. In order to avoid an infinite closed-loop link caused by pushback, the pushback data that exceeds the constraint range can be determined as abnormal data. For abnormal data, corresponding processing can be performed according to different business concerns:
[0156] A. Traffic monitoring: It can control the traffic of abnormal data, including the number of messages and sudden changes in data volume;
[0157] B. Indicator monitoring: abnormal indicators can be pre-defined during data design and monitored;
[0158] C. Retrospective data analysis: For abnormal data with analysis scenarios, it supports analysis of abnormal data through simple configuration to achieve retrospective analysis of real-time data.
[0159] The above monitoring and analysis of abnormal data can be achieved through configuration operations. Active exception push can reduce the time spent on manual observation in the normal mode. At the same time, it can also detect abnormal situations in the first time, analyze them quickly, and respond quickly.
[0160] In this embodiment, by storing the auxiliary streams in an external database, adopting a data double-check mechanism and a pushback mechanism that adaptively adjusts the pushback time, quasi-real-time event stream association is completed, which can greatly reduce the consumption and dependence of quasi-real-time stream association jobs on memory resources, and improve the stability of the job and the reliability of real-time data.
[0161] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the business processing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0162] This application also provides a business processing device, please refer to Figure 8 , the service processing device comprises:
[0163] A receiving module 10, configured to receive a service processing request;
[0164] The processing module 20 is used to execute the business processing request based on a preset event stream external association relationship to obtain a business processing result. The event stream external association relationship is obtained by performing external data association on multiple event streams to be associated related to the business processing request.
[0165] Optionally, the processing module 20 is further used for:
[0166] External data association is performed on multiple event flows to be associated that are related to the business processing request to obtain external association relations of the event flows.
[0167] Optionally, the processing module 20 is further used for:
[0168] Determine the main event flow and the auxiliary event flow of the business processing request according to the business logic relationship of the multiple event flows to be associated;
[0169] Writing the auxiliary event stream into an external database for storage;
[0170] Based on a preset data double-check mechanism, the main event stream is associated with the auxiliary event stream to obtain an event stream association relationship.
[0171] Optionally, the processing module 20 is further used for:
[0172] When the current stream data of the main event stream is processed for the first time, asynchronously querying the external database according to the current stream data;
[0173] If the external database hits the query, the auxiliary stream data of the auxiliary event stream corresponding to the current stream data in the external database is written into the internal cache database of the business processing platform for storage, so as to associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
[0174] Optionally, the processing module 20 is further used for:
[0175] When the current stream data of the main event stream is not processed for the first time, querying the internal cache database of the business processing platform according to the current stream data;
[0176] If the internal cache database does not hit the query, asynchronously query the external database according to the current stream data;
[0177] If the external database hits the query, the auxiliary stream data of the auxiliary event stream corresponding to the current stream data in the external database is written into the internal cache database for storage, so as to associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
[0178] Optionally, the processing module 20 is further used for:
[0179] Determine whether the main event stream satisfies a preset data back-pushing constraint condition, wherein the data back-pushing constraint condition includes at least one or more of a back-pushing time constraint condition, a back-pushing number constraint condition, and a time period constraint condition;
[0180] If the main event stream meets the data pushback constraint condition, the pushback interval time of the main event stream is calculated by using a preset pushback interval time model;
[0181] If the current system time satisfies the pushback interval, the following steps are performed: based on a preset data double-check mechanism, the main event stream is associated with the auxiliary event stream to obtain an event stream association relationship.
[0182] The business processing device provided by the present application adopts the business processing method in the above embodiment, which can solve the technical problem that the storage of internal associated data of multiple event streams in business processing occupies a large amount of memory and affects the business data processing. Compared with the prior art, the beneficial effects of the business processing device provided by the present application are the same as the beneficial effects of the business processing method provided by the above embodiment, and other technical features in the business processing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0183] The present application provides a business processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the business processing method in the above-mentioned first embodiment.
[0184] Reference below Fig. 9 , which shows a schematic diagram of the structure of a business processing device suitable for implementing the embodiment of the present application. The business processing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The business processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0185] like Fig. 9 As shown, the business processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the business processing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the business processing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a business processing device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0186] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0187] The business processing device provided by the present application adopts the business processing method in the above embodiment, which can solve the technical problem that the storage of internal associated data of multiple event streams in business processing occupies a large amount of memory and affects business data processing. Compared with the prior art, the beneficial effects of the business processing device provided by the present application are the same as the beneficial effects of the business processing method provided by the above embodiment, and other technical features in the business processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0188] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0189] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0190] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the business processing method in the above-mentioned embodiment.
[0191] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0192] The above-mentioned computer-readable storage medium may be included in the business processing device; or it may exist independently without being installed in the business processing device.
[0193] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by a business processing device, the business processing device: receives a business processing request; executes the business processing request based on a preset event flow external association relationship to obtain a business processing result, wherein the event flow external association relationship is obtained by performing external data association on multiple event flows to be associated related to the business processing request.
[0194] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0195] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0196] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0197] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned business processing method, and can solve the technical problem that the storage of internal associated data of multiple event streams in business processing occupies a large amount of memory and affects business data processing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the business processing method provided by the above-mentioned embodiment, and will not be repeated here.
[0198] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned business processing method when executed by a processor.
[0199] The computer program product provided by this application can solve the technical problem that the storage of internal associated data of multiple event streams in business processing occupies a large amount of memory and affects business data processing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the business processing method provided by the above embodiment, and will not be repeated here.
[0200] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A business processing method, characterized in that: The method is applied to a business processing platform, comprising: Receive business processing requests; The business processing request is executed based on a preset event stream external association relationship to obtain a business processing result, wherein the event stream external association relationship is obtained by performing external data association on multiple event streams to be associated related to the business processing request.
2. The method according to claim 1, characterized in that: Before the step of executing the business processing request based on the preset event flow external association relationship to obtain the business processing result, the step further includes: External data association is performed on multiple event flows to be associated that are related to the business processing request to obtain external association relations of the event flows.
3. The method according to claim 2, characterized in that: The step of performing external data association on a plurality of to-be-associated event flows related to the business processing request to obtain external association relationships of the event flows comprises: Determining a main event flow and an auxiliary event flow of the business processing request according to the business logic relationship of the multiple event flows to be associated; Writing the auxiliary event stream into an external database for storage; Based on a preset data double-check mechanism, the main event stream is associated with the auxiliary event stream to obtain an event stream association relationship.
4. The method according to claim 3, characterized in that: The step of associating the main event stream with the auxiliary event stream based on the preset data double-check mechanism to obtain an event stream association relationship includes: When the current stream data of the main event stream is processed for the first time, asynchronously querying the external database according to the current stream data; If the external database hits the query, the auxiliary stream data of the auxiliary event stream corresponding to the current stream data in the external database is written into the internal cache database of the business processing platform for storage, so as to associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
5. The method according to claim 3, characterized in that: The step of associating the main event stream with the auxiliary event stream based on the preset data double-check mechanism to obtain an event stream association relationship includes: When the current stream data of the main event stream is not processed for the first time, querying the internal cache database of the business processing platform according to the current stream data; If the internal cache database does not hit the query, asynchronously query the external database according to the current stream data; If the external database hits the query, the auxiliary stream data of the auxiliary event stream corresponding to the current stream data in the external database is written into the internal cache database for storage, so as to associate the main event stream with the auxiliary event stream to obtain an event stream association relationship.
6. The method according to any one of claims 4 to 5, characterized in that: After the step of asynchronously querying the external database according to the current stream data, the method further includes: Determine whether the main event stream satisfies a preset data back-pushing constraint condition, wherein the data back-pushing constraint condition includes at least one or more of a back-pushing time constraint condition, a back-pushing number constraint condition, and a time period constraint condition; If the main event stream meets the data pushback constraint condition, the pushback interval time of the main event stream is calculated by using a preset pushback interval time model; If the current system time satisfies the pushback interval, the following steps are performed: based on a preset data double-check mechanism, the main event stream is associated with the auxiliary event stream to obtain an event stream association relationship.
7. A service processing device, characterized in that: The device comprises: A receiving module, used for receiving a business processing request; The processing module is used to execute the business processing request based on the preset event flow external association relationship to obtain the business processing result. The event flow external association relationship is obtained by external data association of multiple event flows to be associated related to the business processing request.
8. A service processing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the business processing method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the business processing method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the service processing method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Batch processing method and device of service tables and nonvolatile storage medium
CN112835932A
Unbounded flow data association processing method and device, equipment and storage medium
CN113760903A
Dimension table data processing method and device, electronic equipment and storage medium
CN114356936A
Cited By
Internet of Things event center distributed alarm processing method based on Redis Stream
CN121151183A
