Method and system for solving message sending service process of message-oriented middleware
By acquiring and parsing message templates and historical record data, and automatically combining the message body with preset associated information, the problem of inefficiency and format error risks in the test business process in the prior art is solved, and efficient and accurate data processing is achieved.
Patent Information
- Application Number
- CN202411853452.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, when each service in the test business process passes through RocketMQ, downstream services need to manually obtain business data from the upstream system, resulting in inefficient efficiency, high labor costs, and risk of format errors.
By obtaining the message push records in the target customer and historical push records, calling the corresponding original message template, parsing and updating the message template, synchronizing the data with preset associated information, combining the data into a message body, realizing partial automation filling, improving processing efficiency and reducing the risk of format errors.
Partial automatic filling is realized, processing efficiency is improved, the risk of format errors of artificial filling is reduced, and data processing efficiency and accuracy in complex business processes are improved.
Smart Images

Figure CN119883672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automation technology, and in particular to a message middleware message sending business process solution and system. Background Art
[0002] RocketMQ is known for its high performance, high availability, high reliability and flexible scalability, and is very suitable for use in e-commerce, finance and other fields. RocketMQ has significant technical features. It supports high-throughput and low-latency message delivery, and can handle massive message accumulation without affecting performance. RocketMQ achieves efficient message storage and transmission through sequential disk writing, zero-copy technology and batch processing. At the same time, it provides a variety of message models, including point-to-point (P2P) model, publish-subscribe (Pub / Sub) model and sequential messages to meet different business needs. In terms of reliability, RocketMQ ensures the reliability of messages through mechanisms such as message persistence, message retry and dead letter queue. It also supports Broker's master-slave replication and automatic failover, further improving the stability and availability of the system.
[0003] In addition, RocketMQ provides a wealth of management functions and monitoring interfaces, including visual consoles, operation and maintenance commands, and integrated monitoring, which facilitate users to monitor and manage the system. At the same time, it supports multiple client languages and APIs, and can be easily integrated into different applications. RocketMQ is a powerful, high-performance distributed messaging middleware that can be applied to various distributed scenarios, providing developers with efficient and reliable messaging services.
[0004] In the current testing business process, each service transmits messages through RocketMQ. Downstream services need to manually obtain business data from upstream systems, which is particularly cumbersome when there are many service associations. In order to ensure that the upstream service starts normally, testers need to spend a lot of time in the early stage to familiarize themselves with the upstream business and create the necessary data. This method is inefficient, and if the MQ message body is manually spliced, the tester must also understand the message body format and data content required by each service, which leads to high labor costs and significantly increases the risk of format errors. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a message middleware message sending business process solution to eliminate or improve one or more defects in the prior art.
[0006] One aspect of the present invention provides a message middleware message sending business process solution, the method comprising the steps of:
[0007] Obtain message push records from target customers and historical push records;
[0008] Based on the target customer, the corresponding original message template is called, and each service of the target customer corresponds to an original message template;
[0009] Feedback the original message template to the working end to obtain an updated message template fed back by the working end, parse the updated message template to obtain a data set including field names and field values in the updated message template;
[0010] Synchronize the data in the message push record to the data set based on the preset association information;
[0011] The business needs of the target customers are obtained, and based on the business needs of the target customers, the corresponding data in the data set are combined into a message body, and the message body is fed back to the target customers.
[0012] By adopting the above scheme, this scheme can, through the pre-set message template, on the one hand, provide feedback to the work end and obtain the updated message template updated by the staff; on the other hand, this scheme can utilize part of the data in the historical records through the pre-set related information, and can realize partial automatic filling, thereby improving processing efficiency and reducing the risk of format errors caused by manual filling.
[0013] In some embodiments of the present invention, the method further comprises:
[0014] The data in the message body fed back to the user each time is recorded, and the data in the historical push record is updated based on the newly recorded data.
[0015] In some embodiments of the present invention, in the step of updating the data in the historical push record based on the data of the new record, for the update time of each data item in the historical push record, it is determined whether the data is in a state to be updated based on the update time of each data item. If the data is in a state to be updated, then if the data of the new record includes the data, the data in the historical push record is updated.
[0016] In some embodiments of the present invention, in the step of determining whether each data item is in a state to be updated based on its update time, an update time threshold for each data item is obtained, and the time interval between the update time of each data item and the current time is compared with the update time threshold to determine whether the data item is in a state to be updated.
[0017] In some embodiments of the present invention, in the step of comparing the time interval between the update time and the current time of each data with the update time threshold to determine whether the data is in a state to be updated, if the time interval between the update time and the current time is greater than or equal to the update time threshold, then the data is determined to be in a state to be updated; if the time interval between the update time and the current time is less than the update time threshold, then the data is determined not to be in a state to be updated.
[0018] In some embodiments of the present invention, in the step of synchronizing the data in the message push record to the data set based on preset association information, the association information includes a corresponding relationship. If there is a corresponding relationship between the data in the message push record and the data in the data set, the data in the data set is replaced with the data in the message push record.
[0019] In some embodiments of the present invention, in the step of synchronizing the data in the message push record to the data set based on preset association information, the association information includes a one-way conversion relationship. If there is a one-way conversion relationship between the data in the message push record and the data in the data set, the data in the message push record is converted and the converted data is stored in the data set.
[0020] In some embodiments of the present invention, in the step of parsing the update message template to obtain a data set including field names and field values in the update message template, the update message template is constructed as an image, and optical character recognition (OCR) technology is used to identify the field names and field values in the image.
[0021] In some embodiments of the present invention, the original message template includes fixed data items, and in the step of feeding back the original message template to the working end, the fixed data items are fixed to a non-editable state.
[0022] The second aspect of the present invention also provides a message middleware message sending business process solution system, the system includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, when the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.
[0023] The third aspect of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps implemented by the aforementioned message middleware message sending business process solution.
[0024] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention can be specifically pointed out and obtained in the specification and the accompanying drawings.
[0025] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0027] Figure 1 A schematic diagram of an implementation of a message sending business process solution for a message middleware of the present invention;
[0028] Figure 2 This is a schematic diagram of the architecture of the message sending business process solution of the message middleware of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0030] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0031] In the prior art, manual business processes are often used. In the manual business processes, data tables need to be transferred between nodes in the process, filled in by the staff in the process, and finally the filled data tables are combined to obtain a message body, which is sent to the user end;
[0032] Therefore, the existing technology is relatively inefficient. For complex business process systems, if you want to create test data required for downstream services, you need to start from the upstream business system. During the business process, if there are environmental problems in the upstream system, you need to troubleshoot the environmental problems and go through all business processes of the upstream system, which will consume a lot of time and labor costs.
[0033] Manually splicing message bodies has low accuracy:
[0034] Manually spliced message bodies are generally in JSON format. If you manually splice MQ message bodies, you need to learn each nested format of the JSON format, be familiar with the required field content of each service message body, and ensure that the spliced message body complies with the specified format. The error rate of manual splicing is high.
[0035] like Figure 1 and 2 As shown, the present invention proposes a message middleware message sending business process solution, the steps of the method include:
[0036] Step S100, obtaining the target customer and the message push record in the historical push record;
[0037] In some implementations of the present invention, the target customer is one of a plurality of pre-stored customers to be selected, and the original message templates of the customers to be selected are all stored in the system of the present solution.
[0038] In some implementations of the present invention, the message push record in the historical push record includes data in the message body pushed to the user multiple times.
[0039] In the specific implementation process, the latest message body is selected as the original message body according to the message record and message result corresponding to the topic query, and the message body in the latest message record is automatically selected through the sched module. The generation strategy is triggered regularly according to the time interval of the pool data scan to ensure the timeliness of the data; the original message body is parsed and the corresponding operation page is generated according to the field configuration rule matching.
[0040] In the specific implementation process,
[0041] 1. Create different data pools (mainly corresponding to different topic message themes) and define the fields you need. They support string, file and data types. This is a bit like a database table.
[0042] 2. For this data pool, configure the number creation rules / strategies for the data in the pool, such as: the newly added field data in the message body of the pool, the field generation rules, value selection rules, associated data sources, and corresponding query SQL;
[0043] 3. For this pool, different test environments can be configured, and the detailed number-generating rules in each environment are different (mainly used when the same business test is executed in different environments);
[0044] 4. Support generation and preprocessing steps. Each type of step is applicable to different scenarios and can be understood based on the literal meaning. For example, generation means generating test data, and preprocessing means processing data before providing it to others.
[0045] According to the page information and the original message body assembly, select the environment to send the message;
[0046] Combine the original message body and the field rules configured by the user to dynamically assemble a message body that meets business needs. According to the current business scenario and needs, select a pre-configured test environment to ensure that the message is sent to the correct target, improving the flexibility and adaptability of the system.
[0047] Step S200, calling a corresponding original message template based on the target customer, each service of the target customer corresponds to an original message template;
[0048] In some implementations of the present invention, the original message template is provided with a user identifier and a service identifier, and the user corresponding to the original message template is determined based on the user identifier, and the service corresponding to the original message template is determined based on the service identifier.
[0049] Step S300, feeding back the original message template to the working end, obtaining an updated message template fed back by the working end, parsing the updated message template, and obtaining a data set including field names and field values in the updated message template;
[0050] In some embodiments of the present invention, the working end is an operating end of a staff member, and the staff member of the working end edits at the operating end. The data items operated by the staff member are field names, and the data input by the staff member are field values.
[0051] Step S400, synchronizing the data in the message push record to a data set based on preset association information;
[0052] In some embodiments of the present invention, the preset association information includes the correspondence between the data items and field names in the message push record. If a corresponding relationship exists, the data in the data items in the message push record are synchronized to the field values of the corresponding field names in the data set.
[0053] Step S500, obtaining the business needs of the target customer, combining the corresponding data in the data set into a message body based on the business needs of the target customer, and feeding back to the target customer.
[0054] In some implementations of the present invention, the business demand of the target customer is the business required by the customer.
[0055] In some embodiments of the present invention, in the step of combining the corresponding data in the data set into a message body based on the business needs of the target customer and feeding back to the target customer, the corresponding data in the data set is constructed into a data packet and fed back to one end of the target user.
[0056] By adopting the above scheme, this scheme can, through the pre-set message template, on the one hand, provide feedback to the work end and obtain the updated message template updated by the staff; on the other hand, this scheme can utilize part of the data in the historical records through the pre-set related information, and can realize partial automatic filling, thereby improving processing efficiency and reducing the risk of format errors caused by manual filling.
[0057] In some embodiments of the present invention, the method further comprises:
[0058] The data in the message body fed back to the user each time is recorded, and the data in the historical push record is updated based on the newly recorded data.
[0059] In the specific implementation process, after the message body is fed back to the user each time, the data in the message body is used as the data of the new record to update the data in the historical push record.
[0060] In some embodiments of the present invention, in the step of updating the data in the historical push record based on the data of the new record, for the update time of each data item in the historical push record, it is determined whether the data is in a state to be updated based on the update time of each data item. If the data is in a state to be updated, then if the data of the new record includes the data, the data in the historical push record is updated.
[0061] In some embodiments of the present invention, in the step of determining whether each data item is in a state to be updated based on its update time, an update time threshold for each data item is obtained, and the time interval between the update time of each data item and the current time is compared with the update time threshold to determine whether the data item is in a state to be updated.
[0062] In some embodiments of the present invention, in the step of comparing the time interval between the update time and the current time of each data with the update time threshold to determine whether the data is in a state to be updated, if the time interval between the update time and the current time is greater than or equal to the update time threshold, then the data is determined to be in a state to be updated; if the time interval between the update time and the current time is less than the update time threshold, then the data is determined not to be in a state to be updated.
[0063] By adopting the above scheme, this scheme can control the update frequency of data by setting an update time threshold for each data item. Different data are set with different update frequencies. A shorter update time threshold is set for data with high frequency changes. It can be applicable to different data and can realize automatic data update to ensure the accuracy of data synchronized to the message body.
[0064] In some embodiments of the present invention, in the step of synchronizing the data in the message push record to the data set based on preset association information, the association information includes a corresponding relationship. If there is a corresponding relationship between the data in the message push record and the data in the data set, the data in the data set is replaced with the data in the message push record.
[0065] In a specific implementation process, if there is a corresponding relationship between the data in the message push record and the data in the data set, and the data does not exist in the data item in the data set, the data in the data set is added as the data in the message push record.
[0066] By adopting the above solution, direct correspondence between data can be achieved through the corresponding relationship, which facilitates direct replacement or addition.
[0067] In some embodiments of the present invention, in the step of synchronizing the data in the message push record to the data set based on preset association information, the association information includes a one-way conversion relationship. If there is a one-way conversion relationship between the data in the message push record and the data in the data set, the data in the message push record is converted and the converted data is stored in the data set.
[0068] In the specific implementation process, the associated information includes a single conversion relationship. The data of the corresponding two items in the single conversion relationship cannot be directly replaced, but can be converted according to preset rules. For example, the 17th digit of the ID number identifies the gender of the person, odd numbers represent males, and even numbers represent females. The data of the gender item in the data set is determined based on whether the 17th digit of the ID number in the message push record is an odd number or an even number.
[0069] In some embodiments of the present invention, in the step of parsing the update message template to obtain a data set including field names and field values in the update message template, the update message template is constructed as an image, and optical character recognition (OCR) technology is used to identify the field names and field values in the image.
[0070] OCR technology, or Optical Character Recognition, is an advanced text recognition technology that can efficiently convert text data in image files into electronic text. This technology captures text information on various bills, newspapers, books, manuscripts and other printed materials through optical input methods such as scanning, and then uses complex algorithms and models to convert these image information into computer-recognizable and editable text formats.
[0071] The workflow of OCR technology usually includes steps such as image preprocessing, text area detection, character segmentation, character recognition, and post-processing. In the image preprocessing stage, the OCR system will first perform operations such as grayscale, binarization, denoising, and tilt correction on the input image to simplify the image information and improve the accuracy of text recognition. Subsequently, the system will determine the area in the image that may contain text through methods such as edge detection and contour analysis, and perform character segmentation. In the character recognition stage, OCR technology will use trained models or algorithms to extract features and classify the segmented characters, and finally convert the recognition results into computer-recognizable character codes.
[0072] In some embodiments of the present invention, the original message template includes fixed data items, and in the step of feeding back the original message template to the working end, the fixed data items are fixed to a non-editable state.
[0073] In summary, this solution shortens the business link and saves time for manual business processes on the one hand, and provides business data support for functions directly and quickly on the other hand. This technical solution aims to improve the data processing efficiency and accuracy in complex business processes through efficient message body storage, flexible field configuration and generation rules, and dynamic message assembly and sending mechanisms. Through automated management and configuration, manual intervention is reduced, the error rate is reduced, and efficient testing and business support are achieved.
[0074] An embodiment of the present invention also provides a message middleware message sending business process solution system, the system includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, when the computer instructions are executed by the processor, the system implements the steps implemented by the method described above.
[0075] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps implemented by the aforementioned message middleware message sending business process solution are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0076] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0077] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0078] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A message middleware message sending business process solution, characterized in that: The steps of the method include: Obtain message push records from target customers and historical push records; Based on the target customer, the corresponding original message template is called, and each service of the target customer corresponds to an original message template; Feedback the original message template to the working end to obtain an updated message template fed back by the working end, parse the updated message template to obtain a data set including field names and field values in the updated message template; Synchronize the data in the message push record to the data set based on the preset association information; The business needs of the target customers are obtained, and based on the business needs of the target customers, the corresponding data in the data set are combined into a message body, and the message body is fed back to the target customers.
2. The message middleware message sending business process solution according to claim 1, characterized in that: The method further comprises the steps of: The data in the message body fed back to the user each time is recorded, and the data in the historical push record is updated based on the newly recorded data.
3. The message middleware message sending business process solution according to claim 1, characterized in that: In the step of updating the data in the historical push record based on the data of the new record, for the update time of each data item in the historical push record, it is determined whether the data is in a state to be updated based on the update time of each data item. If the data is in a state to be updated, then if the data of the new record includes the data, the data in the historical push record is updated.
4. The message middleware message sending business process solution according to claim 3 is characterized in that: In the step of determining whether the data is in a state to be updated based on the update time of each data item, an update time threshold of each data item is obtained, and the time interval between the update time of each data item and the current time is compared with the update time threshold to determine whether the data item is in a state to be updated.
5. The message middleware message sending business process solution according to claim 1, characterized in that: In the step of comparing the time interval between the update time and the current time of each data item with the update time threshold to determine whether the data item is in a state to be updated, if the time interval between the update time and the current time is greater than or equal to the update time threshold, the data item is determined to be in a state to be updated; if the time interval between the update time and the current time is less than the update time threshold, the data item is determined not to be in a state to be updated.
6. The message middleware message sending business process solution according to claim 5, characterized in that: In the step of synchronizing the data in the message push record to the data set based on preset association information, the association information includes a corresponding relationship. If there is a corresponding relationship between the data in the message push record and the data in the data set, the data in the data set is replaced with the data in the message push record.
7. The message middleware message sending business process solution according to claim 5, characterized in that: In the step of synchronizing the data in the message push record to the data set based on preset association information, the association information includes a conversion relationship. If there is a conversion relationship between the data in the message push record and the data in the data set, the data in the message push record is converted and the converted data is stored in the data set.
8. The message middleware message sending business process solution according to claim 1, characterized in that: In the step of parsing the update message template to obtain a data set including field names and field values in the update message template, the update message template is constructed as an image, and optical character recognition (OCR) technology is used to recognize field names and field values in the image.
9. The message middleware message sending business process solution according to claim 8, characterized in that: The original message template includes fixed data items. In the step of feeding back the original message template to the working end, the fixed data items are fixed to a non-editable state.
10. A message middleware message sending business process solution system, characterized in that: The system includes a computer device, which includes a processor and a memory. The memory stores computer instructions. The processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the system implements the steps implemented by the method as described in any one of claims 1 to 9.