Method, apparatus, storage medium and electronic device for generating target reflow instances
By automatically configuring target reflow instances, the problem of low data reflow processing efficiency caused by manual configuration is solved, and efficient reflow processing adaptable to multiple data types is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO HAIER TECH
- Filing Date
- 2023-03-21
- Publication Date
- 2026-05-26
AI Technical Summary
Manually configured reflow instances result in low efficiency in data reflow processing, are unable to adapt to multiple data types, and are limited by labor costs.
By identifying the business message indicating a business processing failure, a target reflow instance is generated. The initial reflow instance is automatically configured using the configuration information in the preset configuration library, generating target reflow instances suitable for different middleware types, thus achieving automated reflow processing.
It improves the efficiency of data backflow processing, solves the inefficiency caused by manual configuration, and is compatible with backflow processing of various data types.
Smart Images

Figure CN116578618B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and more specifically, to a method, apparatus, storage medium, and electronic device for generating a target return instance. Background Technology
[0002] Currently, as the intelligence level of home appliances in the smart home appliance field increases, the functions they provide are becoming more diversified. Correspondingly, the number of business messages related to home appliances is also increasing daily. In general technical solutions, due to the sequential dependencies of messages in ETL real-time streams, data processing failures may occur when processing messages from different ETL real-time streams of home appliances due to out-of-order input messages. For data that fails to process, reflow processing is required. Currently, for reflow data with multiple processing failures, a separate reflow instance is typically configured manually for each type of failed reflow data. However, this manually configured reflow instance can only adapt to a single data type, and due to limitations in manual labor costs, the efficiency of data reflow processing is low.
[0003] Therefore, in related technologies, there is a technical problem that manually configured backflow instances lead to low efficiency in data backflow processing.
[0004] Regarding the technical problem of low efficiency in data reflow processing caused by manually configured reflow instances, no effective solution has yet been proposed. Summary of the Invention
[0005] This application provides a method, apparatus, storage medium, and electronic device for generating target reflow instances, in order to at least solve the technical problem in the related art of how to solve the low efficiency of data reflow processing caused by manually configured reflow instances.
[0006] According to one embodiment of this application, a method for generating a target backflow instance is provided, comprising: determining an initial backflow instance corresponding to the business message when a business message indicating a business processing failure is detected, wherein the initial backflow instance is a backflow instance without backflow configuration; responding to a configuration instruction of a target object, determining configuration information for configuring the backflow instance from a preset configuration library, and configuring the initial backflow instance using the configuration information to generate a target backflow instance, wherein the target backflow instance is used to determine the backflow processing result after backflow processing of the business message.
[0007] In an exemplary embodiment, after configuring the initial reflow instance using the configuration information to generate a target reflow instance, the method further includes: if it is determined that the instance status of the target reflow instance indicates that the target reflow instance has been enabled, creating a first client corresponding to the target reflow instance; in response to a query instruction from the first client, obtaining the instance name contained in the query instruction; if it is determined that the instance name is consistent with the instance name of the target reflow instance, sending the reflow parameters of the target reflow instance to the first client.
[0008] In an exemplary embodiment, after sending the reflow parameters of the target reflow instance to the first client, the method further includes: if a first notification message from the first client indicating continued reflow is received, then determining that the reflow processing result is incomplete; if a second notification message from the first client indicating termination of reflow is received, then determining that the reflow processing result is complete.
[0009] In an exemplary embodiment, sending the reflow parameters of the target reflow instance to the first client includes: determining a first message middleware interface corresponding to the target reflow instance; establishing a first message channel for transmitting the reflow parameters based on the first message middleware interface; and sending the reflow parameters to the first client through the first message channel; wherein the first message middleware interface allows interfacing with clients of different middleware types.
[0010] In an exemplary embodiment, after configuring the initial reflow instance using the configuration information to generate a target reflow instance, the method further includes: if it is determined that the instance status of the target reflow instance indicates that the target reflow instance has been enabled, creating a second client corresponding to the target reflow instance; obtaining the query result of the second client for the business message; if it is determined that the query result indicates that there is a business message to be reflowed in the business message, and if it is determined that the business message to be reflowed corresponds to the target reflow instance, then determining that the reflow processing result is incomplete.
[0011] In one exemplary embodiment, obtaining the query result of the second client for the business message includes: determining the second message middleware interface corresponding to the target backflow instance; establishing a second message channel for transmitting the query result based on the second message middleware interface; and receiving the query result transmitted through the second message channel; wherein the second message middleware interface allows connection to clients of different middleware types.
[0012] In an exemplary embodiment, after configuring the initial reflow instance using the configuration information to generate a target reflow instance, the method further includes: destroying the first client corresponding to the target reflow instance if the instance status of the target reflow instance indicates that the target reflow instance has ended its activation; and determining that the reflow processing result is complete if a third notification message indicating that the first client has been successfully destroyed is received.
[0013] In an exemplary embodiment, after configuring the initial reflow instance using the configuration information to generate a target reflow instance, the method further includes: destroying the second client corresponding to the target reflow instance if the instance status of the target reflow instance indicates that the target reflow instance has ended its activation; and determining that the reflow processing result is complete if a fourth notification message indicating that the second client has been successfully destroyed is received.
[0014] In an exemplary embodiment, configuring the initial backflow instance using the configuration information includes: determining a preset backflow count and an initial backflow time interval for the initial backflow instance from the preset configuration library; if the preset backflow count is not greater than a preset threshold, setting an increment time for the backflow interval based on the difference between the preset backflow count and the preset threshold, and determining the backflow time interval for the target backflow instance based on the sum of the initial backflow time interval and the increment time; if the preset backflow count is greater than the preset threshold, setting the backflow interval to a default increment time, and determining the backflow time interval for the target backflow instance based on the sum of the initial backflow time interval and the default increment time.
[0015] According to another aspect of the embodiments of this application, a target reflow instance generation apparatus is also provided, characterized in that it includes: a determining module, configured to determine an initial reflow instance corresponding to a business message when a business message indicating a business processing failure is detected, wherein the initial reflow instance is a reflow instance without reflow configuration; and a configuration module, configured to determine configuration information for configuring the reflow instance from a preset configuration library in response to a configuration instruction of a target object, and configure the initial reflow instance using the configuration information to generate a target reflow instance, wherein the target reflow instance is used to determine the reflow processing result after reflow processing of the business message.
[0016] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method for generating the target reflow instance at runtime.
[0017] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described method for generating a target reflow instance through the computer program.
[0018] In this embodiment, when a business message indicating a business processing failure is detected, an initial backflow instance corresponding to the business message can be determined. Then, in response to the configuration instructions of the target object, configuration information for configuring the backflow instance is determined from a preset configuration library, and the initial backflow instance is configured using the configuration information to generate a target backflow instance for determining the backflow processing result after backflow processing of the business message. By adopting the above technical solution, the technical problem of low efficiency in data backflow processing caused by manually configured backflow instances is solved, thereby improving the efficiency of data backflow processing. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of the hardware environment for a method of generating a target reflow instance according to an embodiment of this application;
[0022] Figure 2 This is a flowchart of a method for generating a target reflow instance according to an embodiment of this application;
[0023] Figure 3 This is a flowchart illustrating the process of using a target reflow instance to process reflow messages in an embodiment of this application.
[0024] Figure 4 This is a schematic diagram illustrating the number of retries according to an embodiment of this application;
[0025] Figure 5 This is a structural block diagram (a) of a device for generating a target reflow instance according to an embodiment of this application;
[0026] Figure 6 This is a structural block diagram (II) of a device for generating a target reflow instance according to an embodiment of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] Next, some technical terms in the embodiments of this application will be explained through the following examples:
[0030] MQ stands for Message Queue, a message queue middleware used to provide functions such as message subscription, storage, and publishing, such as Kafka and RocketMQ. Some types of MQ clients only support a limited number of repeated deliveries.
[0031] Real-time computing frameworks, such as Flink and Spark, perform data ETL processing on real-time consumed messages.
[0032] ETL: Used to describe the process of extracting, transforming, and loading data from the source to the destination.
[0033] According to one aspect of the embodiments of this application, a method for generating a target reflow instance is provided. This method for generating a target reflow instance is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for generating a target reflow instance can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0034] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0035] This embodiment provides a method for generating a target reflow instance, applied to the aforementioned terminal device. Figure 2 This is a flowchart of a method for generating a target reflow instance according to an embodiment of this application. The process includes the following steps:
[0036] Step S202: If a business message indicating a business processing failure is detected, determine the initial reflow instance corresponding to the business message, wherein the initial reflow instance is a reflow instance that has not been configured for reflow.
[0037] Step S204: In response to the configuration instruction of the target object, the configuration information for configuring the backflow instance is determined from the preset configuration library, and the initial backflow instance is configured using the configuration information to generate the target backflow instance, wherein the target backflow instance is used to determine the backflow processing result after the business message has been backflow processed.
[0038] Through the above steps, when a business message indicating a business processing failure is detected, an initial backflow instance corresponding to the business message is determined. Then, in response to the configuration instructions of the target object, configuration information for configuring the backflow instance is determined from a preset configuration library, and the initial backflow instance is configured using the configuration information to generate a target backflow instance for determining the backflow processing result after backflow processing of the business message. By adopting the above technical solution, the technical problem of low efficiency in data backflow processing caused by manually configured backflow instances is solved, thereby improving the efficiency of data backflow processing.
[0039] In an exemplary embodiment, after completing the above step S204 of configuring the initial reflow instance using the configuration information to generate the target reflow instance, a first client corresponding to the target reflow instance can be created if the instance status of the target reflow instance indicates that the target reflow instance has been enabled; in response to a query instruction from the first client, the instance name contained in the query instruction is obtained; if the instance name is determined to be consistent with the instance name of the target reflow instance, the reflow parameters of the target reflow instance are sent to the first client.
[0040] It should be noted that the aforementioned reflow parameters may include, for example, the number of reflows and the reflow time interval, but are not limited to these.
[0041] In an exemplary embodiment, after sending the reflow parameters of the target reflow instance to the first client, the following technical solution is further proposed: if a first notification message indicating continued reflow is received from the first client, the reflow processing result is determined to be incomplete; if a second notification message indicating termination of reflow is received from the first client, the reflow processing result is determined to be complete.
[0042] In an exemplary embodiment, the process of sending the reflow parameters of the target reflow instance to the first client is described by the following steps, specifically including: determining the first message middleware interface corresponding to the target reflow instance; establishing a first message channel for transmitting the reflow parameters based on the first message middleware interface; and sending the reflow parameters to the first client through the first message channel; wherein the first message middleware interface allows connection to clients of different middleware types.
[0043] In an exemplary embodiment, further, after configuring the initial reflow instance using the configuration information to generate the target reflow instance, the following technical solution is proposed: when it is determined that the instance status of the target reflow instance indicates that the target reflow instance has been enabled, a second client corresponding to the target reflow instance is created; the query result of the second client on the business message is obtained; when it is determined that the query result indicates that there is a business message to be reflowed in the business message, if it is determined that the business message to be reflowed corresponds to the target reflow instance, then the reflow processing result is determined to be incomplete.
[0044] Optionally, if the query result indicates that there are no business messages to be reflowed in the business messages, the reflow processing result is determined to be complete.
[0045] In one exemplary embodiment, a further proposed implementation process for obtaining the query results of the second client for the business message is provided, which specifically includes the following steps: determining the second message middleware interface corresponding to the target backflow instance; establishing a second message channel for transmitting the query results based on the second message middleware interface; receiving the query results transmitted through the second message channel; wherein, the second message middleware interface allows connection to clients of different middleware types.
[0046] In an exemplary embodiment, after configuring the initial reflow instance using the configuration information to generate the target reflow instance, other technical solutions are further proposed. The specific steps include: destroying the first client corresponding to the target reflow instance when the instance status of the target reflow instance indicates that the target reflow instance has ended its activation; and determining that the reflow processing result is complete if a third notification message indicating that the first client has been successfully destroyed is received.
[0047] In an exemplary embodiment, further, after configuring the initial reflow instance using the configuration information to generate the target reflow instance, the second client corresponding to the target reflow instance can be destroyed if the instance status indicates that the target reflow instance has ended its activation; if a fourth notification message indicating that the second client has been successfully destroyed is received, the reflow processing result is determined to be complete.
[0048] In an exemplary embodiment, the process of configuring the initial backflow instance using the configuration information in step S206 specifically includes the following steps: determining the preset backflow count and the initial backflow time interval of the initial backflow instance from the preset configuration library; if the preset backflow count is not greater than a preset threshold, setting the increment time of the backflow interval based on the difference between the preset backflow count and the preset threshold, and determining the backflow time interval of the target backflow instance based on the sum of the initial backflow time interval and the increment time; if the preset backflow count is greater than the preset threshold, setting the backflow interval time to a default increment time, and determining the backflow time interval of the target backflow instance based on the sum of the initial backflow time interval and the default increment time.
[0049] In setting the increment time of the recirculation interval based on the difference between the preset recirculation number and the preset threshold, for example, the increment time of the recirculation interval can be set to increase as the difference between the preset recirculation number and the preset threshold increases, or the increment time of the recirculation interval can be set to decrease as the difference between the preset recirculation number and the preset threshold decreases. This application does not limit this.
[0050] In an optional embodiment, the preset number of reflows can also be directly determined as the number of reflows for the target reflow instance.
[0051] To better understand the process of generating the target reflow instance described above, the implementation flow of generating the target reflow instance will be further explained below with reference to optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.
[0052] This embodiment provides a method for processing reflow messages using a target reflow instance. Figure 3 This is a schematic diagram illustrating the process of using a target reflow instance to process reflow messages according to an embodiment of this application, such as... Figure 3 As shown, it includes the following modules:
[0053] Module 1, reflux-config, is a message recirculation strategy configuration module used to provide message recirculation strategy query, configuration, and start / stop functions. After the recirculation instance (i.e., the target recirculation instance mentioned above) is started or stopped: it notifies reflux-processor to create or destroy the message consumption client of the recirculation instance; and it notifies reflux-scheduler to create or destroy the message sending client of the recirculation instance.
[0054] Module 1 is also used to configure the target reflux instance.
[0055] Module 2, reflux-core, is the core module of the message reflux system. It provides a unified interface for message consumption and production, enabling different types of MQ middleware to send and receive messages. It is provided as an SDK.
[0056] Module 3, reflux-processor, is the message reflow system processing module. It listens for messages to be reflowed from business processes, determines whether the message needs to be reflowed based on the reflow strategy, calculates the time of the next reflow, and persists the data to the database. Message consumption relies on the unified message consumption interface provided by reflux-core.
[0057] Module 4, reflux-scheduler, is the reflux message sending scheduler module. It is used to continuously query messages waiting to be refluxed and push them to the message queue (MQ). Message push relies on the unified message production interface provided by reflux-core.
[0058] Module 5, reflux-search, is a problem tracing module used to support the retrieval of data that has failed to be processed properly after exceeding the number of reflow attempts, for use in problem tracing.
[0059] The specific implementation process is as follows:
[0060] Step 1: In the upstream message queue, the original upstream business message is as follows:
[0061]
[0062] Step 2, business logic processing, which means starting to consume messages from the message queue in Step 1 and performing business processing.
[0063] Step 3: Confirm successful business processing.
[0064] Step 4: Determine if the business processing failed, encapsulate the original message into a return message, and then push it to the message queue in Step 5.
[0065] It should be noted that other data relied upon in step 2 may fail to process due to delays, inability to find processing results, or abnormal program processing.
[0066] In one embodiment, the procedure for encapsulating the original message into a data return message body (i.e., the message to be returned mentioned above) is as follows:
[0067]
[0068]
[0069] Step 5: Store the callback message pushed after the business processing fails.
[0070] Step 6: The message backflow system consumes the message msg to be backflowed from the message queue in Step 5.
[0071] Step 7: Parse the message to be reflowed (msg) to obtain the reflow instance name (caseName) and the original message body (message).
[0072] Step 8: Based on the reflow instance name caseName parsed in Step 7, query the reflow policy cache, obtain the reflow policy configuration of the reflow instance, and calculate the maximum number of reflows for the reflow instance.
[0073] Step 9: Calculate the number of reflows: Parse the number of times the message has been reflowed from the message body to be reflowed, i.e., reflux.times. The message body to be reflowed is shown below:
[0074]
[0075] Step 10: Based on the number of reflows calculated in Step 9 and the upper limit of the number of reflows calculated in Step 8, determine whether further reflows are needed.
[0076] Step 11: If further reflow is required, calculate the next reflow time and persist it to the database: Calculate the next reflow time based on the reflow strategy obtained in Step 8, and then add 1 to the reflow count calculated in Step 9 and backfill it into the original message. The final structure persisted to the database is shown below:
[0077]
[0078] Step 12: If no further reflow is needed, i.e., if the reflow is stopped, save the original message body from Step 7 to the exception data table corresponding to the reflow instance for business problem tracing and querying.
[0079] Furthermore, reflow can also be achieved through scheduled tasks, specifically:
[0080] Step 13: Trigger the scheduled task for each reflow instance.
[0081] Step 14: The scheduled task will continuously query the original messages waiting to be retransmitted in the DB.
[0082] Step 15: Call the unified message sending interface provided by reflux-core to push the queried data to be returned to the message queue in Step 16.
[0083] Step 16: The business process will continuously consume this MQ.
[0084] It should be noted that the reflow strategy can also be configured through the following steps:
[0085] Step 17: Create a reflow instance configuration.
[0086] Step 18: Query the detailed configuration information of the reflow instance.
[0087] Step 19: Enable or disable reflow instance configuration.
[0088] Step 20: When enabling reflux instances: It is necessary to notify reflux-processor and reflux-scheduler to create an MQ client, which is provided by the unified message production and sending interface provided by reflux-core.
[0089] Step 21: When shutting down the reflux instance: It is necessary to notify reflux-processor and reflux-scheduler to destroy the MQ client, which is a unified message production and sending interface provided by reflux-core.
[0090] Furthermore, in one embodiment, such as Figure 4 As shown, the message retry system supports multiple retry cycles. When configuring a retry instance, the maximum number of retries can be configured, with a default value of 16. There is no maximum limit to this parameter's value, but the default value is recommended. The interval time varies in steps based on the number of retries, ranging from 1 second to 2 hours. If the maximum number of retries is less than or equal to 16, the interval time varies in steps according to the retry interval time for unordered messages. If the maximum number of retries is greater than 16, the interval time for retries exceeding 16 is 2 hours.
[0091] Through the above embodiments, this application implements the message sending and receiving logic for different types of message queues (MQ) internally through the message return system, and uses return instances to implement message return, thereby resubmitting processed abnormal messages (i.e., business messages that failed to process as described above). Based on the abnormal data persistence function, messages that still fail to process after resubmission are permanently persisted. Simultaneously, retrieval of persisted messages can be provided to trace the source of the problem. Furthermore, addressing the issue that current message return mechanisms do not support dynamic adjustment of return strategies, this application can update the configuration periodically based on the latest configuration data in the database after updating the return strategy, thereby achieving dynamic configuration adjustment without restarting the business ETL process.
[0092] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0093] Figure 5 This is a structural block diagram (a) of a device for generating a target reflow instance according to an embodiment of this application; as shown... Figure 5 As shown, it includes:
[0094] The determination module 42 is used to determine the initial reflow instance corresponding to the business message when it is determined that a business message of business processing failure has been detected, wherein the initial reflow instance is a reflow instance that has not been configured for reflow.
[0095] The configuration module 44 is used to respond to the configuration instructions of the target object, determine the configuration information for configuring the backflow instance from the preset configuration library, and use the configuration information to configure the initial backflow instance to generate a target backflow instance, wherein the target backflow instance is used to determine the backflow processing result after backflow processing of the business message.
[0096] Using the aforementioned device, upon detecting a business message indicating a processing failure, an initial backflow instance corresponding to the business message is determined. Then, in response to the configuration command of the target object, configuration information for configuring the backflow instance is determined from a preset configuration library, and the initial backflow instance is configured using this configuration information to generate a target backflow instance for determining the backflow processing result after processing the business message. This solves the technical problem in related technologies where manually configured backflow instances lead to low efficiency in data backflow processing, thereby improving the efficiency of data backflow processing.
[0097] In an exemplary embodiment, the above-mentioned target reflow instance generation apparatus further includes: a first creation module, configured to create a first client corresponding to the target reflow instance when it is determined that the instance status of the target reflow instance indicates that the target reflow instance has been enabled; in response to a query instruction from the first client, obtain the instance name contained in the query instruction; and when it is determined that the instance name is consistent with the instance name of the target reflow instance, send the reflow parameters of the target reflow instance to the first client.
[0098] In an exemplary embodiment, the first creation module is further configured to: determine that the reflow processing result is incomplete if a first notification message from the first client indicating continued reflow is received; and determine that the reflow processing result is complete if a second notification message from the first client indicating termination of reflow is received.
[0099] In an exemplary embodiment, the first creation module is further configured to: determine a first message middleware interface corresponding to the target backflow instance; establish a first message channel for transmitting the backflow parameters based on the first message middleware interface; and send the backflow parameters to the first client through the first message channel; wherein the first message middleware interface allows connection to clients of different middleware types.
[0100] In an exemplary embodiment, the above-mentioned target reflow instance generation apparatus further includes: a second creation module, configured to: create a second client corresponding to the target reflow instance when it is determined that the instance status of the target reflow instance indicates that the target reflow instance has been enabled; obtain the query result of the second client on the business message; and, if it is determined that the query result indicates that there is a business message to be reflowed in the business message, and if it is determined that the business message to be reflowed corresponds to the target reflow instance, determine that the reflow processing result is incomplete.
[0101] In an exemplary embodiment, the second creation module is further configured to: determine the second message middleware interface corresponding to the target backflow instance; establish a second message channel for transmitting the query result based on the second message middleware interface; and receive the query result transmitted through the second message channel; wherein the second message middleware interface allows connection to clients of different middleware types.
[0102] In an exemplary embodiment, the above-mentioned target reflow instance generation apparatus further includes: a first destruction module, configured to destroy the first client corresponding to the target reflow instance when it is determined that the instance status of the target reflow instance indicates that the target reflow instance has ended its activation; and if a third notification message indicating that the first client has been successfully destroyed is received, the reflow processing result is determined to be complete.
[0103] In an exemplary embodiment, the above-mentioned target reflow instance generation apparatus further includes: a second destruction module, configured to destroy the second client corresponding to the target reflow instance when the instance status of the target reflow instance indicates that the target reflow instance has ended its activation; and if a fourth notification message indicating that the second client has been successfully destroyed is received, the reflow processing result is determined to be complete.
[0104] Figure 6 This is a structural block diagram (II) of a device for generating a target reflow instance according to an embodiment of this application; as shown Figure 6 As shown, the configuration module 44 includes: a setting unit 52, configured to determine from the preset configuration library the preset number of reflows for the initial reflow instance and the initial reflow time interval for the initial reflow instance; if the preset number of reflows is not greater than a preset threshold, set the increment time of the reflow interval based on the difference between the preset number of reflows and the preset threshold, and determine the reflow time interval of the target reflow instance based on the sum of the initial reflow time interval and the increment time; if the preset number of reflows is greater than the preset threshold, set the reflow interval time to a default increment time, and determine the reflow time interval of the target reflow instance based on the sum of the initial reflow time interval and the default increment time.
[0105] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0106] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0107] S1, if a business message indicating a business processing failure is detected, determine the initial reflow instance corresponding to the business message, wherein the initial reflow instance is a reflow instance that has not been configured for reflow.
[0108] S2, in response to the configuration command of the target object, determine the configuration information for configuring the backflow instance from the preset configuration library, and use the configuration information to configure the initial backflow instance to generate a target backflow instance, wherein the target backflow instance is used to determine the backflow processing result after backflow processing of the business message.
[0109] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0110] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0111] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0112] S1, if a business message indicating a business processing failure is detected, determine the initial reflow instance corresponding to the business message, wherein the initial reflow instance is a reflow instance that has not been configured for reflow.
[0113] S2, in response to the configuration command of the target object, determine the configuration information for configuring the backflow instance from the preset configuration library, and use the configuration information to configure the initial backflow instance to generate a target backflow instance, wherein the target backflow instance is used to determine the backflow processing result after backflow processing of the business message.
[0114] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0115] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0116] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0117] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for generating a target reflow instance, characterized in that, include: If a business message indicating a business processing failure is detected, the initial reflow instance corresponding to the business message is determined, wherein the initial reflow instance is a reflow instance that has not been configured for reflow. In response to the configuration instructions of the target object, configuration information for configuring the backflow instance is determined from the preset configuration library, and the initial backflow instance is configured using the configuration information to generate a target backflow instance, wherein the target backflow instance is used to determine the backflow processing result after backflow processing of the business message; The step of configuring the initial reflow instance using the configuration information includes: The preset number of reflows and the initial reflow time interval of the initial reflow instance are determined from the preset configuration library. If the preset number of reflows is not greater than a preset threshold, the increment time of the reflow interval is set based on the difference between the preset number of reflows and the preset threshold, and the reflow time interval of the target reflow instance is determined based on the sum of the initial reflow time interval and the increment time. If the preset number of reflows is greater than the preset threshold, the reflow interval is set to a default increment time, and the reflow time interval of the target reflow instance is determined based on the sum of the initial reflow time interval and the default increment time.
2. The method for generating a target reflow instance according to claim 1, characterized in that, After configuring the initial reflow instance using the configuration information to generate the target reflow instance, the method further includes: If the instance status of the target reflow instance indicates that the target reflow instance has been enabled, a first client corresponding to the target reflow instance is created. In response to the query command from the first client, obtain the instance name contained in the query command; If it is determined that the instance name is consistent with the instance name of the target reflow instance, the reflow parameters of the target reflow instance are sent to the first client.
3. The method for generating a target reflow instance according to claim 2, characterized in that, After sending the reflow parameters of the target reflow instance to the first client, the method further includes: If a first notification message from the first client indicating that the reflow should continue is received, then the result of the reflow process is determined to be incomplete. If a second notification message from the first client indicating the end of the reflow is received, the reflow process is determined to be complete.
4. The method for generating a target reflow instance according to claim 2, characterized in that, Sending the reflow parameters of the target reflow instance to the first client includes: Determine the first message middleware interface corresponding to the target backflow instance; A first message channel for transmitting the return parameters is established based on the first message middleware interface; The return parameters are sent to the first client through the first message channel; The first message middleware interface allows for connection to clients of different middleware types.
5. The method for generating a target reflow instance according to claim 1, characterized in that, After configuring the initial reflow instance using the configuration information to generate the target reflow instance, the method further includes: If the instance status of the target reflow instance indicates that the target reflow instance has been enabled, a second client corresponding to the target reflow instance is created. Obtain the query results of the second client for the business message; If the query result indicates that there is a business message in the business message that needs to be reflowed, and if it is determined that the business message to be reflowed corresponds to the target reflow instance, then the reflow processing result is determined to be incomplete.
6. The method for generating a target reflow instance according to claim 5, characterized in that, Obtaining the query results of the second client for the business message includes: Determine the second message middleware interface corresponding to the target backflow instance; A second message channel for transmitting the query results is established based on the second message middleware interface; Receive the query result transmitted through the second message channel; The second message middleware interface allows for connection to clients of different middleware types.
7. The method for generating a target reflow instance according to claim 1, characterized in that, After configuring the initial reflow instance using the configuration information to generate the target reflow instance, the method further includes: If the instance status of the target reflow instance indicates that the target reflow instance has ended its activation, the first client corresponding to the target reflow instance is destroyed. If a third notification message indicating that the first client has been successfully destroyed is received, the return processing result is determined to be complete.
8. The method for generating a target reflow instance according to claim 1, characterized in that, After configuring the initial reflow instance using the configuration information to generate the target reflow instance, the method further includes: If the instance status of the target reflow instance indicates that the target reflow instance has ended its activation, the second client corresponding to the target reflow instance is destroyed. If a fourth notification message indicating that the second client has been successfully destroyed is received, the reflow process is determined to be complete.
9. An apparatus for generating a target reflow instance, characterized in that, include: The determination module is used to determine the initial reflow instance corresponding to the business message when a business message indicating a business processing failure is detected. The initial reflow instance is a reflow instance that has not been configured for reflow. The configuration module is used to respond to the configuration instructions of the target object, determine the configuration information for configuring the backflow instance from the preset configuration library, and use the configuration information to configure the initial backflow instance to generate a target backflow instance, wherein the target backflow instance is used to determine the backflow processing result after backflow processing of the business message; The configuration module is further configured to: The preset number of reflows and the initial reflow time interval of the initial reflow instance are determined from the preset configuration library. If the preset number of reflows is not greater than a preset threshold, the increment time of the reflow interval is set based on the difference between the preset number of reflows and the preset threshold, and the reflow time interval of the target reflow instance is determined based on the sum of the initial reflow time interval and the increment time. If the preset number of reflows is greater than the preset threshold, the reflow interval is set to a default increment time, and the reflow time interval of the target reflow instance is determined based on the sum of the initial reflow time interval and the default increment time.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 8 through the computer program.