Message calling and sending method, device, equipment, medium and program product
By monitoring message middleware and predetermined rules to filter messages, efficient message calling and sending between business systems is realized, which solves the problem of heavy workload of data migration and rewriting, and improves the system's message processing efficiency and resource utilization.
Patent Information
- Application Number
- CN202410660579.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-20
AI Technical Summary
In the existing technology, data migration and rewriting between business systems requires a large workload, and data needs to be migrated frequently when data changes, resulting in a waste of resources and an unnecessary increase in workload.
By monitoring the target partition message change dynamics in the message middleware, the initial business message is obtained, and the target business message associated with the business to be processed is determined based on predetermined rules to achieve load-balanced message invocation and sending, reduce workload and improve message processing. rate.
It effectively reduces the workload of message calling and sending between business systems, increases the message processing rate, reduces memory consumption, and reduces the risk of message loss through load balancing.
Smart Images

Figure CN118672802A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of computer technology and financial technology, and specifically to a message calling and message sending method, device, equipment, medium and program product. Background Art
[0002] With the transformation and development of technology, there are often multiple business systems within the same enterprise. Due to the different implementation methods of different business systems, multiple different business systems are incompatible with each other, and there may be problems with the data between different business systems being unreliable.
[0003] In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: in the traditional technology, the workload of migrating and rewriting all data from one business system to another business system in a short period of time is too large. And as long as there is a change in data, data migration and rewriting are required, which increases the workload and causes unnecessary waste of resources. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a message calling and message sending method, apparatus, device, medium and program product.
[0005] According to a first aspect of the present disclosure, a message calling method is provided, comprising:
[0006] Monitor the message change dynamics of the target partition in the message middleware. The message change dynamics are used to indicate whether the message in the target partition has changed.
[0007] In the case where the message in the target partition is changed, a plurality of changed initial business messages are obtained from the target partition, wherein the plurality of initial business messages are generated by a second business system and sent to the target partition, and the second business system is an upstream business system of the first business system;
[0008] Based on a first predetermined rule, determining M target service messages associated with at least one first to-be-processed service in the first service system from the plurality of initial service messages;
[0009] Invoke M target business messages from the target partition.
[0010] According to an embodiment of the present disclosure, the first predetermined rule includes a corresponding relationship between a service message and a first service to be processed.
[0011] Based on a first predetermined rule, determining M target service messages associated with at least one first to-be-processed service in a first service system from a plurality of initial service messages includes:
[0012] Determining whether each initial service message is a service message required for executing the first service to be processed;
[0013] In a case where the at least one initial service message is a service message required for executing the first service to be processed, the at least one initial service message is determined as a target service message.
[0014] According to an embodiment of the present disclosure, the first business system includes a plurality of first containers, and the plurality of first to-be-processed businesses are executed on the plurality of first containers;
[0015] Call M target business messages from the target partition, including:
[0016] In response to the instruction sent by the first load balancer, the M target service messages in the target partition are called to different first containers, so as to achieve load balancing when executing multiple first services to be processed in the first service system.
[0017] According to an embodiment of the present disclosure, the message calling method further includes:
[0018] At least one first to-be-processed service is executed according to the M target service messages.
[0019] According to an embodiment of the present disclosure, executing at least one first to-be-processed service according to M target service messages includes:
[0020] Acquire a distributed lock for executing at least one first pending business according to the identification information and timestamps of calling the M target business messages;
[0021] When the distributed lock is successfully acquired, at least one first pending business is executed;
[0022] In the case where the distributed lock is not successfully acquired, the M target business messages are written into a message failure compensation table, wherein the message failure compensation table is stored in the first business system.
[0023] A second aspect of the present disclosure provides a message sending method, including:
[0024] In response to the service request for executing the second service to be processed, executing the second service to be processed;
[0025] Generate multiple initial service messages according to the execution result of the second service to be processed;
[0026] Send multiple initial business messages to the target partition of the message middleware.
[0027] According to an embodiment of the present disclosure, the message sending method further includes:
[0028] receiving feedback information from the target partition for the plurality of initial business messages;
[0029] Determine the sending result based on the feedback information.
[0030] According to an embodiment of the present disclosure, determining a sending result according to feedback information includes:
[0031] In the case where no feedback information is received, resending at least one initial service message to the target partition;
[0032] When feedback information is received, it is determined whether the feedback information is sent successfully or failed.
[0033] According to an embodiment of the present disclosure, when feedback information is received, judging whether the feedback information is sent successfully or failed to be sent includes:
[0034] When the feedback information is a sending failure, writing at least one initial service message into a message failure compensation table, wherein the message failure compensation table is stored in the second service system;
[0035] At least one initial service message stored in the message failure compensation table is resent to the target partition within a predetermined time.
[0036] According to an embodiment of the present disclosure, the second business system includes multiple second containers, and multiple second to-be-processed businesses are executed on the multiple second containers.
[0037] Before executing the second pending service, the message sending method further includes:
[0038] In response to the instruction sent by the second load balancer, the plurality of second services to be processed are allocated to different second containers, so as to achieve load balancing when the plurality of second services to be processed are executed in the second service system.
[0039] A third aspect of the present disclosure provides a message calling device, including:
[0040] A monitoring module is used to monitor the message change dynamics of the target partition in the message middleware. The message change dynamics are used to indicate whether the message in the target partition has changed;
[0041] an acquisition module, configured to acquire, when a message in a target partition changes, a plurality of changed initial business messages from the target partition, wherein the plurality of initial business messages are generated by a second business system and sent to the target partition, and the second business system is an upstream business system of the first business system; and
[0042] The first determination module is used to determine, based on a first predetermined rule, M target service messages associated with at least one first to-be-processed service in the first service system from a plurality of initial service messages.
[0043] The calling module is used to call M target business messages from the target partition.
[0044] A fourth aspect of the present disclosure provides a message sending device, including:
[0045] A second execution module, configured to execute the second pending service in response to a service request for executing the second pending service;
[0046] A generating module, configured to generate a plurality of initial service messages according to the execution result of the second service to be processed; and
[0047] The sending module is used to send multiple initial business messages to the target partition of the message middleware.
[0048] A fifth aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0049] The sixth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.
[0050] The seventh aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.
[0051] According to the embodiments of the present disclosure, the connection between the second business system and the first business system is realized by adopting the message middleware, and the first business system is used as the message consumer. By monitoring the target partition in the message middleware, the message change dynamics in the partition are obtained in time, so as to realize the acquisition of messages from the upstream system (the second business system); further, the initial business message is screened and distinguished by the first predetermined rule pre-configured in the system to determine the target business message associated with the execution of the first business to be processed among multiple initial business messages, and only the associated initial business message is called, which not only provides a data basis for the first business to be processed, but also reduces the workload of the first business system for calling messages, indirectly improving the message processing rate of the first business system, and further, there is no need to call the initial business message that is not related to the first business to be processed to the first business system, thereby reducing the memory consumption of the first business system.
[0052] According to the embodiments of the present disclosure, the connection between the first business system and the second business system is realized by adopting the message middleware, and the second business system is used as the message producer. By sending messages to the target partition in the message middleware, the messages in the second business system are delivered through the message middleware, so that the second business system can obtain the messages in the partition in time and realize the acquisition of the messages of the upstream system (the second business system); further, the load balancer configured on the message middleware is used to realize the load balancing in the partitions of the message middleware, so as to avoid overloading of some partitions while other partitions are idle, and reduce the risk of message loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The above contents and other purposes, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0054] Figure 1 The application scenario diagram schematically shows the message calling method and message sending method, message calling, message sending apparatus, device, medium and program product according to the embodiments of the present disclosure;
[0055] Figure 2 A flowchart of a message calling method according to an embodiment of the present disclosure is shown;
[0056] Figure 3 The structure diagram of the message calling method according to the embodiment of the present disclosure is schematically shown;
[0057] Figure 4 The flowchart of determining the target service message according to the embodiment of the present disclosure is schematically shown;
[0058] Figure 5 A flowchart of executing a first to-be-processed business according to an embodiment of the present disclosure is schematically shown;
[0059] Figure 6 The flowchart of the message calling method according to the embodiment of the present disclosure is schematically shown;
[0060] Figure 7 The flowchart of determining the sending result according to an embodiment of the present disclosure is schematically shown;
[0061] Figure 8 The structure diagram of resending a failed message according to an embodiment of the present disclosure is schematically shown;
[0062] Fig. 9 The structural block diagram of the message calling device according to the embodiment of the present disclosure is schematically shown;
[0063] Fig.10A structural block diagram of a message sending device according to an embodiment of the present disclosure is schematically shown; and
[0064] Fig.11 A block diagram of an electronic device suitable for implementing a message calling and message sending method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0065] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0066] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0067] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0068] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0069] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0070] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.
[0071] The message calling and message sending methods and the message calling and message sending devices in the embodiments of the present disclosure can be used in the fields of computer technology and financial technology, and can also be used in any field other than the fields of computer technology and financial technology. The application fields of the message calling and message sending methods and the message calling and message sending devices in the embodiments of the present disclosure are not limited.
[0072] In the face of the current transformation and upgrading of enterprises, the original business system needs to be changed or updated. However, the updated system is often implemented differently from the original system, resulting in incompatibility between the two systems. For example, the updated system (first business system) uses remote procedure call (RPC) to implement message calls, and the original system (second business system) implements message calls through hypertext transfer protocol (HTTP). However, the pending business in the first business system often depends on the business messages in the upstream system (second business system) or the execution results in the upstream system (second business system).
[0073] The embodiment of the present disclosure provides a message calling method, which implements message calling between different frameworks by using message middleware, wherein the message calling method is applied to a first business system, and the first business system serves as a message consumer, and the method includes:
[0074] Monitor the message change dynamics of the target partition in the message middleware. The message change dynamics are used to indicate whether the message in the target partition has changed.
[0075] In the case where the message in the target partition is changed, a plurality of changed initial business messages are obtained from the target partition, wherein the plurality of initial business messages are generated by a second business system and sent to the target partition, and the second business system is an upstream business system of the first business system;
[0076] Based on a first predetermined rule, determining M target service messages associated with at least one first to-be-processed service in the first service system from the plurality of initial service messages;
[0077] Invoke M target business messages from the target partition.
[0078] The embodiment of the present disclosure further provides a message sending method. Similarly, message notification between different frameworks is implemented by using message middleware. The message sending method is applied to the second business system, and the second business system acts as a message producer. The method includes:
[0079] In response to the service request for executing the second service to be processed, executing the second service to be processed;
[0080] Generate multiple initial service messages according to the execution result of the second service to be processed;
[0081] Send multiple initial business messages to the target partition of the message middleware.
[0082] Figure 1 The application scenario diagram of the message call according to the embodiment of the present disclosure is schematically shown.
[0083] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a second business system 101, a first business system 102 and a message middleware (eg, a kafka cluster) 103. The message middleware 103 is used to implement message transmission between the first business system 102 and the second business system 101.
[0084] The second business system 101 can send messages to the message middleware 103, and the first business system 102 can read messages from the message middleware 103. The interaction between the two is performed through the message middleware 103, thereby reducing the coupling degree of the system.
[0085] The first business system 102 and the second business system 101 may be servers that provide various services, such as a backend management server that supports websites browsed by users using terminal devices (only as an example). The backend management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, messages, or data obtained or generated according to user requests) to the terminal device.
[0086] It should be noted that the message calling method provided in the embodiment of the present disclosure can generally be executed by the first business system 102. Accordingly, the message calling device provided in the embodiment of the present disclosure can generally be set in the first business system 102. The message calling method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the first business system 102 and can communicate with the message middleware 103. Accordingly, the message calling device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the first business system 102 and can communicate with the message middleware 103.
[0087] Similarly, the message sending method provided in the embodiment of the present disclosure can generally be executed by the second business system 101. Accordingly, the message sending device provided in the embodiment of the present disclosure can generally be set in the second business system 101. The message sending method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the second business system 101 and can communicate with the message middleware 103. Accordingly, the message sending device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the second business system 101 and can communicate with the message middleware 103.
[0088] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0089] The following will be based on Figure 1 The scene described by Figure 2~Figure 8 The message calling and message sending methods of the disclosed embodiment are described in detail.
[0090] Figure 2 The flowchart of the message calling method according to the embodiment of the present disclosure is schematically shown. Figure 3 The following schematically shows a structural diagram of a message calling method according to an embodiment of the present disclosure. Figure 2 and Figure 3 Provide specific explanations.
[0091] According to an embodiment of the present disclosure, the message calling method is applied to the first business system, and the first business system, as a message consumer, calls and consumes messages from the message middleware. Specifically, Figure 2 As shown, the message calling method of this embodiment includes operations S210 to S240.
[0092] In operation S210, the message change dynamics of the target partition in the message middleware are monitored, and the message change dynamics are used to indicate whether the message in the target partition is changed.
[0093] According to the embodiments of the present disclosure, Figure 3 As shown, the message middleware can be Kafka message middleware (kafka). In the message middleware, messages can be stored in different partitions of multiple topics. The required messages can be acquired and called by monitoring the message changes in each partition on the consumer side. Other message middleware that can implement the embodiments of the present disclosure can also be applied to the embodiments of the present disclosure, which are not specifically limited here. Among them, the target partition is used to represent one of the multiple partitions. For example, the target partition is partition 1. In this disclosure, only one target partition (partition 1) is used as an example for explanation.
[0094] According to an embodiment of the present disclosure, the message change dynamics of the target partition are used to indicate whether the message of the target partition has changed, wherein the change may be that the original message has been updated or a new message has been added to the target partition.
[0095] In operation S220, when the message in the target partition changes, multiple changed initial business messages are obtained from the target partition, wherein the multiple initial business messages are generated by a second business system and sent to the target partition, and the second business system is an upstream business system of the first business system.
[0096] According to an embodiment of the present disclosure, when the consumer side monitors that there is a new message or message update in the target partition, the consumer side receives the message from the target partition (such as Figure 3 The initial business message that has changed is obtained from the partition 1 in , where the initial business message can be one or more. In the actual application scenario of the present disclosure, the second business system is the upstream system, the first business system is the downstream system, and the pending business in the first business system needs to rely on the message or business execution result of the upstream system (the second business system). After the upstream system (the second business system) sends the initial business message to the message middleware, the consumer end can obtain the initial business message.
[0097] In operation S230, based on a first predetermined rule, M target service messages associated with at least one first to-be-processed service in a first service system are determined from a plurality of initial service messages.
[0098] According to an embodiment of the present disclosure, a first predetermined rule is pre-configured in the first business system. When an initial business message is monitored, it is determined whether multiple initial business messages are associated with the first pending business according to the first predetermined rule. Among them, one initial business message may be associated with the first pending business, or multiple initial business messages may be associated with the first pending business, which is not limited here. In the case where M initial business messages are associated with the first pending business, the M initial business messages are determined as M target business messages. Among them, M is a positive integer greater than or equal to 1.
[0099] In operation S240, M target service messages are called from the target partition.
[0100] According to an embodiment of the present disclosure, after the M initial service messages are determined as M target service messages, the M target service messages are directly called from the target partition.
[0101] According to the embodiments of the present disclosure, the connection between the second business system and the first business system is realized by adopting the message middleware, and the first business system is used as the message consumer. By monitoring the target partition in the message middleware, the message change dynamics in the partition are obtained in time, so as to obtain the messages of the upstream system (the second business system); further, the initial business message is screened and distinguished by the first predetermined rule pre-configured in the system to determine the target business message associated with the execution of the first business to be processed among multiple initial business messages, and only the associated initial business message is called, which not only provides a message basis for the first business to be processed, but also reduces the workload of the first business system to call the message, indirectly improving the message processing rate of the first business system, and further, there is no need to call the initial business message that is not related to the first business to be processed to the first business system, thereby reducing the memory consumption of the first business system.
[0102] According to an embodiment of the present disclosure, the first predetermined rule includes a correspondence between a service message and a first service to be processed.
[0103] Figure 4 The flowchart of determining a target service message according to an embodiment of the present disclosure is schematically shown.
[0104] like Figure 4 As shown, based on a first predetermined rule, M target service messages associated with at least one first to-be-processed service in a first service system are determined from a plurality of initial service messages, including operation S410 and operation S420.
[0105] In operation S410, it is determined whether each initial service message is a service message required for executing a first service to be processed.
[0106] According to an embodiment of the present disclosure, the first predetermined rule includes a correspondence between a business message and a first business to be processed, which may be a correspondence between identification information of a business message and the first business to be processed. The identification information of the business message may be the ID number of the business message. Exemplarily, the first predetermined rule includes: the identification information ID of business message 1 is 001; the identification information ID of business message 2 is 002; the identification information ID of business message 3 is 003; wherein, the execution of the first business to be processed in the first business system depends on business message 1, or in other words, business message 1 is the message required to execute the first business to be processed. Therefore, according to the first predetermined rule, it can be determined that business message 1 is the message required to execute the first business to be processed, and business message 2 or business message 3 is not the message required to execute the first business to be processed.
[0107] In operation S420, when the at least one initial service message is a service message required for executing the first service to be processed, the at least one initial service message is determined as a target service message.
[0108] According to an embodiment of the present disclosure, according to the above example, after determining that the service message 1 is a message required to execute the first service to be processed, the service message 1 is determined as a target service message.
[0109] According to the embodiments of the present disclosure, by configuring the first predetermined rule in the business system in advance, the messages in the target partition can be preliminarily screened, avoiding the need for the consumer end to call all messages in the target partition into the first business system to increase unnecessary workload, and at the same time saving the memory space of the first business system. Furthermore, since the first predetermined rule is pre-configured, the rule can be directly called and the target business message can be determined, reducing the amount of data calculation.
[0110] According to the embodiments of the present disclosure, Figure 3 As shown, the first business system includes multiple first containers, and multiple first to-be-processed businesses are executed on the multiple first containers;
[0111] Call M target business messages from the target partition, including:
[0112] In response to the instruction sent by the first load balancer, the M target service messages in the target partition are called to different first containers, so as to achieve load balancing when executing multiple first services to be processed in the first service system.
[0113] According to an embodiment of the present disclosure, the first load balancer is configured on the message middleware (not shown in the figure), and a predetermined allocation strategy is adopted to realize load balancing when executing multiple first pending services in the first service system. Specifically, when the first container 1 on the consumer side (the first pending service) fails, all the first containers in the consumer group will be rebalanced, and the first pending service executed on the failed first container 1 will be allocated to other first containers 2, first container 3, etc. Thus, only the pending services executed on the failed first container 1 can be reallocated, which reduces unnecessary reallocation in the rebalancing process compared to the polling strategy.
[0114] According to an embodiment of the present disclosure, the message calling method further includes:
[0115] At least one first to-be-processed service is executed according to the M target service messages.
[0116] Figure 5 A flowchart for executing a first to-be-processed business according to an embodiment of the present disclosure is schematically shown.
[0117] like Figure 5 As shown, according to M target service messages, executing at least one first service to be processed includes operations S510 to S530.
[0118] In operation S510, a distributed lock for executing at least one first to-be-processed service is acquired according to identification information and timestamps of calling M target service messages.
[0119] According to an embodiment of the present disclosure, M is greater than or equal to 2. For example, when M is equal to 2, two target business messages are determined to be obtained through the above embodiment, and the execution of the first pending business needs to obtain the above two target business messages at the same time. Only when both of the two target business messages are sent to the partition of the message middleware can the above two target business messages be called and the first pending business be executed according to the above two target business messages.
[0120] According to an embodiment of the present disclosure, when M is greater than or equal to 2, there may be two target business messages sent to the target partition at the same time. When the two target business messages trigger a message call at the same time, there may be a problem of repeated execution of pending business. The embodiment of the present disclosure provides a distributed lock, which obtains a distributed lock for executing a first pending business according to the identification information and timestamp of the target business message. According to the identification information and timestamp, a distributed lock is issued to the target business message called with priority, and the target business message with a later timestamp cannot obtain the distributed lock. By calling the M target business messages in the above embodiment, a distributed lock for executing the first pending business is obtained. Among them, an identification information and a timestamp corresponding to the execution of a first pending business. The identification information can be a job name.
[0121] In operation S520, it is determined whether the distributed lock for executing the first pending business is successfully acquired.
[0122] In operation S530, when the distributed lock is successfully acquired, at least one first to-be-processed service is executed according to the M target service messages.
[0123] According to the embodiment of the present disclosure, there is only one distributed lock. After the first target service message acquires the distributed lock, the subsequent target service message cannot acquire the distributed lock. After the first pending service is executed according to the target service message, the distributed lock is released.
[0124] In operation S540, when the distributed lock is not successfully acquired, M target business messages are written into a message failure compensation table, wherein the message failure compensation table is stored in the first business system.
[0125] According to the embodiments of the present disclosure, the situation where the distributed lock is not successfully acquired indicates that the target business message has already acquired the distributed lock. To avoid repeated execution, the first pending business cannot be executed according to the target business message. Therefore, the target business message that cannot obtain the distributed lock is written into the message failure compensation table configured in advance in the first business system, and waits to be republished to the message middleware before being called.
[0126] According to the embodiments of the present disclosure, in a distributed system, a message may be processed by multiple consumers. Using a distributed lock can ensure that only one consumer can process a specific message at any time, avoid repeated processing of messages, and improve the idempotence of the distributed system.
[0127] According to an embodiment of the present disclosure, the first business system, as a message consumer, sets the parameter of "enable auto-commit" to false. After the call completes the message, the offset is manually submitted to avoid the message loss caused by the failure of consumption processing. In the case where message processing requires multiple steps, and the message is considered to be successfully processed only when all steps are completed, manually submitting the offset can ensure that the offset is submitted only after all steps are completed, thereby avoiding message loss or incomplete processing.
[0128] Figure 6 The flowchart of the message calling method according to the embodiment of the present disclosure is schematically shown. Figure 3 and Figure 6 The embodiments of the present disclosure are explained. Figure 6 As shown, the message sending method is applied to the second business system, the second business system acts as a message producer, and the method includes operations S610 to S630.
[0129] In operation S610, in response to a service request for executing a second service to be processed, the second service to be processed is executed.
[0130] According to the embodiments of the present disclosure, Figure 3 As shown, since the second business system is the upstream business system of the first business system, the first pending business in the first business system depends on the second pending business in the second business system. Therefore, after the second pending business is executed in the second business system, the execution result needs to be sent to the message middleware to provide a message basis for executing the first pending business.
[0131] In operation S620, a plurality of initial service messages are generated according to the execution result of the second service to be processed.
[0132] According to an embodiment of the present disclosure, the second pending business is executed in the second business system, and an initial business message is generated according to the execution result, wherein the initial business message may be one or more messages. Exemplarily, the initial business message may be the balance generated after the second pending business is executed.
[0133] In operation S630, a plurality of initial service messages are sent to a target partition of the message middleware.
[0134] According to the embodiments of the present disclosure, Figure 3 As shown, a polling strategy is adopted to send multiple initial business messages to the partition of the message middleware, wherein, corresponding to the message consumer end, the message middleware corresponding to the producer end and the message middleware corresponding to the consumer end should be the same message middleware, such as the Kafka message middleware (kafka) in the embodiment of the present disclosure. In the kafka cluster, messages can be stored in different partitions of multiple topics, and the message producer adopts a polling strategy to send multiple initial business messages to the partition of the message middleware to achieve load balancing in each partition. Among them, the load balancing is achieved by adopting a polling strategy through the load balancer configured on the kafka cluster, wherein the load balancer can be the first load balancer.
[0135] According to the embodiments of the present disclosure, the connection between the first business system and the second business system is realized by adopting the message middleware, and the second business system is used as the message producer. By sending messages to the target partition in the message middleware, the messages in the second business system are delivered through the message middleware, so that the second business system can obtain the messages in the partition in time and realize the acquisition of the messages of the upstream system (the second business system); further, the load balancer configured on the message middleware is used to realize the load balancing in the partitions of the message middleware, so as to avoid overloading of some partitions while other partitions are idle, and reduce the risk of message loss.
[0136] According to an embodiment of the present disclosure, the message sending method further includes:
[0137] receiving feedback information from the target partition for the plurality of initial business messages;
[0138] Determine the sending result based on the feedback information.
[0139] According to the embodiment of the present disclosure, after sending multiple initial service messages to the target partition, it should be possible to determine whether the message is sent successfully or failed based on the feedback information of the target partition. It is also possible that the feedback information from the target partition cannot be received. Specifically,
[0140] Figure 7 The flowchart of determining the sending result according to an embodiment of the present disclosure is schematically shown. Figure 8 The structure diagram of resending a failed message according to an embodiment of the present disclosure is schematically shown. Figure 7 and Figure 8 Provide specific explanations.
[0141] like Figure 7 As shown, determining the sending result according to the feedback information includes operation S710 and operation S720.
[0142] In operation S710, when no feedback information is received, at least one initial service message is resent to the target partition.
[0143] According to an embodiment of the present disclosure, the situation in which feedback information is not received may include that during the process of the message producer sending a message to the message middleware, an error occurs in the second business system (message producer), or an error occurs in the message middleware, making it impossible to send feedback information to the second business system (message producer).
[0144] According to an embodiment of the present disclosure, when no feedback information is received, at least one initial business message is resent to the target partition. When the second business system acts as a message producer, a predetermined number of resending parameters can be set based on historical experience. For example, the predetermined number of resending parameters is set to 3. When a recoverable error is encountered in the production message, the message is automatically sent three times to ensure the fault tolerance of the message production step.
[0145] like Figure 8 As shown, specifically, the number of resending is predefined, and in the case where no feedback information is received, the initial service message is resent to the message middleware according to the predetermined number of times, until feedback information is received from the message middleware, or the predetermined number of resending is met. Exemplarily, the predetermined number of resending is 3 times, and in the case where no feedback information is received, the initial service message is resent to the message middleware, and if feedback information is received when the message is resent for the first time, there is no need to resend the same initial service message; or it may be that the feedback information from the message middleware is still not received after resending 3 times.
[0146] In operation S720, when feedback information is received, it is determined whether the feedback information is successfully sent or failed to send.
[0147] According to the embodiment of the present disclosure, under the condition that the second business system acts as a message producer, it is defined that the message producer needs to wait for all replicas in the target partition to confirm that the message has been completely copied before the message is considered to be sent successfully. That is, when all replicas in the partition of the message middleware have received the initial business message, the message producer will receive a feedback message from the message middleware indicating that the message was sent successfully. Furthermore, the initial business message is stored in each replica in the message middleware partition, ensuring the high disaster tolerance and data consistency of the initial business message in the message middleware.
[0148] According to an embodiment of the present disclosure, an asynchronous callback is performed when feedback information is received. If the message is received successfully, the message producer will receive message record data returned from the message middleware, which records the topic, partition, message offset and other information of the message storage, indicating that the initial business message was sent successfully; alternatively, the received feedback information directly displays a sending error.
[0149] According to an embodiment of the present disclosure, when feedback information is received, judging whether the feedback information is sent successfully or failed includes step 11 and step 12.
[0150] In step 11, when the feedback information is a sending failure, at least one initial service message is written into a message failure compensation table, wherein the message failure compensation table is stored in the second service system.
[0151] According to an embodiment of the present disclosure, if the initial service message is sent to the message middleware again for a predetermined number of times and still fails, the initial service message is recorded in the message failure compensation table; or, if the feedback information sent by the message middleware is a sending failure, the initial service message is recorded in the message failure compensation table. Figure 8 As shown, the message failure compensation table is configured in the second service system.
[0152] In step 12, at least one initial service message stored in the message failure compensation table is resent to the target partition within a predetermined time.
[0153] According to an embodiment of the present disclosure, a time period is scheduled, and the initial service message in the message failure compensation table is resent to the message middleware in the scheduled time period by polling. The scheduled time may be 30 seconds, 2 minutes, 10 minutes, 2 hours, etc.
[0154] According to the embodiments of the present disclosure, network problems, service failures and other problems are very common in distributed systems. The embodiments of the present disclosure can enhance the fault tolerance of the system through an automatic retry mechanism, so that message producers can continue to work in the face of these failures. By resending failed messages, the reliability of message delivery can be improved, ensuring that key messages will not be lost due to failure to send. At the same time, in the case of unstable network or temporary unavailability of services, resending can reduce the risk of data loss due to failure to send.
[0155] According to the embodiments of the present disclosure, Figure 3 As shown, the second business system includes multiple second containers, and multiple second to-be-processed businesses are executed on the multiple second containers.
[0156] Before executing the second pending service, the message sending method further includes:
[0157] In response to the instruction sent by the second load balancer, the plurality of second services to be processed are allocated to different second containers, so as to achieve load balancing when the plurality of second services to be processed are executed in the second service system.
[0158] According to an embodiment of the present disclosure, in a cloud computing environment, batch processing tasks are deployed as service nodes. These nodes can be dynamically expanded or reduced according to demand. In order to improve the availability and fault tolerance of the system, multiple identical batch node copies are usually deployed, such as Figure 3 The second container 1, the second container 2, ... the second container X, etc. in the . Each replica is able to execute jobs independently, but at any given time, only one replica is activated to execute a specific job. Since the replicas run independently, each replica may be assigned a different IP address when it starts. In order to manage calls to these replicas, a server load balancer (SLB) is used as a unified entry point. The load balancer uses polling to distribute requests to different replicas to achieve load balancing.
[0159] Based on the above message calling method, the present disclosure also provides a message calling device. Fig. 9 and Fig.10 The device is described in detail.
[0160] Fig. 9 The structural block diagram of the message calling device according to the embodiment of the present disclosure is schematically shown.
[0161] like Fig. 9 As shown, the message calling device 900 of this embodiment includes a monitoring module 910 , an acquisition module 920 , a first determination module 930 and a calling module 940 .
[0162] The monitoring module 910 is used to monitor the message change dynamics of the target partition in the message middleware, and the message change dynamics are used to indicate whether the message in the target partition has changed. In one embodiment, the monitoring module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0163] The acquisition module 920 is used to acquire multiple changed initial business messages from the target partition when the message in the target partition changes, wherein the multiple initial business messages are generated by the second business system and sent to the target partition, and the second business system is an upstream business system of the first business system. In one embodiment, the acquisition module 920 can be used to perform the operation S220 described above, which will not be repeated here.
[0164] The first determination module 930 is used to determine M target service messages associated with at least one first service to be processed in the first service system from multiple initial service messages based on a first predetermined rule. In one embodiment, the first determination module 930 can be used to perform the operation S230 described above, which will not be repeated here.
[0165] The calling module 940 is used to call M target service messages from the target partition. In one embodiment, the calling module 930 can be used to perform the operation S240 described above, which will not be described in detail here.
[0166] According to an embodiment of the present disclosure, the first predetermined rule includes a correspondence between a service message and a first service to be processed, and the first determination module 930 includes a first judgment submodule and a determination submodule.
[0167] A first judgment submodule, used to judge whether each initial service message is a service message required to execute the first service to be processed;
[0168] The determination submodule is used to determine at least one initial service message as a target service message when the at least one initial service message is a service message required for executing the first service to be processed.
[0169] According to an embodiment of the present disclosure, the first business system includes multiple first containers, and multiple first to-be-processed businesses are executed on the multiple first containers; the calling module 940 includes a calling submodule.
[0170] The calling submodule is used to call M target business messages in the target partition to different first containers in response to the instruction sent by the first load balancer, so as to achieve load balancing when executing multiple first to-be-processed businesses in the first business system.
[0171] According to an embodiment of the present disclosure, the message calling method also includes a first execution module.
[0172] The first execution module is used to execute at least one first to-be-processed service according to M target service messages.
[0173] According to an embodiment of the present disclosure, the first execution module includes an acquisition submodule, an execution submodule and a read-write submodule.
[0174] An acquisition submodule, used to acquire a distributed lock for executing at least one first to-be-processed business according to the identification information and timestamp of calling M target business messages;
[0175] An execution submodule, configured to execute at least one first pending business when the distributed lock is successfully acquired;
[0176] The read-write submodule is used to write M target business messages into a message failure compensation table when the distributed lock is not successfully acquired, wherein the message failure compensation table is stored in the first business system.
[0177] According to the embodiments of the present disclosure, the connection between the second business system and the first business system is realized by adopting the message middleware, and the first business system is used as the message consumer. The target partition in the message middleware is monitored by the monitoring module 910, so that the acquisition module 920 can obtain the message change dynamics in the partition in time, and realize the acquisition of messages from the upstream system (the second business system); further, the first determination module 930 uses the first predetermined rule pre-configured in the system to screen and distinguish the initial business messages to determine the target business messages associated with the execution of the first business to be processed among multiple initial business messages, and only calls the associated initial business messages, which not only provides a data basis for the first business to be processed, but also reduces the workload of the first business system to call messages, indirectly improving the message processing rate of the first business system, and further, there is no need to call the initial business messages that are not related to the first business to be processed to the first business system, thereby reducing the memory consumption of the first business system.
[0178] According to an embodiment of the present disclosure, any multiple modules of the monitoring module 910, the acquisition module 920, the first determination module 930, and the calling module 940 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the monitoring module 910, the acquisition module 920, the first determination module 930, and the calling module 940 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the monitoring module 910 , the acquisition module 920 , the first determination module 930 , and the calling module 940 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0179] Fig.10 The structural block diagram of the message sending device according to an embodiment of the present disclosure is schematically shown.
[0180] like Fig.10 As shown, the message sending device 1000 of this embodiment includes a second execution module 1010 , a generation module 1020 and a sending module 1030 .
[0181] The second execution module 1010 is used to execute the second pending service in response to the service request for executing the second pending service. In one embodiment, the module 1010 can be used to execute the operation S610 described above, which will not be described in detail here.
[0182] The generating module 1020 is used to generate a plurality of initial service messages according to the execution result of the second service to be processed. In one embodiment, the generating module 1020 can be used to perform the operation S620 described above, which will not be described in detail here.
[0183] The sending module 1030 is used to send multiple initial service messages to the target partition of the message middleware. In one embodiment, the sending module 1030 can be used to perform the operation S630 described above, which will not be repeated here.
[0184] According to an embodiment of the present disclosure, the message sending method further includes a receiving module and a second determining module.
[0185] A receiving module, used for receiving feedback information of a plurality of initial service messages from a target partition;
[0186] The second determining module is used to determine the sending result according to the feedback information.
[0187] According to an embodiment of the present disclosure, the second determination module includes a sending submodule and a second judging submodule.
[0188] A sending submodule, used for resending at least one initial service message to the target partition when no feedback information is received;
[0189] The second judgment submodule is used to judge whether the feedback information is sent successfully or failed when the feedback information is received.
[0190] According to an embodiment of the present disclosure, the second judgment submodule includes a reading and writing unit, a sending unit and an allocation module.
[0191] A read-write unit, configured to write at least one initial service message into a message failure compensation table when the feedback information indicates that the message fails to be sent, wherein the message failure compensation table is stored in the second service system;
[0192] The sending unit is used to resend at least one initial service message stored in the message failure compensation table to the target partition within a predetermined time.
[0193] According to an embodiment of the present disclosure, the second business system includes multiple second containers, and multiple second to-be-processed businesses are executed on the multiple second containers.
[0194] Before executing the second service to be processed, the message sending method further includes a distribution module.
[0195] The allocation module is used to allocate multiple second to-be-processed businesses to different second containers in response to an instruction sent by the second load balancer, so as to achieve load balancing when executing multiple second to-be-processed businesses in the second business system.
[0196] According to the embodiments of the present disclosure, the connection between the first business system and the second business system is realized by adopting the message middleware, and the second business system is used as the message producer. The message is sent to the target partition in the message middleware through the sending module 1030, so that the message in the second business system is delivered by means of the message middleware, so that the second business system can obtain the message in the partition in time and realize the acquisition of the message of the upstream system (the second business system); further, the load balancer configured on the message middleware is used to realize the load balancing in the partition of the message middleware, so as to avoid overloading of some partitions while other partitions are idle, and reduce the risk of message loss.
[0197] According to an embodiment of the present disclosure, any multiple modules of the second execution module 1010, the generation module 1020 and the sending module 1030 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the second execution module 1010, the generation module 1020 and the sending module 1030 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the second execution module 1010, the generation module 1020 and the sending module 1030 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0198] Fig.11 A block diagram of an electronic device suitable for implementing a message calling and message sending method according to an embodiment of the present disclosure is schematically shown.
[0199] like Fig.11 As shown, the electronic device 1100 according to an embodiment of the present disclosure includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 to a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include an onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0200] In RAM 1103, various programs and data required for the operation of electronic device 1100 are stored. Processor 1101, ROM 1102 and RAM 1103 are connected to each other through bus 1104. Processor 1101 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1102 and / or RAM 1103. It should be noted that the program can also be stored in one or more memories other than ROM 1102 and RAM 1103. Processor 1101 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0201] According to an embodiment of the present disclosure, the electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to the bus 1104. The electronic device 1100 may further include one or more of the following components connected to the I / O interface 1105: an input portion 1106 including a keyboard, a mouse, etc.; an output portion 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1108 including a hard disk, etc.; and a communication portion 1109 including a network interface card such as a LAN card, a modem, etc. The communication portion 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage portion 1108 as needed.
[0202] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0203] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1102 and / or RAM 1103 described above and / or one or more memories other than ROM 1102 and RAM 1103.
[0204] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the message calling and message sending method provided by the embodiment of the present disclosure.
[0205] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 1101. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0206] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1109, and / or installed from a removable medium 1111. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0207] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the processor 1101, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0208] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0209] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a 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 box can also occur in a different order from the order marked in the accompanying drawings. For example, two 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 box in the block diagram or flow chart, and the combination of the boxes in the block diagram 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.
[0210] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0211] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A message calling method, characterized in that: The message calling method is applied to a first business system, the first business system serves as a message consumer, and the method includes: Monitor the message change dynamics of the target partition in the message middleware, where the message change dynamics is used to indicate whether the message in the target partition has changed; In the case where the message in the target partition is changed, a plurality of changed initial business messages are obtained from the target partition, wherein the plurality of initial business messages are generated by a second business system and sent to the target partition, and the second business system is an upstream business system of the first business system; Based on a first predetermined rule, determining M target service messages associated with at least one first to-be-processed service in the first service system from the multiple initial service messages; The M target service messages are called from the target partition.
2. The method according to claim 1, characterized in that The first predetermined rule includes a corresponding relationship between a service message and a first service to be processed, Determining, based on a first predetermined rule, M target service messages associated with at least one first to-be-processed service in the first service system from the multiple initial service messages includes: Determining whether each initial service message is a service message required for executing the first service to be processed; In a case where the at least one initial service message is a service message required for executing the first service to be processed, the at least one initial service message is determined as a target service message.
3. The method according to claim 1, characterized in that The first business system includes a plurality of first containers, and a plurality of first to-be-processed businesses are executed on the plurality of first containers; Calling the M target service messages from the target partition includes: In response to an instruction sent by the first load balancer, the M target business messages in the target partition are called to different first containers to achieve load balancing when executing the multiple first to-be-processed businesses in the first business system.
4. The method according to claim 1, characterized in that The method further comprises: According to the M target service messages, the at least one first service to be processed is executed.
5. The method according to claim 4, characterized in that Executing the at least one first to-be-processed service according to the M target service messages includes: Acquire a distributed lock for executing the at least one first to-be-processed business according to the identification information and timestamp of calling the M target business messages; In the case of successfully acquiring the distributed lock, executing the at least one first pending business; In the case where the distributed lock is not successfully acquired, the M target business messages are written into a message failure compensation table, wherein the message failure compensation table is stored in the first business system.
6. A message sending method, characterized in that: The message sending method is applied to a second business system, where the second business system serves as a message producer, and the method includes: In response to the service request for executing the second service to be processed, executing the second service to be processed; generating a plurality of initial service messages according to the execution result of the second service to be processed; The multiple initial service messages are sent to a target partition of the message middleware.
7. The method according to claim 6, characterized in that The method further comprises: receiving feedback information of the target partition on the plurality of initial service messages; A sending result is determined according to the feedback information.
8. The method according to claim 7, characterized in that Determining a sending result according to the feedback information includes: In the case where the feedback information is not received, resending the at least one initial service message to the target partition; When the feedback information is received, it is determined whether the feedback information is sent successfully or failed.
9. The method according to claim 8, characterized in that In the case of receiving the feedback information, determining whether the feedback information is sent successfully or failed to be sent includes: When the feedback information is a sending failure, writing the at least one initial service message into a message failure compensation table, wherein the message failure compensation table is stored in the second service system; The at least one initial service message stored in the message failure compensation table is resent to the target partition within a predetermined time.
10. The method according to claim 6, characterized in that The second business system includes a plurality of second containers, and a plurality of second to-be-processed businesses are executed on the plurality of second containers. Before executing the second pending business, the method further includes: In response to an instruction sent by the second load balancer, the plurality of second services to be processed are distributed to different second containers, so as to achieve load balancing when the plurality of second services to be processed are executed in the second service system.
11. A message calling device, characterized in that: The device comprises: A monitoring module, used to monitor the message change dynamics of the target partition in the message middleware, wherein the message change dynamics are used to indicate whether the message in the target partition has changed; an acquisition module, configured to acquire, from the target partition, a plurality of changed initial business messages when a message in the target partition changes, wherein the plurality of initial business messages are generated by a second business system and sent to the target partition, and the second business system is an upstream business system of the first business system; A first determining module is configured to determine, based on a first predetermined rule, M target service messages associated with at least one first service to be processed in the first service system from the multiple initial service messages; and A calling module is used to call the M target service messages from the target partition.
12. A message sending device, characterized in that: The device comprises: A second execution module, configured to execute the second to-be-processed service in response to a service request for executing the second to-be-processed service; A generating module, configured to generate a plurality of initial service messages according to the execution result of the second service to be processed; and The sending module is used to send the multiple initial service messages to the target partition of the message middleware.
13. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 10.
14. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
