CN115827758A - Rule-based dynamic configuration event distribution method, device, equipment and storage medium - Google Patents

Rule-based dynamic configuration event distribution method, device, equipment and storage medium Download PDF

Info

Publication number
CN115827758A
CN115827758A CN202211539595.9A CN202211539595A CN115827758A CN 115827758 A CN115827758 A CN 115827758A CN 202211539595 A CN202211539595 A CN 202211539595A CN 115827758 A CN115827758 A CN 115827758A
Authority
CN
China
Prior art keywords
event
event distribution
distribution
rule
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211539595.9A
Other languages
Chinese (zh)
Inventor
刘子玉
杨浩威
侯志炜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Zhongtongji Network Technology Co Ltd
Original Assignee
Shanghai Zhongtongji Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhongtongji Network Technology Co Ltd filed Critical Shanghai Zhongtongji Network Technology Co Ltd
Priority to CN202211539595.9A priority Critical patent/CN115827758A/en
Publication of CN115827758A publication Critical patent/CN115827758A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to the technical field of software development, in particular to a method, a device, equipment and a storage medium for distributing events based on rule dynamic configuration, wherein different events are independent from each other and are used for executing different business functions; different business scenarios correspond to different event distribution rules; the method specifically comprises the following steps: responding to a first calling request generated based on a first service scene, and calling an event distribution interface; recording a first event distribution condition corresponding to a first service scene; acquiring a first event distribution rule corresponding to a first service scene; judging whether the first event distribution event can trigger the first event or not according to the first event distribution rule; and under the condition that the first event can be triggered, triggering the first event to realize the first service function requested by the first service scene. The method can effectively improve the flexibility and the expandability of the service system.

Description

Rule-based dynamic configuration event distribution method, device, equipment and storage medium
Technical Field
The present application relates to the field of software development technologies, and in particular, to a method, an apparatus, a device, and a storage medium for dynamically configuring event distribution based on rules.
Background
The business system refers to business links required by enterprises for positioning, roles played by all partners, and modes and contents of cooperation and transaction of interest relatives. When an existing service system processes a service scene with a complex flow, a specific function to be completed in the service scene needs to be hard-coded to a corresponding node in the flow, when a new service scene is accessed into the system, each function point in the flow needs to be hard-coded according to the characteristics of the new service scene, and the flexibility and the expandability are both greatly limited.
Disclosure of Invention
The embodiment of the application provides a rule-based dynamic configuration event distribution method, a rule-based dynamic configuration event distribution device, a rule-based dynamic configuration event distribution equipment and a storage medium, which are used for solving the problems.
In a first aspect, an embodiment of the present application provides a method for dynamically configuring event distribution based on rules, where different events are independent of each other, and the different events are used to execute different service functions; different business scenarios correspond to different event distribution rules; the method specifically comprises the following steps:
responding to a first calling request generated based on a first service scene, and calling an event distribution interface; recording a first event distribution condition corresponding to the first service scene; acquiring a first event distribution rule corresponding to the first service scene; judging whether the first event distribution rule can trigger a first event or not according to the first event distribution rule; and under the condition that the first event can be triggered, triggering the first event to realize the first service function requested by the first service scenario.
As a possible implementation manner, the first invocation request carries a scenario tag, where the scenario tag includes the identity information of the first service scenario.
As a possible implementation manner, the determining, according to the first event distribution rule, whether the first event distribution rule can trigger a first event includes: and polling at least one item of currently recorded event distribution condition at fixed time through an event distribution timing processor, and judging whether the first event distribution condition meets the first event distribution rule.
As a possible implementation manner, the triggering the first event includes: dynamically configuring a first xml file corresponding to the first event; executing the first event according to the configuration information in the yaml file.
As a possible implementation manner, after determining that the first event can be triggered, before reading the yaml file corresponding to the first event, the method further includes: and recording a first distribution message corresponding to the first event.
In a second aspect, an embodiment of the present application provides an event distribution device based on rule dynamic configuration, where different events are independent from each other, and the different events are used to execute different service functions; different business scenarios correspond to different event distribution rules; the device includes: the calling module is used for responding to a first calling request generated based on a first service scene and calling an event distribution interface; the recording module is used for recording a first event distribution condition corresponding to the first service scene; the acquisition module is used for acquiring a first event distribution rule corresponding to the first service scene; the judging module is used for judging whether the first event distributing event can trigger a first event or not according to the first event distributing rule; and the execution module is used for triggering the first event under the condition that the first event can be triggered, so as to realize the first service function requested by the first service scene.
As a possible implementation manner, the first invocation request carries a scenario tag, where the scenario tag includes the identity information of the first service scenario.
As a possible implementation manner, the determining module includes an event distribution timing processor, and the determining module is configured to: and polling at least one item of currently recorded event distribution condition at regular time through the event distribution timing processor, and judging whether the first event distribution rule is met by the first event distribution condition.
In a third aspect, embodiments of the present application further provide an electronic device, which includes a memory for storing program instructions and a processor for executing the program instructions, wherein when the program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of the first aspect.
In a fourth aspect, embodiments of the present application further provide a storage medium, which stores program instructions, and when the storage medium is run on an electronic device, the storage medium causes the electronic device to perform the method according to any one of the above first aspects.
The method, the device, the equipment and the storage medium for distributing events based on rule dynamic configuration in the embodiment of the application provide a rule-based dynamic event triggering mechanism, different distribution rules are set for business scenes, whether the distribution conditions of the business scenes can trigger corresponding events is judged based on the distribution rules, if the distribution conditions meet the distribution rules, the corresponding events are triggered to complete specific business functions required by the business scenes, the events can be independent, the addition, deletion or modification of one event cannot influence the execution of other events, and a dynamic calling and distributing mechanism of functional resources is formed. When the requirement of a new service function required by a new service scene is met, corresponding functions can be realized by adding rules and events corresponding to the service scene, each function point on the process does not need to be hard-coded, and the flexibility and the expandability are obviously improved.
Drawings
Fig. 1 is a schematic flowchart of a method for dynamically configuring event distribution based on rules according to an embodiment of the present application;
fig. 2 is a schematic operational flow diagram of an embodiment of a method for dynamically configuring event distribution based on rules according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a module architecture for dynamically configuring an event distribution device based on rules according to an embodiment of the present application.
Detailed Description
The terminology used in the description of the embodiments section of the present application is for the purpose of describing particular embodiments of the present application only and is not intended to be limiting of the present application.
The rule-based dynamic configuration event distribution method, device, equipment and storage medium provided by the embodiment of the application can be applied to an application scene of business system software development.
In the application scenario, when a new service scenario is accessed, the existing processing scheme needs to perform hard coding at a specific function point aiming at the new scenario, the coupling is too high, and the system flexibility is insufficient; moreover, accessing a new service scenario requires modification based on the original function logic, which affects the stability of the existing functions.
In view of this, the present application provides an event distribution method based on rule dynamic configuration to solve the above problem.
According to the event distribution method, each function in the business process is abstracted into an event, the event needs to meet a certain condition, the condition needs to meet a certain rule, the condition meets the rule to form a trigger event, and the specified action is completed, namely the specified function is completed.
The event trigger mechanism comprises three elements: the 3 elements can be flexibly matched in the database, when a new service scene needs to complete a specific function in the process, only a specific label needs to be distributed to the service scene to initialize a distribution condition, and when the distribution condition meets the distribution rule corresponding to the service scene, the specified event can be triggered to complete the specified function.
Specifically, referring to fig. 1, the method may include the steps of:
s101, responding to a first calling request generated based on a first service scene, and calling an event distribution interface.
For clarity of description, any service scenario in each service scenario is defined as a first service scenario, a call request sent by the first service scenario is a first call request, and a distribution condition, a distribution rule, an event and a service function corresponding to the first service scenario are respectively defined as a first distribution condition, a first distribution rule, a first event and a first service function. The terms "first" and "second" and "third" which may be present later are used for clarity only, do not indicate any limitation on spatial order or temporal order, and are not to be construed as limitations on performance.
In different service scenarios, when a new service function needs to be executed, a call request is sent to the call interface.
In one embodiment, the invocation request carries a scenario tag, and the scenario tag at least carries the identity information of the service scenario. The identification information may be an ID for uniquely identifying the service scenario to distinguish different service scenarios. Specifically, the scene label is a feature key of a certain condition in a specific scene, and can be linked to trigger the cleaning of a certain xml. A scenario label is understood to be a name of a specific service scenario, and is a name code in the form of a character string representation, which can represent a unique service scenario.
S102, recording a first event distribution condition corresponding to the first service scene.
S103, acquiring a first event distribution rule corresponding to the first service scene.
The event distribution rules are configured in advance and stored in a designated database, and different business scenarios have different event distribution rules.
And searching an event distribution rule matched with the first service scene according to the ID information carried in the calling request.
And S104, judging whether the first event distribution rule can trigger the first event or not according to the first event distribution rule.
The event distribution rules should at least determine what conditions a business scenario has to trigger the control logic of the corresponding event.
And after the distribution condition corresponding to the first service scene is determined, judging whether the first event can be triggered or not according to the first event distribution rule.
In an embodiment, the determining operation may be implemented by a timed polling manner, and specifically, the event distribution timing processor may periodically poll at least one currently recorded event distribution condition to determine whether the first event distribution condition satisfies the first event distribution rule.
And S105, under the condition that the first event can be triggered, triggering the first event to realize the first service function requested by the first service scene.
The execution process of the first event is a process of implementing the service function required by the first service scenario.
In one embodiment, the triggering of the first event may be dynamically configuring a first yaml file corresponding to the first event, and then executing the first event according to the configuration information in the yaml file. The dynamic configuration process may be preconfigured prior to event distribution or may be configured prior to execution of the first event.
In one embodiment, after determining that the first event can be triggered, a first distribution message corresponding to the first event is also recorded.
To facilitate understanding of the present application, several practical business scenarios are listed below: for example, in a vehicle rental business scene, after a rental document is pushed to a management system, a management system of the vehicle rental business scene can push a condition that the document is pushed to an event distributor, a timer of the event distributor can pull an event rule that the vehicle rental scene is pushed, automatically judge whether the end condition meets an expression configured by the rule, once the expression is established, trigger an event message for document summarization, and execute yaml configuration for document summarization.
For another example, in a temporary work forecast scenario, the personnel system automatically pushes the monthly calculation data, the network newspaper system automatically pushes the data in the history auditing process, the central station system is triggered to automatically generate data with documents not matched with the bill information, and the central station system needs to rely on the end conditions of 3 systems if the central station system automatically merges the data of other 2 systems with the internal data generated by the central station system.
The following is a specific example illustrating the method provided by the examples of the present application.
In this embodiment, n different service scenarios are included, which represent n different types of services accessed by the service system, and each service scenario has a different function. The first service scenario is any one of the n service scenarios. To avoid the description redundancy, the following description takes the service scenario 1 as the first service scenario as an example, and other service scenarios may be executed as references.
Different service scenes send transfer requests to the same event distribution interface, and different transfer requests carry different scene labels, so that the event distribution interface can identify different service scenes.
The event distribution interface is an entrance for triggering event distribution and is a calling interface.
And then, recording event distribution conditions corresponding to different service scenes respectively, and warehousing triggering conditions (namely the event distribution conditions) corresponding to functions to be completed by the service scenes. For example, the event distribution condition of the first business scenario is recorded.
The event distribution interface is an entry for generating an event distribution condition, where the distribution condition represents a service processing action of the first service scenario, such as completion of data pushing, completion of data summarization, completion of settlement, and the like.
Conditional binning is to record that a business action of a particular business scenario has occurred, the event distributor's decision is to trigger an event based on whether one or more conditions satisfy a regular expression, the conditional binning being the source of the event distributor.
The event distribution rules are pre-configured to determine what distribution conditions trigger a distribution event. Different service scenarios correspond to different event distribution rules, and as an implementable mode, the n service scenarios correspond to the n event distribution rules. It is not excluded that in other embodiments, the event distribution rule and the service scenario are in a one-to-many or many-to-one mapping relationship, and different service functions can be distinguished and implemented.
Illustratively, also taking a vehicle rental scenario as an example, after the settlement of the first party and the website is completed, the event distribution interface is invoked to transmit a condition of the completion of the settlement, and the event distributor defines a rule expression: and when the condition that the settlement is finished appears, the timer can continuously poll the scene to determine whether the condition that the settlement is finished exists, and when the condition that the settlement is finished appears, the condition that the settlement is finished shows that the condition that the settlement is finished satisfies the event rule, the transaction event of the scene is started to be distributed, and the transaction of the first party to the third party is finished.
In this embodiment, an event distribution timing processor is configured to periodically poll the currently-arriving event distribution condition to determine whether a distribution event can be triggered.
After determining that the corresponding event can be triggered, recording an event distribution message: and warehousing the distribution event to be executed, and carrying out the functional operation of the next specific scene. Distribution event warehousing, warehousing of a distribution message representing an event and enqueuing to an mq queue to wait for execution. The distribution message is mainly used for recording event ID, information required by function operation carried by the event, the execution state of the event and the like.
Configure specific functions according to yaml: the dynamic configuration of a specific function is in the yaml file.
Specifically, event distribution is abstracted into a distribution message representing an event in the system, the distribution message has an event processing state, the event carries new information and a unique identifier of the event, once the event occurs, the event enters an mq queue, the function operation module configures the yaml configuration corresponding to the event identifier, the information carried by the event is transmitted into the yaml configuration, the function processing is completed, and the event consumption is completed.
Illustratively, the event distributor may be implemented by interpretation and execution of a yaml format configuration.
The event distributor mainly refers to dynamic configuration of rules, and completes dynamic configuration from the occurrence of a business action to the execution of a trigger event of the intermediate flow.
The dynamic configuration of the yaml means that each specific event has a corresponding specific yaml configuration to complete corresponding functional processing, the various events are not coupled with each other, the dynamic configuration of the content of the yaml is performed by dynamically configuring the yaml through a configuration center, and a yaml functional processing module monitors the change of the yaml and loads the latest yaml configuration in real time to execute the dynamic configuration. The inside of yaml is mainly completed by dynamically configuring SQL, and the processing result is output to a database table through an output template to show that the function execution is completed.
It should be noted that the operation of dynamic configuration needs to be performed before event distribution.
In a second aspect, an embodiment of the present application further provides an apparatus for dynamically configuring an event distribution based on rules, and referring to fig. 3, the apparatus 300 may include:
the calling processing module 301 is configured to call an event distribution interface in response to a first calling request generated based on a first service scenario;
a recording module 302, configured to record a first event distribution condition corresponding to a first service scenario;
an obtaining module 303, configured to obtain a first event distribution rule corresponding to a first service scenario;
the judging module 304 is configured to judge whether the first event distribution rule can trigger the first event;
the execution module 305 is configured to trigger the first event to implement the first service function requested by the first service scenario if it is determined that the first event can be triggered.
In a third aspect, embodiments of the present application further provide an electronic device, which includes a memory for storing program instructions and a processor for executing the program instructions, wherein when the program instructions are executed by the processor, the electronic device is triggered to execute the method according to any of the above embodiments.
In a fourth aspect, the present application further provides a storage medium, in which program instructions are stored, and when the storage medium is run on an electronic device, the electronic device is caused to perform the method according to any one of the above embodiments.
In summary, the event distribution mechanism based on rule dynamic configuration provided by the application can realize the pluggable performance and flexibility of the function through the rule dynamic configuration; by the aid of independent trigger conditions and independent rules of independent scenes, isolation of different scenes is achieved, interference risks are not brought to other scenes, stability of original functions of a service system is guaranteed, new service functions can be added more flexibly and conveniently, and expansibility and compatibility are better.
The number of the data processors in the computer may be one or more, and optionally, the number of the memories may also be one or more, and the data processors and the memories may be connected by a bus or in other manners. The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the devices in the embodiments of the present application. The processor executes various functional applications and data processing by running non-transitory software programs, instructions and modules stored in the memory, that is, implements the tamper-proof method in any of the above-described method embodiments. The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; and necessary data, etc. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 procedures or functions described in accordance with the present application are generated, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk), among others.
In the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, and means that there may be three relationships, for example, a and/or B, and may mean that a exists alone, a and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. The event distribution method based on rule dynamic configuration is characterized in that different events are mutually independent and are used for executing different service functions; different business scenarios correspond to different event distribution rules; the method specifically comprises the following steps:
responding to a first calling request generated based on a first service scene, and calling an event distribution interface;
recording a first event distribution condition corresponding to the first service scene;
acquiring a first event distribution rule corresponding to the first service scene;
judging whether the first event distribution rule can trigger a first event or not according to the first event distribution rule;
and triggering the first event under the condition that the first event can be triggered, so as to realize the first service function requested by the first service scene.
2. The method of claim 1,
the first call request carries a scene tag, and the scene tag includes the identity information of the first service scene.
3. The method of claim 1,
the judging whether the first event distribution event can trigger the first event according to the first event distribution rule comprises the following steps:
and polling at least one item of currently recorded event distribution condition at fixed time through an event distribution timing processor, and judging whether the first event distribution condition meets the first event distribution rule.
4. The method of claim 1,
the triggering the first event includes:
dynamically configuring a first xml file corresponding to the first event;
executing the first event according to the configuration information in the yaml file.
5. The method of claim 4,
after determining that the first event can be triggered and before reading the yaml file corresponding to the first event, the method further includes:
and recording a first distribution message corresponding to the first event.
6. The event distribution device based on rule dynamic configuration is characterized in that different events are independent from each other and are used for executing different business functions; different business scenarios correspond to different event distribution rules; the device comprises:
the calling module is used for responding to a first calling request generated based on a first service scene and calling an event distribution interface;
the recording module is used for recording a first event distribution condition corresponding to the first service scene;
the acquisition module is used for acquiring a first event distribution rule corresponding to the first service scene;
the judging module is used for judging whether the first event distributing event can trigger a first event or not according to the first event distributing rule;
and the execution module is used for triggering the first event under the condition that the first event can be triggered, so as to realize the first service function requested by the first service scene.
7. The method of claim 6,
the first call request carries a scene tag, and the scene tag includes the identity information of the first service scene.
8. The method of claim 6,
the judging module comprises an event distribution timing processor and is used for:
and polling at least one item of currently recorded event distribution condition at regular time through the event distribution timing processor, and judging whether the first event distribution condition meets the first event distribution rule or not.
9. An electronic device, characterized in that the electronic device comprises a memory for storing program instructions and a processor for executing the program instructions, wherein the program instructions, when executed by the processor, trigger the electronic device to perform the method of any of claims 1-5.
10. A storage medium having stored therein program instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1-5.
CN202211539595.9A 2022-12-02 2022-12-02 Rule-based dynamic configuration event distribution method, device, equipment and storage medium Pending CN115827758A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211539595.9A CN115827758A (en) 2022-12-02 2022-12-02 Rule-based dynamic configuration event distribution method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211539595.9A CN115827758A (en) 2022-12-02 2022-12-02 Rule-based dynamic configuration event distribution method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115827758A true CN115827758A (en) 2023-03-21

Family

ID=85543799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211539595.9A Pending CN115827758A (en) 2022-12-02 2022-12-02 Rule-based dynamic configuration event distribution method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115827758A (en)

Similar Documents

Publication Publication Date Title
US11921672B2 (en) Query execution at a remote heterogeneous data store of a data fabric service
US11586627B2 (en) Partitioning and reducing records at ingest of a worker node
US20230147068A1 (en) Management of distributed computing framework components
US20220156335A1 (en) Streaming data processing
US11615104B2 (en) Subquery generation based on a data ingest estimate of an external data system
CN107729139B (en) Method and device for concurrently acquiring resources
CN106130882B (en) The method and apparatus for being used for transmission message
US20210117251A1 (en) Mobile application for an information technology (it) and security operations application
US20220156267A1 (en) Revising catalog metadata based on parsing queries
US20190095488A1 (en) Executing a distributed execution model with untrusted commands
CN109194736B (en) Message duplicate removal method and device, electronic equipment, medium and unmanned vehicle
CN112445626B (en) Data processing method and device based on message middleware
CN112905323B (en) Data processing method, device, electronic equipment and storage medium
CN112069265A (en) Configuration data synchronization method, service data system, computer system and medium
CN111258978B (en) Data storage method
CN109743137A (en) A kind of Distributed Delay message queue processing system for supporting to update
CN110581893B (en) Data transmission method and device, routing equipment, server and storage medium
US11789950B1 (en) Dynamic storage and deferred analysis of data stream events
US10585678B2 (en) Insertion of custom activities in an orchestrated application suite
CN113391901A (en) RPA robot management method, device, equipment and storage medium
CN111045928A (en) Interface data testing method, device, terminal and storage medium
CN115827758A (en) Rule-based dynamic configuration event distribution method, device, equipment and storage medium
CN115982133A (en) Data processing method and device
CN113779412B (en) Message touch method, node and system based on blockchain network
US11687487B1 (en) Text files updates to an active processing pipeline

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination