Event bus dynamic route allocation method, device and equipment and storage medium
By acquiring multi-dimensional features of events and optimizing routing decisions using a dynamic routing allocation model, the problem of event bus routing allocation in high-concurrency scenarios is solved, achieving efficient and compliant event processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
- Filing Date
- 2026-01-28
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies suffer from problems such as coarse event bus routing and allocation, event backlog, processing delays, or logical errors in high-concurrency and complex dynamic scenarios.
By acquiring multi-dimensional features of the target event, the routing path is determined using the target feature extraction model and decision model, and then quantified using the target reward function to dynamically adjust the weights to optimize the routing decision.
It achieves multi-objective optimization in scenarios with high concurrency, network fluctuations and frequent failures, reduces event backlog and processing delays, and improves system processing efficiency and business compliance.
Smart Images

Figure CN121887707A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and in particular to a method, apparatus, device, and storage medium for dynamic routing allocation of an event bus. Background Technology
[0002] In the field of event bus communication, mainstream technologies achieve inter-component communication through event propagation and queue allocation, covering various scenarios from simple event forwarding to feature-based targeted distribution, supporting the basic interaction needs of various systems. These technologies can complete the basic event processing flow under normal loads, providing a certain degree of support for the decoupling and collaboration of system components. However, existing technologies have significant shortcomings in high-concurrency and complex dynamic scenarios: event feature extraction remains at the basic attribute level, resulting in coarse routing criteria; at the same time, routing strategies often rely on fixed rules or single-objective optimization, which can easily lead to event backlog, processing delays, or logical errors.
[0003] In summary, how to improve the event bus routing allocation method to adapt to the routing allocation requirements in high-concurrency and complex dynamic scenarios is an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a dynamic routing allocation method, apparatus, device, and storage medium for an event bus, which can improve the event bus routing allocation method to adapt to the routing allocation requirements in high-concurrency and complex dynamic scenarios. The specific solution is as follows: In a first aspect, this application discloses an event bus dynamic routing allocation method, applied to a terminal equipped with a dynamic routing allocation system, comprising: The target event is acquired, and the multi-dimensional features corresponding to the target event are determined using a target feature extraction model; the multi-dimensional features include business relevance features, time-series dependency features, and resource consumption features. Based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, the routing path corresponding to the target event is determined using a target decision model, and the theoretical quantification result corresponding to each routing path is obtained using a target reward function; the routing path is a known routing path corresponding to the event type of the target event. Based on the theoretical quantization results, a target routing path is determined from all the routing paths corresponding to the target event, and the target event is distributed to the target event queue corresponding to the target routing path based on the target routing path.
[0005] Optionally, determining the multi-dimensional features corresponding to the target event using the target feature extraction model includes: Determine the data type corresponding to the original data of the target event; the data type includes structured field data, unstructured field data, and payload data; The feature extraction sub-network of the target feature extraction model processes the original data based on the data type to obtain the target features corresponding to the target event; The feature fusion layer of the target feature extraction model is used to assign corresponding dynamic weights to each target feature based on an attention mechanism. Based on the dynamic weights of each target, feature fusion is performed on the features of each target to determine the multi-dimensional features corresponding to the target event.
[0006] Optionally, the processing of the original data based on data type to obtain the target features corresponding to the target event includes: The original data, which is of structured field data, is processed using a factorization machine to obtain the first target feature; The original data, which consists of unstructured field data, is subjected to semantic analysis using a target fine-tuning model to obtain a second target feature. The target convolutional neural network is used to perform byte-level feature extraction on the original data, which is of data type load data, to obtain the third target feature.
[0007] Optionally, before determining the multi-dimensional features corresponding to the target event using the target feature extraction model, the method further includes: Determine whether the event type corresponding to the target event is the same as the event type obtained by the dynamic routing allocation system for the first time; If the event type corresponding to the target event is the event type obtained by the dynamic routing allocation system for the first time, then the target annotation sample corresponding to the event type of the target event is obtained, and the target feature extraction model is fine-tuned using the target annotation sample to obtain the fine-tuned target feature extraction model.
[0008] Optionally, before determining the routing path corresponding to the target event using the target decision model, the method further includes: Based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, the scenario state corresponding to the target event is determined using a target decision model; the scenario state includes a stable state and a changing state. Accordingly, determining the target routing path from all the routing paths corresponding to the target event based on the theoretical quantization result includes: If the scene state corresponding to the target event is a stable state, then the target routing path is determined from all the routing paths corresponding to the target event based on the theoretical quantization results; If the scenario state corresponding to the target event is in a changing state, then the optimal route path is determined from all the route paths corresponding to the target event based on the theoretical quantification results, and the target route path is determined from the optimal route path and the unknown route path corresponding to the target event using a target greedy strategy.
[0009] Optionally, the target reward function is: ; in, To quantify the theoretical results, , , and The dynamic weights are determined based on the real-time status of the dynamic routing allocation system. For priority matching degree, The queue load rate of the event queue corresponding to the routing path. The path delay rate of the route path. The path stability of the routing path.
[0010] Optionally, after distributing the target event to the target event queue corresponding to the target routing path based on the target routing path, the method further includes: Obtain the execution result data corresponding to the target event, and determine the actual quantization result of the target routing path corresponding to the target event based on the execution result data; The target deviation result is determined based on the theoretical quantization result and the actual quantization result of the target routing path, and the target decision model is fine-tuned based on the target deviation result to obtain the fine-tuned target decision model.
[0011] Secondly, this application discloses an event bus dynamic routing allocation device, applied to a terminal equipped with a dynamic routing allocation system, comprising: The feature determination module is used to acquire target events and use a target feature extraction model to determine the multi-dimensional features corresponding to the target events; the multi-dimensional features include business relevance features, time-series dependency features, and resource consumption features; The routing path quantization module is used to determine the routing path corresponding to the target event based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, using a target decision model, and to obtain the theoretical quantization result corresponding to each routing path using a target reward function; the routing path is a known routing path corresponding to the event type of the target event; The event distribution module is used to determine the target routing path from all the routing paths corresponding to the target event based on the theoretical quantization results, and to distribute the target event to the target event queue corresponding to the target routing path based on the target routing path.
[0012] Thirdly, this application discloses an electronic device, including: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned event bus dynamic routing allocation method.
[0013] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned event bus dynamic routing allocation method.
[0014] In this application, during event bus routing allocation, a terminal equipped with a dynamic routing allocation system acquires a target event and uses a target feature extraction model to determine the multi-dimensional features corresponding to the target event. These multi-dimensional features include business relevance features, temporal dependency features, and resource consumption features. Based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, a target decision model is used to determine the routing path corresponding to the target event, and a target reward function is used to obtain the theoretical quantification results corresponding to each routing path. The routing path is a known routing path corresponding to the event type of the target event. Based on the theoretical quantification results, a target routing path is determined from all the routing paths corresponding to the target event, and the target event is distributed to the target event queue corresponding to the target routing path based on the target routing path. As can be seen, this application utilizes a target feature extraction model to accurately extract deep, dynamic, multi-dimensional features of events, such as business relevance, temporal dependence, and resource consumption. This overcomes the limitations of coarse feature extraction in traditional technologies, providing fine-grained basis for routing decisions. The quantitative reward system and dynamic weight adjustment strategy built based on event features and real-time system status enable routing decisions to achieve multi-objective optimization in various scenarios such as high concurrency, network fluctuations, and frequent failures, avoiding the inefficiency or logical errors caused by traditional fixed rules. The synergistic effect of accurate feature extraction and intelligent routing effectively reduces issues such as event backlog and processing delays, improving the system's processing efficiency in high-concurrency scenarios. At the same time, the deep perception of business logic dependencies ensures the business compliance of event processing and enhances the support capability for complex business scenarios. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0016] Figure 1 This application discloses a flowchart of an event bus dynamic routing allocation method. Figure 2 This is a schematic diagram of the structure of an event bus dynamic routing allocation device disclosed in this application; Figure 3 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] In the field of event bus communication, mainstream technologies achieve inter-component communication through event delivery and queue allocation, covering various scenarios from simple event forwarding to feature-based targeted distribution, supporting the basic interaction needs of various systems. These technologies can complete the basic event processing flow under normal loads, providing a certain degree of support for the decoupling and collaboration of system components. However, existing technologies have significant shortcomings in high-concurrency and complex dynamic scenarios: event feature extraction remains at the basic attribute level, resulting in coarse routing criteria; simultaneously, routing strategies often rely on fixed rules or single-objective optimization, easily leading to event backlog, processing delays, or logical errors. To address these technical problems, this application discloses a dynamic event bus routing allocation method, which improves the event bus routing allocation method to adapt to the routing allocation needs in high-concurrency and complex dynamic scenarios.
[0019] See Figure 1 As shown, this embodiment of the invention discloses an event bus dynamic routing allocation method, applied to a terminal equipped with a dynamic routing allocation system, including: Step S11: Obtain the target event and use the target feature extraction model to determine the multi-dimensional features corresponding to the target event; the multi-dimensional features include business relevance features, time-series dependency features, and resource consumption features.
[0020] In this embodiment, the target feature extraction model is a feature extraction model constructed using a feature analysis algorithm optimized by deep learning. The multi-dimensional feature extraction methods for target events of different event types may differ. If the event type corresponding to the target event obtained by the dynamic routing allocation system is an event type that has not been processed before, the target feature extraction model within the dynamic routing allocation system may not be able to effectively extract the multi-dimensional features corresponding to the target event, thus affecting subsequent routing path allocation. Therefore, before using the target feature extraction model to determine the multi-dimensional features corresponding to the target event, the method further includes: determining whether the event type corresponding to the target event is the first event type obtained by the dynamic routing allocation system; if the event type corresponding to the target event is the first event type obtained by the dynamic routing allocation system, then obtaining the target annotation sample corresponding to the event type of the target event, and using the target annotation sample to fine-tune the target feature extraction model to obtain the fine-tuned target feature extraction model. By introducing such an online learning mechanism, when new event types appear in the dynamic routing allocation system, such as the newly added "IoT device offline" event, the target feature extraction model can be quickly fine-tuned using a small number of labeled samples. This allows the target feature extraction model to adapt quickly to the new event features, breaking through the limitations of coarse feature extraction in traditional techniques. It provides fine-grained basis for routing decisions, significantly improves the system's response speed to business changes, avoids feature extraction failure, and ensures the continuous effectiveness of the algorithm.
[0021] In this embodiment, the multi-dimensional features include business relevance features, temporal dependency features, and resource consumption features. The original data of the target time covers various types, including structured fields such as event ID, type, and timestamp, which have fixed formats and clear meanings; unstructured fields such as event description text and load data have variable formats and require in-depth analysis to extract effective information; and semi-structured fields, such as nested business parameters, fall between structured and unstructured, possessing a certain structure but not strictly defined. The multi-dimensional features corresponding to the target event are determined using a target feature extraction model. The specific process may include: determining the data type of the original data of the target event; data types include structured field data, unstructured field data, and load data; using the feature extraction sub-network of the target feature extraction model to process the original data based on the data type to obtain the target features corresponding to the target event; using the feature fusion layer of the target feature extraction model to assign corresponding dynamic weights to each target feature based on an attention mechanism; and performing feature fusion based on the dynamic weights of each target feature to determine the multi-dimensional features corresponding to the target event. Understandably, the importance of various features varies across different scenarios. For example, in high-priority events, the weight of the "urgency" feature will be higher than that of the "historical frequency" feature. By using this dynamic weight allocation, the features of the target event in multiple dimensions are integrated and a fused vector is output as a multi-dimensional feature, which can more comprehensively reflect the essence of the event.
[0022] In one specific implementation, the original data is processed based on data type to obtain target features corresponding to the target event. This includes: processing the original data with structured field data using a factorization machine to obtain the first target feature. The factorization machine can effectively capture the cross features between fields. For example, a combination like "payment event + 8 PM" may be associated with high concurrency requirements, and this hidden association can be discovered through the factorization machine. Then, a target fine-tuning model, such as BERT (Bidirectional Encoder Representations from Transformers, a pre-trained language model based on the Transformer architecture), is used to perform semantic analysis on the original data with unstructured field data to obtain the second target feature. The BERT fine-tuning model can achieve accurate extraction of semantic features. For example, from a text description like "server disk full," the urgency of "resource alert" can be identified, which is important for subsequent event processing priority judgment. By leveraging a target convolutional neural network (CNN) to extract byte-level features from raw data (data payload), a third target feature is obtained. Resource consumption features such as encryption identifiers for sensitive fields and data compression rates can be accurately extracted using CNNs, providing a basis for assessing the resources required for event processing. It's understandable that there is no specific order in which these three dimensions of target features are extracted. Accurately extracting multi-dimensional dynamic features of events provides fine-grained support for subsequent intelligent routing, addressing the problems of poor rule adaptability and omission of hidden features in traditional feature extraction.
[0023] Step S12: Based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, determine the routing path corresponding to the target event using the target decision model, and obtain the theoretical quantification results corresponding to each routing path using the target reward function; the routing path is the known routing path corresponding to the event type of the target event.
[0024] In this embodiment, the optimal distribution path for the target event is planned in real time based on the multi-dimensional characteristics of the target time and the implementation status of the dynamic routing allocation system, so as to achieve multi-objective optimization of "prioritizing high-priority events", "load balancing", and "fault tolerance". The real-time status of the dynamic routing allocation system includes, specifically, the real-time load of each execution queue (such as queue length, CPU / memory usage), inter-node network latency, and node health (such as historical failure frequency), which reflects the current operating status of the system. Before determining the routing path corresponding to the target event based on known information, the target decision model determines the scenario state corresponding to the target event based on the multi-dimensional characteristics of the target event and the real-time status of the dynamic routing allocation system; the scenario state includes stable state and changing state.
[0025] In this embodiment, a Deep Q-Network (DQN) can be used as the policy network to construct the target decision model. Through real-time interaction with the environment (event distribution → state feedback → reward calculation), the routing strategy is continuously optimized, achieving dynamic decision-making without human intervention. During the model training phase of the target decision model, the model randomly tries different routing paths, then uses the target reward function to calculate the "actual reward" of each path, and remembers that "this type of path has a high reward," thus favoring this type of path in similar scenarios; if a path has a low reward, its selection is reduced.
[0026] In one specific implementation, the target decision model first constructs a state space when determining the routing path corresponding to a target event. The state space contains three key types of information: First, event characteristics, which are fused vectors output by the feature analysis algorithm optimized by deep learning, encompassing important features such as event priority, business type, and resource consumption. Second, system status, including real-time load of each execution queue (e.g., queue length, CPU / memory usage), network latency between nodes, and historical failure frequency, reflecting the current operating status of the system. Third, topology, referring to the physical / logical relationships between execution queues, such as the dependency relationship between the "payment queue" and the "log queue," which significantly impacts the determination of the event's routing path. After constructing the state space, the target decision model determines the action space corresponding to the target event, i.e., all currently selectable routing paths for the target event, such as routing the target event from queue A to queue B, or directly to the target execution node. A defined action space provides the algorithm with multiple possible choices for decision-making. Then, the theoretical quantification results corresponding to each routing path can be determined based on the target reward function, thereby quantifying the merits of the routing paths.
[0027] In this embodiment, the target reward function is: ; in, To quantify the theoretical results, , , and The dynamic weights, determined based on the real-time status of the dynamic routing allocation system, can be adjusted according to the system scenario, such as during high concurrency. Increased weight leads to higher failure rates Weighting increased. Priority matching score is used; higher priority events score higher when routed to the fast queue. The queue load rate is the event queue corresponding to the routing path. The lower the load, the higher the score. The path latency rate is the routing path latency; the lower the latency, the higher the score. The stability of the routing path can be calculated based on historical data. The lower the failure frequency, the more stable the path and the higher the score.
[0028] In one specific implementation, the parameters are calculated as follows: The value is determined by the matching degree between event priority and the processing capacity of the target queue, ranging from 0 to 1. For example, when a high-priority event is routed to the "high-priority dedicated queue," =1; When routing to the "normal queue", =0.5.
[0029] : Calculated by the ratio of the current queue length to the maximum queue capacity, 1- This indicates the queue's idle level, ranging from 0 to 1. For example, if the queue currently has 80 events and a maximum capacity of 100, then... =0.8, 1- =0.2.
[0030] : The ratio of actual delay to theoretical minimum delay, 1- This indicates the degree of latency optimization, ranging from 0 to 1. If the actual latency is 60ms and the theoretical minimum latency is 50ms, then... =0.2, 1- =0.8.
[0031] The calculation method is 1 minus the ratio of the number of failures in the past hour to the total number of events processed, ranging from 0 to 1. For example, if a queue processes 1000 events in one hour and experiences 2 failures, then... =1-2 / 1000=0.998.
[0032] In one specific implementation, the adjustment of each dynamic weight can be referenced in Table 1 below. The quantitative reward system and dynamic weight adjustment strategy built based on event characteristics and real-time system status enable routing decisions to achieve multi-objective optimization in various scenarios such as high concurrency, network fluctuations, and frequent failures, avoiding the inefficiency or logical errors caused by traditional fixed rules.
[0033] Table 1. Reference Table for Dynamic Weight Adjustment
[0034] Step S13: Based on the theoretical quantization results, determine the target routing path from all the routing paths corresponding to the target event, and distribute the target event to the target event queue corresponding to the target routing path based on the target routing path.
[0035] In this embodiment, during the real-time decision-making phase, the target routing path is determined from all routing paths corresponding to the target event based on theoretical quantification results. Specifically, this may include: if the scene state corresponding to the target event is a stable state, then the target routing path is determined from all routing paths corresponding to the target event based on theoretical quantification results; if the scene state corresponding to the target event is a changing state, then the optimal routing path is determined from all routing paths corresponding to the target event based on theoretical quantification results, and the target routing path is determined from the optimal routing path and the unknown routing paths corresponding to the target event using a target greedy strategy. Unknown routing paths refer to routing paths whose theoretical quantification results are unknown. In other words, during the real-time decision-making phase, the target decision model calculates the "expected reward" (predicted by the target decision model) for all possible paths based on the current state (event characteristics + system state), and then selects the path with the highest reward. In normal scenarios (stable state), the path with the "highest expected value" is directly selected; in dynamic scenarios (when the system changes), an "ε-greedy strategy" or other target greedy strategy can be introduced to make a choice between the known optimal path and the unknown route path based on a preset probability to determine the target route path. For example, the known optimal path is selected with a 90% probability, and a new path is randomly selected with a 10% probability to explore potential better solutions.
[0036] In this embodiment, after the target routing path is determined, the target events are distributed to the target event queue according to the target routing path. Event distribution, as a crucial step in the event processing flow, aims to intelligently and efficiently allocate events to different execution queues based on event characteristics, while dynamically adjusting queue resources to cope with high concurrency and load changes. The overall architecture is based on a "deep learning-optimized feature analysis algorithm," providing accurate event characteristic data for the "intelligent routing algorithm." Through the synergy of the two, efficient event distribution is achieved. After event distribution is completed, the execution result data corresponding to the target event can be obtained, and the actual quantification result of the target routing path corresponding to the target event can be determined based on the execution result data. The target deviation result is determined based on the theoretical quantification result and the actual quantification result of the target routing path, and the target decision model is fine-tuned based on the target deviation result to obtain the fine-tuned target decision model. In other words, in this embodiment, data acquisition algorithms can be used to collect execution result data in real time (such as actual processing latency, queue load changes, and whether a fault occurred), and this execution result data can be converted into actual quantitative results, which are then fed back to the target decision model. The target decision model will determine the target deviation result based on the theoretical quantitative result and the actual quantitative result of the target routing path, and fine-tune the parameters to ensure more accurate subsequent decisions. The establishment of the decision-feedback closed loop allows the routing strategy to continuously and automatically evolve through real-time execution data. In the face of sudden scenarios, no manual intervention is required, reducing operation and maintenance costs while improving the stability and reliability of the system in complex dynamic environments.
[0037] As can be seen, this application utilizes a target feature extraction model to accurately extract deep, dynamic, multi-dimensional features of events, such as business relevance, temporal dependence, and resource consumption. This overcomes the limitations of coarse feature extraction in traditional technologies, providing fine-grained basis for routing decisions. The quantitative reward system and dynamic weight adjustment strategy built based on event features and real-time system status enable routing decisions to achieve multi-objective optimization in various scenarios such as high concurrency, network fluctuations, and frequent failures, avoiding the inefficiency or logical errors caused by traditional fixed rules. The synergistic effect of accurate feature extraction and intelligent routing effectively reduces issues such as event backlog and processing delays, improving the system's processing efficiency in high-concurrency scenarios. At the same time, the deep perception of business logic dependencies ensures the business compliance of event processing and enhances the support capability for complex business scenarios.
[0038] See Figure 2 As shown, this application discloses an event bus dynamic routing allocation device, applied to a terminal equipped with a dynamic routing allocation system, comprising: The feature determination module 11 is used to acquire the target event and use the target feature extraction model to determine the multi-dimensional features corresponding to the target event; the multi-dimensional features include business relevance features, time-series dependency features, and resource consumption features; The routing path quantization module 12 is used to determine the routing path corresponding to the target event based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system using a target decision model, and to obtain the theoretical quantization result corresponding to each routing path using a target reward function; the routing path is a known routing path corresponding to the event type of the target event; The event distribution module 13 is used to determine the target routing path from all the routing paths corresponding to the target event based on the theoretical quantization result, and to distribute the target event to the target event queue corresponding to the target routing path based on the target routing path.
[0039] As can be seen, this application utilizes a target feature extraction model to accurately extract deep, dynamic, multi-dimensional features of events, such as business relevance, temporal dependence, and resource consumption. This overcomes the limitations of coarse feature extraction in traditional technologies, providing fine-grained basis for routing decisions. The quantitative reward system and dynamic weight adjustment strategy built based on event features and real-time system status enable routing decisions to achieve multi-objective optimization in various scenarios such as high concurrency, network fluctuations, and frequent failures, avoiding the inefficiency or logical errors caused by traditional fixed rules. The synergistic effect of accurate feature extraction and intelligent routing effectively reduces issues such as event backlog and processing delays, improving the system's processing efficiency in high-concurrency scenarios. At the same time, the deep perception of business logic dependencies ensures the business compliance of event processing and enhances the support capability for complex business scenarios.
[0040] In one specific embodiment, the feature determination module 11 may include: The data type determination submodule is used to determine the data type corresponding to the original data of the target event; the data type includes structured field data, unstructured field data, and payload data; The data processing submodule is used to process the raw data based on the data type using the feature extraction subnetwork of the target feature extraction model to obtain the target features corresponding to the target event. The weight determination submodule is used to allocate corresponding target dynamic weights to each target feature based on the attention mechanism using the feature fusion layer of the target feature extraction model. The feature fusion submodule is used to perform feature fusion on the features of each target based on the dynamic weights of each target, so as to determine the multi-dimensional features corresponding to the target event.
[0041] In one specific implementation, the data processing submodule may include: The first feature extraction unit is used to process the original data, which is of the data type of structured field data, using a factorization machine to obtain the first target feature; The second feature extraction unit is used to perform semantic analysis on the original data, which is unstructured field data, using a target fine-tuning model to obtain the second target feature; The third feature extraction unit is used to perform byte-level feature extraction on the original data of data type load data using the target convolutional neural network to obtain the third target feature.
[0042] In one specific embodiment, the device may further include: The event type determination module is used to determine whether the event type corresponding to the target event is the event type obtained by the dynamic routing allocation system for the first time; The first model fine-tuning module is used to obtain target annotation samples corresponding to the event type of the target event if the event type corresponding to the target event is the event type obtained for the first time by the dynamic routing allocation system, and to fine-tune the target feature extraction model using the target annotation samples to obtain the fine-tuned target feature extraction model.
[0043] In one specific embodiment, the device may further include: The scenario state determination module is used to determine the scenario state corresponding to the target event based on the multi-dimensional features of the target event and the real-time state of the dynamic routing allocation system, using a target decision model; the scenario state includes a stable state and a changing state. Accordingly, the event distribution module 13 includes: The first path determination submodule is used to determine the target routing path from all the routing paths corresponding to the target event based on the theoretical quantization result if the scene state corresponding to the target event is a stable state. The second path determination submodule is used to determine the optimal route path from all the route paths corresponding to the target event based on the theoretical quantification results if the scene state corresponding to the target event is in a changing state, and to determine the target route path from the optimal route path and the unknown route path corresponding to the target event using a target greedy strategy.
[0044] In one specific embodiment, the device may further include: The execution result quantization module is used to obtain the execution result data corresponding to the target event, and determine the actual quantization result of the target routing path corresponding to the target event based on the execution result data; The second model fine-tuning module is used to determine the target deviation result based on the theoretical quantization result and the actual quantization result of the target routing path, and to fine-tune the target decision model based on the target deviation result to obtain the fine-tuned target decision model.
[0045] Furthermore, embodiments of this application also disclose an electronic device, Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0046] Figure 3 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the event bus dynamic routing allocation method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0047] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0048] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored thereon can include an operating system 221, computer programs 222, etc., and the storage method can be temporary storage or permanent storage.
[0049] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the event bus dynamic routing allocation method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0050] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned event bus dynamic routing allocation method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0051] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0052] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0053] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0054] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0055] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An event bus dynamic routing allocation method, characterized in that, Applied to terminals equipped with a dynamic routing allocation system, including: The target event is acquired, and the multi-dimensional features corresponding to the target event are determined using a target feature extraction model; the multi-dimensional features include business relevance features, time-series dependency features, and resource consumption features. Based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, the routing path corresponding to the target event is determined using a target decision model, and the theoretical quantification result corresponding to each routing path is obtained using a target reward function; the routing path is a known routing path corresponding to the event type of the target event. Based on the theoretical quantization results, a target routing path is determined from all the routing paths corresponding to the target event, and the target event is distributed to the target event queue corresponding to the target routing path based on the target routing path.
2. The event bus dynamic routing allocation method according to claim 1, characterized in that, The step of determining the multi-dimensional features corresponding to the target event using a target feature extraction model includes: Determine the data type corresponding to the original data of the target event; the data type includes structured field data, unstructured field data, and payload data; The feature extraction sub-network of the target feature extraction model processes the original data based on the data type to obtain the target features corresponding to the target event; The feature fusion layer of the target feature extraction model is used to assign corresponding dynamic weights to each target feature based on an attention mechanism. Based on the dynamic weights of each target, feature fusion is performed on the features of each target to determine the multi-dimensional features corresponding to the target event.
3. The event bus dynamic routing allocation method according to claim 2, characterized in that, The process of processing the raw data based on data type to obtain the target features corresponding to the target event includes: The original data, which is of structured field data, is processed using a factorization machine to obtain the first target feature; The original data, which consists of unstructured field data, is subjected to semantic analysis using a target fine-tuning model to obtain a second target feature. The target convolutional neural network is used to perform byte-level feature extraction on the original data, which is of data type load data, to obtain the third target feature.
4. The event bus dynamic routing allocation method according to claim 1, characterized in that, Before determining the multi-dimensional features corresponding to the target event using the target feature extraction model, the method further includes: Determine whether the event type corresponding to the target event is the same as the event type obtained by the dynamic routing allocation system for the first time; If the event type corresponding to the target event is the event type obtained by the dynamic routing allocation system for the first time, then the target annotation sample corresponding to the event type of the target event is obtained, and the target feature extraction model is fine-tuned using the target annotation sample to obtain the fine-tuned target feature extraction model.
5. The event bus dynamic routing allocation method according to claim 1, characterized in that, Before determining the routing path corresponding to the target event using the target decision model, the method further includes: Based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, the scenario state corresponding to the target event is determined using a target decision model; the scenario state includes a stable state and a changing state. Accordingly, determining the target routing path from all the routing paths corresponding to the target event based on the theoretical quantization result includes: If the scene state corresponding to the target event is a stable state, then the target routing path is determined from all the routing paths corresponding to the target event based on the theoretical quantization results; If the scenario state corresponding to the target event is in a changing state, then the optimal route path is determined from all the route paths corresponding to the target event based on the theoretical quantification results, and the target route path is determined from the optimal route path and the unknown route path corresponding to the target event using a target greedy strategy.
6. The event bus dynamic routing allocation method according to claim 1, characterized in that, The target reward function is: ; in, To quantify the theoretical results, , , and The dynamic weights are determined based on the real-time status of the dynamic routing allocation system. For priority matching degree, The queue load rate of the event queue corresponding to the routing path. The path delay rate of the route path. The path stability of the routing path.
7. The event bus dynamic routing allocation method according to any one of claims 1 to 6, characterized in that, After distributing the target event to the target event queue corresponding to the target routing path based on the target routing path, the method further includes: Obtain the execution result data corresponding to the target event, and determine the actual quantization result of the target routing path corresponding to the target event based on the execution result data; The target deviation result is determined based on the theoretical quantization result and the actual quantization result of the target routing path, and the target decision model is fine-tuned based on the target deviation result to obtain the fine-tuned target decision model.
8. An event bus dynamic routing allocation device, characterized in that, Applied to terminals equipped with a dynamic routing allocation system, including: The feature determination module is used to acquire target events and use a target feature extraction model to determine the multi-dimensional features corresponding to the target events; the multi-dimensional features include business relevance features, time-series dependency features, and resource consumption features; The routing path quantization module is used to determine the routing path corresponding to the target event based on the multi-dimensional features of the target event and the real-time status of the dynamic routing allocation system, using a target decision model, and to obtain the theoretical quantization result corresponding to each routing path using a target reward function; the routing path is a known routing path corresponding to the event type of the target event; The event distribution module is used to determine the target routing path from all the routing paths corresponding to the target event based on the theoretical quantization results, and to distribute the target event to the target event queue corresponding to the target routing path based on the target routing path.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the event bus dynamic routing allocation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store computer programs, wherein the computer programs, when executed by a processor, implement the event bus dynamic routing allocation method as described in any one of claims 1 to 7.