Data interaction method and device, equipment and medium

By defining the status and consumers of business messages in the business process configuration file and generating a message queue, flexible and scalable data flow of passing order messages between multiple systems is achieved, and the problems of high coupling and poor scalability in existing systems are solved.

CN120045351APending Publication Date: 2025-05-27BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510094735.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

When the existing order message flow system based on message middleware is passed between multiple systems, it has greater coupling, poor expansion, and is not easy to expand.

Method used

By obtaining the business process configuration file, defining multiple states of the business message and its corresponding consumers, generating a message queue for cached business messages, and writing the business messages generated by the producer into the message queue, and sending the business messages under each state in the message queue to the corresponding consumers according to the business process configuration file.

Benefits of technology

The entire data flow is completed through a message queue during the life cycle of business messages, reducing the coupling between various consumers and producers, and improving the flexibility and scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045351A_ABST
    Figure CN120045351A_ABST
Patent Text Reader

Abstract

The invention discloses a data interaction method and device, equipment and a medium, and relates to the technical field of computers. The method comprises the following steps: acquiring a business process configuration file, wherein the business process configuration file defines a plurality of states of a business message and consumers corresponding to the business message in each state; generating a message queue for caching the service message; receiving a service message generated by a producer, and writing the generated service message into a message queue; and sending the service messages in each state in the message queue to corresponding consumers according to the service process configuration file. According to the method, the whole data circulation is completed through one message queue in the life cycle of the service message, the coupling between each consumer and a producer is reduced, and the circulation process of the message is conveniently and quickly processed in a combined mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a data interaction method, apparatus, device, and medium. Background Art

[0002] A message middleware is a supporting software system that provides synchronous or asynchronous, reliable message transmission for application systems in a network environment based on queue and message passing technologies. Figure 1 The schematic diagram of an order message flow system based on message middleware in the prior art is shown. As Figure 1 shown, the order message flow system includes an upstream system A, a transaction system B, a fulfillment system C, queue A, queue B, and queue C. The upstream system A generates an order message and writes the order message into queue A. The transaction system B monitors queue A, reads the order message from queue A, and determines whether it has received the payment message of the user. After determining that it has received the payment message of the user, it generates an order payment completion message and writes the order payment completion message into queue B. The fulfillment system C monitors queue B, reads the order payment completion message from queue B to process the issuance of user rights and interests, and generates an order completion message and writes the order completion message into queue C. The upstream system A monitors queue C, reads the order completion message from queue C, and marks and records the completed order. This order message flow system forwards an order message between multiple systems based on multiple message queues, and the coupling of each system is relatively large, the scalability is poor, and it is not easy to expand. Summary of the Invention

[0003] To solve the above technical problems or at least partially solve the above technical problems, embodiments of the present invention provide a data interaction method, apparatus, device, and medium.

[0004] In a first aspect of the embodiments of the present invention, a data interaction method is provided, including:

[0005] Obtaining a business process configuration file, where the business process configuration file defines multiple states of business messages and consumers corresponding to the business messages in each state;

[0006] Generating a message queue for caching business messages;

[0007] Receiving a business message generated by a producer and writing the generated business message into the message queue;

[0008] Monitoring the message queue, and according to the business process configuration file, sending the business messages in each state in the message queue to corresponding consumers.

[0009] Optionally, the message queue includes a logical queue and a physical queue. The logical queue is used to cache the identification information and status of service messages, and the physical queue is used to cache the message content of service messages;

[0010] Writing the generated service message into the message queue includes:

[0011] Writing the identification information and status of the service message generated by the producer into the logical queue, and writing the message content of the service message into the physical queue;

[0012] Listening to the message queue and sending the service messages in various statuses in the message queue to the corresponding consumers according to the service process configuration file includes:

[0013] Listening to the logical queue, obtaining the message content of the service message in the logical queue from the physical queue, and sending the message content to the consumer corresponding to the status of the service message.

[0014] Optionally, the service process configuration file further includes a first policy;

[0015] The method further includes: calculating the target number of physical queues according to the first policy; determining whether to increase or decrease the number of physical queues according to the target number of physical queues and the current number of physical queues.

[0016] Optionally, calculating the target number of physical queues according to the first policy includes: listening to the logical queue, determining the generation rate and consumption rate of service messages; calculating the message transfer rate according to the generation rate and the consumption rate; when the message transfer rate is in the first interval, the target number of physical queues is the first preset value; when the message transfer rate is in the second interval, the target number of physical queues is the second preset value; when the message transfer rate is in the third interval, the target number of physical queues is the third preset value.

[0017] Optionally, the service process configuration file further includes a message distribution policy; the message distribution policy is used to indicate the distribution of service messages to the corresponding physical queues;

[0018] Writing the message content of the service message into the physical queue includes: when the number of physical queues is greater than or equal to 2, allocating the corresponding physical queue for the service message according to the message distribution policy, and writing the message content of the service message into the corresponding physical queue.

[0019] Optionally, the service process configuration file further includes a second policy;

[0020] The method further includes: caching service messages in a specified status in a specified physical queue according to the second policy.

[0021] Optionally, the obtaining of the service process configuration file includes: displaying a process choreography page, where the process choreography page includes at least one service process choreography control; and generating a service process configuration file in response to a selection operation of the user on the at least one service process choreography control on the process choreography page.

[0022] In a second aspect of the embodiments of the present invention, a data interaction device is provided, including:

[0023] An obtaining module, configured to obtain a service process configuration file, where the service process configuration file defines multiple statuses of service messages and consumers corresponding to the service messages in each status;

[0024] A queue module, configured to generate a message queue for caching service messages;

[0025] A queue proxy module, configured to receive service messages generated by a producer and write the generated service messages into the message queue; monitor the message queue, and according to the service process configuration file, send the service messages in each status in the message queue to corresponding consumers.

[0026] Optionally, the message queue includes a logical queue and a physical queue, where the logical queue is used to cache identification information and statuses of service messages, and the physical queue is used to cache message contents of service messages;

[0027] The queue proxy module is further configured to: write the identification information and statuses of service messages generated by the producer into the logical queue, write the message contents of the service messages into the physical queue; monitor the logical queue, obtain the message contents of the service messages in the logical queue from the physical queue, and send the message contents to consumers corresponding to the statuses of the service messages.

[0028] Optionally, the service process configuration file further includes a first policy;

[0029] The device further includes a queue expansion module, configured to: calculate a target number of physical queues according to the first policy; and determine whether to increase or decrease the number of physical queues according to the target number of physical queues and the current number of physical queues.

[0030] Optionally, the queue expansion module is further configured to: monitor the logical queue, determine the generation rate and consumption rate of service messages; calculate the message transfer rate according to the generation rate and the consumption rate; when the message transfer rate is in the first interval, the target number of physical queues is a first preset value; when the message transfer rate is in the second interval, the target number of physical queues is a second preset value; when the message transfer rate is in the third interval, the target number of physical queues is a third preset value.

[0031] Optionally, the service process configuration file further includes a message distribution policy; the message distribution policy is used to indicate that service messages are distributed to corresponding physical queues;

[0032] The queue proxy module is further configured to: when the number of physical queues is greater than or equal to 2, distribute corresponding physical queues for the service messages according to the message distribution policy, and write the message content of the service messages into the corresponding physical queues.

[0033] Optionally, the service process configuration file further includes a second policy;

[0034] The queue expansion module is further configured to: cache service messages in a specified state in a specified physical queue according to the second policy.

[0035] Optionally, the acquisition module is configured to: display a process choreography page, where the process choreography page includes at least one service process choreography control; in response to a user's selection operation on the at least one service process choreography control on the process choreography page, generate a service process configuration file.

[0036] In a third aspect of the embodiments of the present invention, an electronic device is provided, which is characterized by including a processor, a communication interface, a memory, and a communication bus; wherein, the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store a computer program; when the processor executes the program stored on the memory, it implements the data interaction method provided in any embodiment of the present invention.

[0037] In a first aspect of the embodiments of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and is characterized in that when the program is executed by a processor, it implements the data interaction method provided in any embodiment of the present invention.

[0038] One embodiment of the above invention has the following advantages or beneficial effects:

[0039] The data interaction method according to the embodiment of the present invention obtains a business process configuration file, which defines multiple states of business messages and the consumers corresponding to the business messages in each state; generates a message queue for caching business messages; caches the business messages generated by the producer into the message queue, and according to the business process configuration file, sends the business messages in each state in the message queue to the corresponding consumers to process the business messages. This method completes the entire data flow through a message queue during the life cycle of business messages, reduces the coupling between each consumer and the producer, and through the business process configuration file, conveniently and quickly processes the message flow process in a combined manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings are used to better understand the present invention and do not constitute an improper limitation to the present invention. Among them:

[0041] Figure 1 shows a schematic diagram of an order message flow system based on a message middleware in the prior art;

[0042] Figure 2 shows a schematic flow chart of the data interaction method according to an embodiment of the present invention;

[0043] Figure 3A shows a schematic diagram of the business message flow process arrangement provided by an embodiment of the present invention;

[0044] Figure 3B shows a schematic diagram of the business message flow process arrangement provided by another embodiment of the present invention;

[0045] Figure 4 shows a schematic flow chart of the data interaction method according to another embodiment of the present invention;

[0046] Figure 5 and Figure 6 respectively show a schematic diagram of an extended physical queue provided by the embodiment of the present invention;

[0047] Figure 7 shows a schematic structural diagram of the data interaction device according to the embodiment of the present invention;

[0048] Figure 8 shows a schematic structural diagram of the electronic device according to the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0049] The exemplary embodiments of the present invention will be described below in conjunction with the accompanying drawings. Various details of the embodiments of the present invention are included to assist in understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, descriptions of well-known functions and structures are omitted in the following description for clarity and conciseness.

[0050] Figure 2 The flowchart of the data interaction method according to an embodiment of the present invention is shown. As Figure 2 shown, the method includes:

[0051] Step S201: Obtain a business process configuration file, which defines multiple states of business messages and the consumers corresponding to the business messages in each state.

[0052] As an optional example, the states of business messages may include, but are not limited to, unprocessed, processing, processing successful, processing failed, etc.

[0053] A business message may include, for example, its unique identifier, status, and other necessary metadata information and business data. Among them, the content of the business message, such as the necessary metadata information and business data, can be set according to the application scenario, and the present invention does not limit this here.

[0054] The specified system indicated by the business process configuration file can be either the producer of the business message or the consumer of the business message. The consumer processes the business message in a certain state to obtain an expected processing result, and this expected processing result serves as the business message in another state. For example, System A generates Business Message 1, and the state of this Business Message 1 is State 1. System B processes Business Message 1 and generates Business Message 2 (Business Message 2 is the expected processing result of System B processing Business Message 1). Relative to Business Message 1, System A is the producer and System B is the consumer. Relative to Business Message 2, System B is the producer.

[0055] Figure 3A The schematic diagram of the business message flow process based on process orchestration page orchestration provided by an embodiment of the present invention is shown. As Figure 3AAs shown, the process of processing the service message M1 includes four stages, namely stage 1, stage 2, stage 3, and stage 4. The message in the initial state flows to stage 1. Stage 1 processes the message in the initial state. In response to successful processing, the status of the message M1 is modified to status 1. Stage 2 processes the message M1 in status 1 and changes the status of the message M1 to status 2 or status 3 according to different processing results. Stage 3 processes the message M1 in status 2 and changes the status of the message M1 to status 3. Stage 4 processes the message M1 in status 3. If the message processing fails in stage 2, stage 3, or stage 4, a rollback is performed.

[0056] Step S202: Generate a message queue for caching service messages.

[0057] Step S203: Receive the service messages generated by the producer and write the generated service messages into the message queue.

[0058] Step S204: Listen to the message queue and send the service messages in each state in the message queue to the corresponding consumers according to the service process configuration file.

[0059] In an optional embodiment, a proxy can be used to listen to the message queue and distribute the service messages. Herein, the proxy refers to a service that performs specific tasks.

[0060] The data interaction method provided by the embodiment of the present invention obtains a service process configuration file, where the service process configuration file defines multiple states of service messages and the corresponding consumers of the service messages in each state; generates a message queue for caching service messages; caches the service messages generated by the producer into the message queue, and according to the service process configuration file, sends the service messages in each state in the message queue to the corresponding consumers to process the service messages. This method completes the entire data flow through a message queue during the life cycle of the service message, reduces the coupling between each consumer and the producer during its life cycle, makes the system more flexible and scalable, reduces the number of message queues, reduces the use of message middleware resources, and can dynamically configure the flow logic of service messages by defining the states of service messages and the corresponding consumers of service messages in each state through the service process configuration file, and conveniently and quickly processes the flow process of messages in a combined manner.

[0061] In an optional embodiment, the service process configuration file can be obtained according to the following process: display a process orchestration page, and the process orchestration page includes at least one service process orchestration control. In response to the user's selection operation on at least one service process orchestration control on the process orchestration page, a service process configuration file is generated.

[0062] Among them, the process orchestration page is used to orchestrate the flow process of business messages. Multiple business process orchestration controls are displayed on the process orchestration page. Based on the operations on the business process orchestration controls, the flow process of business messages during their life cycle can be defined. As an optional example, the user can define the status of business messages and the interactions between multiple systems involved in the flow process on the process orchestration page according to business logic, so as to clarify the status of business messages, constrain and declare the steps that the messages need to be processed and the expected processing results of each step. A business process configuration file is generated according to the operations of the user on the process orchestration page.

[0063] Figure 3B shows a schematic diagram of the process orchestration of the business message flow provided by another embodiment of the present invention. As Figure 3B shown, the process of participating in the processing of business messages such as order messages includes four systems, namely the order system, the order verification system, the payment system, and the logistics system. The order system generates an order message, and the status of this order message is to be verified. The order verification system needs to listen for the order message to be verified and verify the order message to be verified. For example, verify the validity and legality of the order message. In the case of successful verification, an order message with the status of to be paid is generated. The payment system needs to listen for the order message to be paid, initiate payment to the user for the order message to be paid, and in the case of receiving the user's payment information, generate an order message with the status of to be delivered. The logistics system needs to listen for the order message to be delivered, execute the delivery task, and in response to successful delivery, generate an order message with the status of delivery completed. The order system needs to listen for the order message with successful delivery, update the status of this order message to processed, and record the entire life cycle of the message in the log system for future auditing and analysis.

[0064] Figure 4 shows a schematic diagram of the process of the data interaction method provided by another embodiment of the present invention. As Figure 4 shown, the method includes:

[0065] Step S401: Display a process orchestration page, and the process orchestration page includes at least one business process orchestration control.

[0066] Step S402: In response to the user's selection operation on at least one business process orchestration control on the process orchestration page, generate a business process configuration file, and the business process configuration file defines multiple statuses of business messages and the consumers corresponding to the business messages in each status.

[0067] Step S403: Generate a logical queue and a physical queue for caching business messages. The logical queue is used to cache the identification information and status of business messages, and the physical queue is used to cache the message content of business messages.

[0068] Step S404: Write the identification information and status of the service message generated by the producer into the logical queue, and write the message content of the service message into the physical queue.

[0069] Step S405: Monitor the logical queue, obtain the message content of the service message in the logical queue from the physical queue, and send the message content to the consumer corresponding to the status of the service message.

[0070] Among them, steps S401 - S402 can refer to Figure 2 the embodiments shown. To avoid repetition, they will not be elaborated here.

[0071] For steps S403 - S404, the relationship between the logical queue and the physical queue is a subordinate relationship. One logical queue can correspond to one physical queue or multiple physical queues (for example, when the rate at which the producer generates service messages is greater than the rate at which consumers consume messages, multiple physical queues are required to cache the message content of the service messages). The corresponding relationship between the logical queue and the physical queue and the number of physical queues can be set on the process orchestration page. By default, the number of both the logical queue and the physical queue is 1. The message content is much larger than the identification information and status of the message. If the message content of all messages is placed in one queue, as the number of messages increases, the size of the queue will become very large, resulting in a sharp increase in the monitoring pressure on all systems. Moreover, for each system, its main task is to process messages, not to monitor. Separating the identification and status of the message into a separate queue makes it easier for each system to monitor and reduces the monitoring pressure on the system.

[0072] For step S405, since the unique identification and status of the service message are recorded in the logical queue, monitor the logical queue. When a new service message is monitored, determine the corresponding consumer of the service message according to the service process configuration file, retrieve the message content of the service message from the physical queue, and send it to the corresponding consumer.

[0073] The data interaction method provided by the embodiments of the present invention can conveniently and quickly process the message flow process in a combined manner by orchestrating the flow logic of service messages on the visual process orchestration page; complete the entire data flow through a message queue during the life cycle of the service message, reduce the coupling between each consumer and producer during its life cycle, and shield the storage details of the underlying actual queue through the processing of the logical queue. The producer and the consumer do not need to pay attention to the specific storage location of the message and the actual consumed queue, and only need to declare the message with the specified status at a certain stage that the consumer is concerned about in the service process configuration file, which reduces the application difficulty.

[0074] Optionally, the service process configuration file of the embodiment of the present invention further includes a first policy. The first policy can be used to identify whether it is necessary to increase or decrease the number of physical queues. In an optional application scenario, after each system starts and begins to work, the application processing speed is very fast during a certain time period, while the application processing in other stages is relatively slow. In this case, automatically increasing or decreasing the number of physical queues can relieve the system pressure during traffic peaks, ensure the best message writing delay, and occupy less machine resources.

[0075] Optionally, the data interaction method provided by the embodiment of the present invention further includes:

[0076] Calculating the target number of physical queues according to the first policy;

[0077] Determining whether to increase or decrease the number of physical queues according to the target number of physical queues and the current number of physical queues.

[0078] Among them, the first policy can indicate to increase or decrease the number of physical queues according to the message transfer rate. For example, if the message transfer rate is in interval 1, the target number of physical queues is X1; if the message transfer rate is in interval 2, the target number of physical queues is X2; if the message transfer rate is in interval 3, the target number of physical queues is X3.

[0079] Therefore, in the embodiment of the present invention, the logical queue can be monitored to determine the generation rate and consumption rate of service messages; according to the generation rate and consumption rate of the messages, calculate the message transfer rate; according to the message transfer rate, determine the target number of physical queues, and then determine whether to increase or decrease the number of physical queues. Figure 5 Shows a schematic diagram of horizontally expanding physical queues in an embodiment of the present invention. As Figure 5 shown, after horizontally expanding the physical queues, the logical queue corresponds to three physical queues, namely: Physical Queue 1, Physical Queue 2, and Physical Queue 3. The identification information and status of the service messages cached in the three physical queues are cached in the logical queue.

[0080] Optionally, the service process configuration file of the embodiment of the present invention further includes a message distribution policy. The message distribution policy is used to indicate that service messages are distributed to the corresponding physical queues. When the number of physical queues is greater than or equal to 2, different service messages can be distributed to different physical queues according to the message distribution policy. For example, in the case of determining to increase the number of physical queues, the service messages in the original physical queue can be evenly distributed to all physical queues, or the original service messages can not be distributed, and the newly generated service messages can be sequentially distributed to the newly added physical queues.

[0081] Optionally, the service process configuration file of the embodiments of the present invention further includes a second policy. The second policy is used to indicate caching service messages in a specified physical queue in a specified state. For example Figure 6 as shown, cache service messages with the state of State 1 in Physical Queue 1( Figure 6 abbreviated as State 1 Queue in the text), cache service messages with the state of State 2 in Physical Queue 2( Figure 6 abbreviated as State 2 Queue in the text), and cache service messages with the state of State 3 in Physical Queue 1( Figure 6 abbreviated as State 3 Queue in the text). Different from Figure 5 that, in Figure 5 the service messages cached in Physical Queue 1, Physical Queue 2, and Physical Queue 3 shown may be in various states, rather than a specified state.

[0082] In an optional embodiment, the physical queue can be configured according to the first policy and the second policy at the same time. For example, according to the first policy, the number of physical queues is increased to five, denoted as: Physical Queue 1, Physical Queue 2, Physical Queue 3, Physical Queue 4, and Physical Queue 5. According to the second policy, it is specified that Physical Queue 1 and Physical Queue 2 are only used to cache service messages with the state of State 1, and Physical Queue 3, Physical Queue 4, and Physical Queue 5 are used to cache all service messages except those with the state of State 1.

[0083] In an optional embodiment, the service process configuration file further includes an exception handling policy, which includes an exception recognition rule and an exception handling rule. The exception recognition rule is used to recognize abnormal service messages. The exception handling rule is used to indicate the processing method for abnormal service messages.

[0084] The data interaction method further includes: monitoring the logical queue, and in the case of recognizing abnormal service messages in the logical queue according to the exception recognition rule, processing the abnormal service messages according to the exception handling rule. Among them, the abnormal service messages can include, for example, but are not limited to: timed-out service messages; service messages that still fail to be processed after retrying; service messages that do not conform to the specified format, etc. The exception handling rule can include, for example, but is not limited to: outputting a notification message to remind that there are service messages that fail to be processed or service messages that do not conform to the specified format; deleting the timed-out service messages and regenerating the same service messages, and writing the regenerated service messages to the head of the logical queue.

[0085] Figure 7 shows a schematic structural diagram of a data interaction device provided by an embodiment of the present invention. As Figure 7 shown, the data interaction device 700 includes:

[0086] An acquisition module 701, configured to acquire a business process configuration file, where the business process configuration file defines multiple states of business messages and consumers corresponding to the business messages in each state;

[0087] A queue module 702, configured to generate a message queue for caching business messages;

[0088] A queue proxy module 703, configured to receive business messages generated by a producer and write the generated business messages into the message queue; monitor the message queue, and according to the business process configuration file, send the business messages in each state in the message queue to corresponding consumers.

[0089] Optionally, the message queue includes a logical queue and a physical queue, where the logical queue is used to cache identification information and states of business messages, and the physical queue is used to cache message contents of business messages;

[0090] The queue proxy module is further configured to: write the identification information and states of business messages generated by the producer into the logical queue, and write the message contents of the business messages into the physical queue; monitor the logical queue, obtain the message contents of the business messages in the logical queue from the physical queue, and send the message contents to consumers corresponding to the states of the business messages.

[0091] Optionally, the business process configuration file further includes a first policy;

[0092] The apparatus further includes a queue expansion module, configured to: calculate a target number of physical queues according to the first policy; determine whether to increase or decrease the number of physical queues according to the target number of physical queues and the current number of physical queues.

[0093] Optionally, the queue expansion module is further configured to: monitor the logical queue, determine a generation rate of business messages and a consumption rate of business messages; calculate a message transfer rate according to the generation rate and the consumption rate; when the message transfer rate is in a first interval, the target number of physical queues is a first preset value; when the message transfer rate is in a second interval, the target number of physical queues is a second preset value; when the message transfer rate is in a third interval, the target number of physical queues is a third preset value.

[0094] Optionally, the business process configuration file further includes a message distribution policy; the message distribution policy is used to indicate that business messages are distributed to corresponding physical queues;

[0095] The queue proxy module is further configured to: when the number of the physical queues is greater than or equal to 2, allocate a corresponding physical queue for the service message according to the message allocation policy, and write the message content of the service message into the corresponding physical queue.

[0096] Optionally, the service process configuration file further includes a second policy;

[0097] The queue expansion module is further configured to: cache the service messages in a specified status in a specified physical queue according to the second policy.

[0098] Optionally, the obtaining module is configured to: display a process choreography page, where the process choreography page includes at least one service process choreography control; and generate a service process configuration file in response to a selection operation of the user on the at least one service process choreography control on the process choreography page.

[0099] The above device can execute the method provided by the embodiment of the present invention, and has corresponding function modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the method provided by the embodiment of the present invention.

[0100] An embodiment of the present invention further provides an electronic device, as Figure 8 shown, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804. Among them, the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0101] The memory 803 is used to store a computer program;

[0102] When the processor 801 executes the program stored in the memory 803, the following steps are implemented:

[0103] Obtain a service process configuration file, where the service process configuration file defines multiple statuses of service messages and consumers corresponding to the service messages in each status;

[0104] Generate a message queue for caching service messages;

[0105] Receive service messages generated by a producer, and write the generated service messages into the message queue;

[0106] Monitor the message queue, and send the service messages in each status in the message queue to corresponding consumers according to the service process configuration file.

[0107] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0108] The communication interface is used for communication between the above terminal and other devices.

[0109] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0110] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0111] In another embodiment provided by the present invention, a computer-readable storage medium is also provided. Instructions are stored in the computer-readable storage medium, and when it runs on a computer, it causes the computer to execute the data interaction method described in any one of the above embodiments.

[0112] In another embodiment provided by the present invention, a computer program product containing instructions is also provided. When it runs on a computer, it causes the computer to execute the data interaction method described in any one of the above embodiments.

[0113] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

[0114] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.

[0115] Each embodiment in this specification is described in a related manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

[0116] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included within the protection scope of the present invention.

Claims

1. A data interaction method, characterized in that: include: Obtain a business process configuration file, wherein the business process configuration file defines multiple states of a business message and consumers corresponding to the business message in each state; Generate a message queue for caching business messages; Receive the business message generated by the producer, and write the generated business message into the message queue; The message queue is monitored, and business messages in various states in the message queue are sent to corresponding consumers according to the business process configuration file.

2. The method according to claim 1, characterized in that The message queue includes a logical queue and a physical queue, the logical queue is used to cache the identification information and status of the service message, and the physical queue is used to cache the message content of the service message; Writing the generated business message into the message queue includes: Writing the identification information and status of the business message generated by the producer into the logical queue, and writing the message content of the business message into the physical queue; The monitoring of the message queue and sending the business messages in each state in the message queue to the corresponding consumers according to the business process configuration file include: The logical queue is monitored, message content of the service message in the logical queue is obtained from the physical queue, and the message content is sent to a consumer corresponding to the status of the service message.

3. The method according to claim 2, characterized in that The business process profile also includes a first policy; The method further comprises: According to the first strategy, calculating the target number of physical queues; According to the target number of physical queues and the current number of physical queues, it is determined whether to increase or decrease the number of physical queues.

4. The method according to claim 3, characterized in that The calculating the target number of physical queues according to the first strategy includes: Monitoring the logical queue to determine the rate at which business messages are generated and the rate at which business messages are consumed; Calculating a message flow rate according to the generation rate and the consumption rate; When the message flow rate is in the first interval, the target number of physical queues is a first preset value; When the message flow rate is in the second interval, the target number of physical queues is a second preset value; When the message flow rate is in the third interval, the target number of physical queues is a third preset value.

5. The method according to claim 3, characterized in that: The business process configuration file also includes a message allocation strategy; the message allocation strategy is used to indicate that the business message is allocated to the corresponding physical queue; Writing the message content of the service message into the physical queue includes: When the number of the physical queues is greater than or equal to 2, the corresponding physical queues are allocated to the service messages according to the message allocation strategy, and the message content of the service messages is written into the corresponding physical queues.

6. The method according to claim 3, characterized in that The business process profile also includes a second policy; The method further comprises: According to the second strategy, the service message in the specified state is cached in the specified physical queue.

7. The method according to claim 1, characterized in that The obtaining of the business process configuration file includes: Displaying a process orchestration page, wherein the process orchestration page includes at least one business process orchestration control; In response to a user's selection operation on the at least one business process choreography control on the process choreography page, a business process configuration file is generated.

8. A data interaction device, characterized in that: include: An acquisition module, used to acquire a business process configuration file, wherein the business process configuration file defines multiple states of a business message and consumers corresponding to the business message in each state; A queue module is used to generate a message queue for caching business messages; The queue proxy module is used to receive the business messages generated by the producer and write the generated business messages into the message queue; monitor the message queue and send the business messages in each state in the message queue to the corresponding consumers according to the business process configuration file.

9. An electronic device, characterized in that: including a processor, a communication interface, a memory and a communication bus; Wherein, the processor, the communication interface, and the memory communicate with each other via a communication bus; The memory is used to store computer programs; The processor is used to implement the method described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.