Item data distribution method and system based on message queue and interface

By using message queues and interfaces in the distribution of government affairs data, the problems of poor timeliness and data confusion in the prior art are solved, and efficient, stable and complete data distribution are achieved.

CN119513191APending Publication Date: 2025-02-25INSPUR SOFTWARE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411329594.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing government affairs data distribution methods have problems such as poor timeliness, unclear data logic, difficult data transactions to control, large data volume and accumulation, slow list interfaces, and poor business support capabilities, resulting in slow distribution speed, chaotic data, and difficult operation and maintenance.

Method used

Using the matter data distribution method based on message queue and interface, the data producer pushes key information to the message queue when matters change, and provides a matter details interface. The data consumer obtains key information from the message queue and calls the details interface to obtain detailed information for parsing and logical storage.

Benefits of technology

It improves the real-time and completeness of matter data, reduces data accumulation, reduces the pressure on matter sorting system, enhances the support ability of data to business systems, and achieves efficient, stable and complete data distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513191A_ABST
    Figure CN119513191A_ABST
Patent Text Reader

Abstract

The invention discloses an item data distribution method and system based on message queues and interfaces, belongs to the technical field of data distribution, and aims to solve the technical problem of how to realize efficient, stable and complete distribution of data. When the matter takes effect and is released or the matter cancels logic change, the data producer pushes key information of matter change logic to a message queue and provides a matter detail interface used for obtaining matter detail information; and the data consumer obtains key information of the item change logic from the message queue, calls an item detail interface to obtain item detail information based on the key information, and performs item analysis and logic storage according to the item change logic and the item detail information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data distribution, and in particular to a method and system for distributing event data based on a message queue and an interface. Background Art

[0002] With the advancement of the "Internet +" government service work and the construction of national government service integration, the standardization of government service items has become more and more perfect, and the requirements for the "three levels and four similarities" of items have become higher and higher. It has become an inevitable trend for the provincial level to take the lead in unifying the sorting of government affairs data. Since the provincial, municipal, district (county) and other levels use a variety of government affairs business systems and the volume of business is huge, different levels and even different systems need to synchronize the data they need, so the data distribution of government affairs has become a necessary and important thing. The producers of items in different provinces have their own data distribution methods. Some use the front-end library for push distribution, and some use a pure interface method that combines the item list interface and the detail interface for distribution.

[0003] At present, the commonly used data distribution methods are front-end library push and interface call. With the actual distribution practice, it is found that both methods have obvious disadvantages. The front-end library push method has the problems of poor timeliness, unclear data logic, difficult data transactions, large amount of data to be processed, and large amount of data accumulation. The combination of list interface and detail interface has the fatal defects of slow list interface, huge pressure on the interface provider, and poor data support for business. With the existing distribution method, as the amount of event data increases, the speed of event distribution will become slower and slower, the distributed data will become more and more chaotic, and the later operation and maintenance will become more and more difficult.

[0004] When data on events changes, how to achieve efficient, stable and complete data distribution is a technical problem that needs to be solved. Summary of the invention

[0005] The technical task of the present invention is to address the above deficiencies and provide a method and system for distributing event data based on message queues and interfaces to solve the technical problem of how to achieve efficient, stable and complete distribution of data.

[0006] In a first aspect, the present invention provides a method for distributing event data based on a message queue and an interface, which is applied to a government affairs event sorting system as a data producer and business systems at all levels that need to obtain data as data consumers. The method comprises the following steps:

[0007] When an event is published or the event cancellation logic changes, the data producer pushes the key information of the event change logic to the message queue and provides an event details interface for obtaining event details;

[0008] The data consumer obtains the key information of the event change logic from the message queue, and based on the key information, calls the event detail interface to obtain the event detail information, and performs event analysis and logical storage according to the event change logic and event detail information.

[0009] As a preferred embodiment, the data producer determines the key information and format of the event change logic, and divides the message subject according to business needs. When the event takes effect or the event cancels the logic change, the data producer encapsulates the key information of the event change logic according to the format, and pushes the encapsulated key information to the message queue according to the predetermined subject, and records the pushed key information;

[0010] Correspondingly, data consumers consume messages in the message queue according to the topics they need, obtain key information about the logic of event changes, and record the key information obtained.

[0011] Preferably, the matter details interface supports obtaining matter details information through matter primary keys, and the key information pushed by the data producer includes matter primary keys;

[0012] Correspondingly, after the data consumer obtains the key information of the event change logic, it calls the event detail interface to obtain the event detail information based on the event primary key in the key information.

[0013] Preferably, the data producer encapsulates the key information of the event change logic in JSON format.

[0014] Preferably, the message queue is a RocketMQ component, connected between the data producer and the data consumer.

[0015] In a second aspect, the present invention provides a matter data distribution system based on a message queue and an interface, comprising a government affairs matter sorting system as a producer, business systems at various levels that need to obtain data as data consumers, and a message queue;

[0016] When an event is published or the event cancellation logic changes, the data producer is used to perform the following: push the key information of the event change logic to the message queue, and provide an event details interface for obtaining event details;

[0017] The data consumer is used to perform the following: obtain the key information of the event change logic from the message queue, and based on the key information, call the event detail interface to obtain the event detail information, and perform event analysis and logical storage according to the event change logic and event detail information.

[0018] Preferably, the data producer is used to perform the following: determine the key information and format of the event change logic, and divide the message subject according to business needs. When the event takes effect or the event cancels the logic change, the data producer encapsulates the key information of the event change logic according to the format, and pushes the encapsulated key information to the message queue according to the predetermined subject, and records the pushed key information;

[0019] Correspondingly, data consumers consume messages in the message queue according to the topics they need, obtain key information about the logic of event changes, and record the key information obtained.

[0020] Preferably, the matter details interface supports obtaining matter details information through matter primary keys, and the key information pushed by the data producer includes matter primary keys;

[0021] Correspondingly, after the data consumer obtains the key information of the event change logic, it calls the event detail interface according to the event primary key in the key information to obtain the event detail information.

[0022] Preferably, the data producer encapsulates the key information of the event change logic into JSON format.

[0023] Preferably, the message queue is a RocketMQ component, connected between the data producer and the data consumer.

[0024] The method and system for distributing matter data based on message queues and interfaces of the present invention have the following advantages: message queues are used to transmit key information of matter change logic, replacing the large amount of data accumulation in the front-end library and the original list interface, and the advantages of low latency, high concurrency, high availability, and high reliability of message queues are reasonably used. Compared with the front-end library method, the real-time performance is greatly improved, the accumulation of a large amount of data in the front-end library is reduced, and the integrity of the matter data is greatly improved. Compared with the pure interface method, the list interface is replaced, which greatly reduces the pressure on the matter combing system, and the distributed data greatly improves the support capacity for business system data. The use of the matter details interface can ensure the integrity of the data at the matter granularity. In short, the invention can avoid the shortcomings of previous distribution methods and can achieve efficient, stable, and complete long-term distribution of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] The present invention is further described below in conjunction with the accompanying drawings.

[0027] Figure 1 This is a flowchart of a method for distributing event data based on a message queue and an interface in Example 1. DETAILED DESCRIPTION

[0028] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.

[0029] The embodiments of the present invention provide a method and system for distributing event data based on a message queue and an interface, which are used to solve the technical problem of how to achieve efficient, stable and complete distribution of data.

[0030] Embodiment 1:

[0031] The present invention provides a method for distributing event data based on a message queue and an interface, which is applied to a government affairs event sorting system as a data producer and business systems at all levels that need to obtain data as data consumers. The method comprises the following steps:

[0032] Step S100: When an event is released to take effect or the event cancellation logic changes, the data producer pushes the key information of the event change logic to the message queue and provides an event details interface for obtaining event details information;

[0033] Step S200: The data consumer obtains key information of the event change logic from the message queue, and based on the key information, calls the event detail interface to obtain event detail information, and performs event analysis and logical storage according to the event change logic and event detail information.

[0034] In this embodiment, in step S100, the data producer determines the key information and format of the logic of the event change, and divides the message subject according to business needs. When the event takes effect and is published or the event cancels the logic change, the data producer encapsulates the key information of the logic of the event change according to the format, and pushes the encapsulated key information to the message queue according to the predetermined subject, and records the pushed key information; correspondingly, in step S200, the data consumer consumes the message in the message queue according to the required subject, obtains the key information of the logic of the event change, and records the obtained key information.

[0035] As a specific implementation, the data producer encapsulates the key information of the event change logic into JSON format, and the message queue uses RocketMQ middleware.

[0036] The matter details interface supports obtaining matter details information through the matter primary key. The key information pushed by the data producer includes the matter primary key. Correspondingly, after the data consumer obtains the key information of the matter change logic, it calls the matter details interface according to the matter primary key in the key information to obtain the matter details information.

[0037] Data consumers parse the detailed information of mud storage matters based on the format specifications of the detailed information and their own business logic requirements.

[0038] Embodiment 2:

[0039] The present invention discloses a matter data distribution system based on a message queue and an interface, comprising a government affairs matter sorting system as a producer, business systems at various levels that need to obtain data as data consumers, and a message queue.

[0040] When an event is published or the event cancellation logic changes, the data producer is used to perform the following: push the key information of the event change logic to the message queue, and provide an event detail interface for obtaining event detail information.

[0041] Correspondingly, the data consumer is used to perform the following: obtain the key information of the event change logic from the message queue, and based on the key information, call the event detail interface to obtain the event detail information, and perform event analysis and logical storage according to the event change logic and event detail information.

[0042] In this embodiment, the data producer is used to perform the following: determine the key information and format of the logic of event changes, and divide the message topics according to business needs. When the event takes effect and is published or the logic change of the event is cancelled, the data producer encapsulates the key information of the logic of event changes according to the format, and pushes the encapsulated key information to the message queue according to the predetermined topic, and records the pushed key information; correspondingly, the data consumer is used to consume messages in the message queue according to the required topic, obtain the key information of the logic of event changes, and record the obtained key information.

[0043] As a specific implementation, the data producer encapsulates the key information of the event change logic into JSON format, and the message queue uses RocketMQ middleware.

[0044] The matter details interface supports obtaining matter details information through the matter primary key. The key information pushed by the data producer includes the matter primary key. Correspondingly, after the data consumer obtains the key information of the matter change logic, it calls the matter details interface according to the matter primary key in the key information to obtain the matter details information.

[0045] Data consumers parse the detailed information of mud storage matters based on the format specifications of the detailed information and their own business logic requirements.

[0046] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims

1. A method for distributing event data based on a message queue and an interface, characterized in that: Applied to the government affairs sorting system as a data producer and the business systems at all levels that need to obtain data as data consumers, the method includes the following steps: When an event is published or the event cancellation logic changes, the data producer pushes the key information of the event change logic to the message queue and provides an event details interface for obtaining event details; The data consumer obtains the key information of the event change logic from the message queue, and based on the key information, calls the event detail interface to obtain the event detail information, and performs event analysis and logical storage according to the event change logic and event detail information.

2. The method for distributing event data based on message queue and interface according to claim 1, characterized in that: The data producer determines the key information and format of the event change logic, and divides the message topics according to business needs. When the event takes effect or the event cancels the logic change, the data producer encapsulates the key information of the event change logic according to the format, pushes the encapsulated key information to the message queue according to the predetermined topic, and records the pushed key information; Correspondingly, data consumers consume messages in the message queue according to the topics they need, obtain key information about the logic of event changes, and record the key information obtained.

3. The method for distributing event data based on message queue and interface according to claim 1, characterized in that: The event details interface supports obtaining event details information through the event primary key. The key information pushed by the data producer includes the event primary key. Correspondingly, after the data consumer obtains the key information of the event change logic, it calls the event detail interface to obtain the event detail information based on the event primary key in the key information.

4. The method for distributing event data based on message queue and interface according to claim 1, characterized in that: The data producer encapsulates the key information of the event change logic in JSON format.

5. The method for distributing event data based on message queue and interface according to claim 1, characterized in that: The message queue is a RocketMQ component that connects data producers and data consumers.

6. A transaction data distribution system based on message queue and interface, characterized in that It includes the government affairs sorting system as a producer, the business systems at all levels that need to obtain data as data consumers, and the message queue; When an event is published or the event cancellation logic changes, the data producer is used to perform the following: push the key information of the event change logic to the message queue, and provide an event details interface for obtaining event details; The data consumer is used to perform the following: obtain the key information of the event change logic from the message queue, and based on the key information, call the event detail interface to obtain the event detail information, and perform event analysis and logical storage according to the event change logic and event detail information.

7. The event data distribution system based on message queue and interface according to claim 6 is characterized in that: The data producer is used to perform the following: determine the key information and format of the event change logic, and divide the message topics according to business needs. When the event takes effect or the event cancels the logic change, the data producer encapsulates the key information of the event change logic according to the format, pushes the encapsulated key information to the message queue according to the predetermined topic, and records the pushed key information; Correspondingly, data consumers consume messages in the message queue according to the topics they need, obtain key information about the logic of event changes, and record the key information obtained.

8. The event data distribution system based on message queue and interface according to claim 6 is characterized in that: The event details interface supports obtaining event details information through the event primary key. The key information pushed by the data producer includes the event primary key. Correspondingly, after the data consumer obtains the key information of the event change logic, it calls the event detail interface according to the event primary key in the key information to obtain the event detail information.

9. The event data distribution system based on message queue and interface according to claim 6 is characterized in that: The data producer is used to encapsulate the key information of the event change logic in JSON format.

10. The event data distribution system based on message queue and interface according to claim 6, characterized in that: The message queue is a RocketMQ component that connects data producers and data consumers.

Citation Information

Patent Citations

  • Distributed transaction processing method and device

    CN110968586A

  • Distributed event bus processing method based on message queue, terminal and medium

    CN112527525A

  • Real-time message pushing method, system and device based on message queue and medium

    CN114116259A

  • Method and system for distributing data according to authority based on message queue

    CN114661720A

  • File interaction system based on Rabbit MQ

    CN117453622A