Message route matching method and device, electronic equipment and readable storage medium
By generating a target message scheme bit data set and combining it with bit operations and mapping relationships, the problem of low content filtering efficiency in the publish-subscribe communication model is solved, and the subscription scheme can be quickly determined and the message routing matching efficiency is improved.
Patent Information
- Application Number
- CN202511062255.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-10-10
AI Technical Summary
The existing publish-subscribe communication model has low efficiency in content filtering, especially when processing large-scale data. It cannot provide accurate content matching services, resulting in low message routing matching efficiency.
By determining the message type, content, and condition value of the target message, a corresponding scheme bit data set is generated, and bit operations and mapping relationships are used to quickly determine the subscription scheme that meets the conditions, reducing repeated calculation processes and improving message routing matching efficiency.
It enables rapid determination of subscription plans in large-scale data processing, reduces the amount of computation, improves the efficiency of message routing matching, and enhances system performance.
Smart Images

Figure CN120768871A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message routing matching method, device, electronic device and readable storage medium. Background Art
[0002] Messages can be transmitted using different modes. Publish-Subscribe (Pub / Sub) is a messaging paradigm that decouples message senders (publishers) and receivers (subscribers). Publishers do not send messages directly to subscribers. Instead, messages are distributed through an intermediary broker (Broker / Channel). Subscribers receive only the messages they are interested in.
[0003] In related technologies, publish-subscribe communication models mainly include three forms: channel-based model, topic-based model and content-based model. The channel-based and topic-based models perform well in message push due to their simplicity and efficiency, but they cannot provide users with accurate content matching services; while the content-based model has demonstrated powerful capabilities in content filtering, the method of traversing user and content screening conditions, although simple and intuitive, has a high time complexity and is difficult to meet the needs of large-scale data processing, resulting in low message routing matching efficiency. Summary of the Invention
[0004] In view of this, the purpose of the present application is to provide a message routing matching method, device, electronic device and readable storage medium. By calculating the bit data of the target message and subscription plan, the calculation level in the message routing matching process can be reduced, and the corresponding subscription plan can be quickly determined; at the same time, according to the mapping relationship between the subscription plan and the user, users with the same message requirements are mapped to the same subscription plan, and the matching between different subscription plans and users is directly matched, which further reduces the repeated routing matching calculation process and improves the efficiency of message routing matching.
[0005] In a first aspect, an embodiment of the present application provides a message routing matching method, the message routing matching method comprising:
[0006] Determining a message type, message content, and at least one specified condition value of a generated target message;
[0007] Based on the message type, the message content, and at least one specified condition value of the target message, determine a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding the at least one specified condition value, and a third scheme bit data set retaining the at least one specified condition value;
[0008] Determining a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set;
[0009] Converting at least one subscription scheme bit data included in the subscription scheme bit data set into at least one corresponding subscription scheme identifier;
[0010] Based on a pre-stored mapping relationship between subscription plans and users, a set of users to be pushed is determined, and the target message is pushed to at least one target user in the set of users to be pushed.
[0011] In a possible implementation, the first scheme bit data set is determined by the following steps:
[0012] Based on a plurality of pre-stored subscription schemes, determining at least one target subscription scheme consistent with the message type among the plurality of subscription schemes and a subscription scheme identifier of each target subscription scheme;
[0013] Based on preset encoding mode parameters, determining a subscription scheme group for each target subscription scheme obtained by calculating the subscription scheme identifier and the encoding mode parameters;
[0014] For each determined subscription plan group, determine the group plan bit data corresponding to the subscription plan group by bit operation;
[0015] Based on the respective grouping scheme bit data, the first scheme bit data set is determined.
[0016] In a possible implementation, determining a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set includes:
[0017] Determining a second sub-scheme bit data set excluding all specified condition values based on the second scheme bit data set;
[0018] Based on the third scheme bit data set, determining a third sub-scheme bit data set for retaining only one specified condition value;
[0019] Determining a target scheme bit data set that does not meet the message condition of the target message based on the second sub-scheme bit data set and the third sub-scheme bit data set;
[0020] Based on the first scheme bit data set and the inverted target scheme bit data set, a subscription scheme bit data set that meets the message condition of the target message is determined.
[0021] In a possible implementation, the message routing matching method further includes:
[0022] based on the subscription scheme identifier of each piece of subscription information and subscription scheme information; the subscription scheme information includes a subscription type of the subscription information and at least one specified condition value of the subscription information;
[0023] based on each piece of subscription information, grouping each piece of subscription information according to a corresponding subscription type, and encoding bit data corresponding to each subscription type, and caching subscription scheme bit data corresponding to each subscription type.
[0024] In a possible implementation, the encoding of bit data corresponding to each subscription type and the caching of subscription scheme bit data corresponding to each subscription type include:
[0025] based on the subscription scheme identifier of each piece of subscription information and a preset encoding mode parameter, determining a subscription scheme group to which each piece of subscription information of each subscription type belongs and a specific position in the determined subscription scheme group;
[0026] for each subscription scheme group, performing an OR operation on binary codes corresponding to at least one piece of subscription information belonging to the subscription scheme group to obtain a binary code result;
[0027] based on a binary code result set corresponding to each subscription scheme group, determining bit data encoding corresponding to the subscription type;
[0028] storing the subscription type and the bit data encoding of the subscription type in association, and caching subscription scheme bit data corresponding to each subscription type.
[0029] In a possible implementation, the message routing matching method further includes:
[0030] in response to a user performing a scheme subscription operation, determining a subscription demand parameter of the user subscription operation;
[0031] based on the subscription demand parameter of the user subscription operation, detecting whether at least one piece of subscription scheme that meets the user subscription demand exists in the currently stored subscription scheme;
[0032] if at least one piece of subscription scheme that meets the user subscription demand exists in the currently stored subscription scheme, constructing a mapping relationship between the at least one piece of subscription scheme that meets the user subscription demand and the user.
[0033] In a possible implementation, after detecting, based on the subscription requirement parameters of the user subscription operation, whether there is at least one subscription plan that meets the user subscription requirement in currently stored subscription plans, the message route matching method further includes:
[0034] If there is no subscription plan that meets the user's subscription requirements among the currently stored subscription plans, determine the subscription plan type and at least one specified condition value in the user's subscription requirement parameters;
[0035] Based on the subscription plan type in the user subscription requirement parameter and at least one specified condition value, construct a new subscription plan and adjust the currently cached subscription plan bit data;
[0036] Build a new mapping relationship between subscription plans and users.
[0037] In a second aspect, an embodiment of the present application further provides a message routing matching device, the message routing matching device comprising:
[0038] a target message determination module, configured to determine a message type and message content of a generated target message, and at least one specified condition value of the target message;
[0039] a scheme bit data set determining module, configured to determine, based on the message type, the message content, and at least one specified condition value of the target message, a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding the at least one specified condition value, and a third scheme bit data set retaining the at least one specified condition value;
[0040] a subscription scheme bit data determination module, configured to determine a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set;
[0041] a subscription scheme identifier conversion module, configured to convert at least one subscription scheme bit data included in the subscription scheme bit data set into at least one corresponding subscription scheme identifier;
[0042] The message push module is used to determine a set of users to be pushed based on a pre-stored mapping relationship between subscription plans and users, and push the target message to at least one target user in the set of users to be pushed.
[0043] In a third aspect, an embodiment of the present disclosure further provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the message routing matching method as described in any one of the first aspects.
[0044] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the message routing matching method as described in any one of the first aspects is executed.
[0045] The message routing matching method, device, electronic device and readable storage medium provided in the embodiments of the present application determine the message type, message content and at least one specified condition value of the generated target message; based on the message type, message content and at least one specified condition value of the target message, determine a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding at least one specified condition value and a third scheme bit data set retaining at least one specified condition value; based on the first scheme bit data set, the second scheme bit data set and the third scheme bit data set, determine a subscription scheme bit data set that meets the message condition of the target message; convert at least one subscription scheme bit data contained in the subscription scheme bit data set into at least one corresponding subscription scheme identifier; based on the pre-stored mapping relationship between subscription schemes and users, determine a set of users to be pushed, and push the target message to at least one target user in the set of users to be pushed. In this way, by calculating the bit data of the target message and subscription plan, the calculation level in the message routing matching process can be reduced, and the corresponding subscription plan can be quickly determined; at the same time, according to the mapping relationship between the subscription plan and the user, users with the same message requirements are mapped to the same subscription plan, and the matching between different subscription plans and users is directly based on the matching, which further reduces the repeated routing matching calculation process and improves the efficiency of message routing matching.
[0046] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0048] Figure 1 A flowchart of a message routing matching method provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a subscription information delivery model provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of binary storage of a subscription plan identifier provided in an embodiment of the present application;
[0051] Figure 4 A schematic diagram of message push provided in an embodiment of the present application;
[0052] Figure 5 This is one of the structural diagrams of a message routing matching device provided in an embodiment of the present application;
[0053] Figure 6 This is a second structural diagram of a message routing matching device provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.
[0056] First, the application scenarios to which this application is applicable are introduced. This application can be applied in the field of communication technology.
[0057] Messages can be transmitted using different modes. Publish-Subscribe (Pub / Sub) is a messaging paradigm that decouples message senders (publishers) and receivers (subscribers). Publishers do not send messages directly to subscribers. Instead, messages are distributed through an intermediary broker (Broker / Channel). Subscribers receive only the messages they are interested in.
[0058] In related technologies, publish-subscribe communication models primarily include three types: channel-based, topic-based, and content-based. These models exhibit unique characteristics and limitations in message routing and matching. Channel- and topic-based models, with their simplicity and efficiency, excel at message push, while also requiring relatively low system performance. However, these models struggle with content filtering, failing to provide users with precise content matching services.
[0059] In contrast, content-based models demonstrate strong filtering capabilities, accurately selecting messages based on user filtering criteria. However, this model requires individual filtering criteria for each message and each user during message processing, significantly increasing system performance overhead. This performance bottleneck is particularly pronounced when faced with massive event messages.
[0060] At present, the main methods for filtering message content include traversing user and content screening conditions in sequence, using regular expressions for screening, and matching messages based on B+ trees. However, these methods all have more or less shortcomings in terms of performance and flexibility. Although the method of traversing user and content screening conditions is simple and intuitive, its time complexity is relatively high and it is difficult to meet the needs of large-scale data processing. Although regular expressions can improve screening performance to a certain extent, their rules are fixed and new rules need to be modified. They lack sufficient flexibility. Although the message matching method based on B+ trees can improve matching efficiency to a certain extent, the construction and maintenance of B+ trees also consumes a lot of system resources. In other words, the message routing matching in the related art has the problem of low efficiency.
[0061] Based on this, an embodiment of the present application provides a message routing matching method to reduce the time of processing the target message push process and improve the efficiency of message routing matching.
[0062] See also Figure 1 , Figure 1 This is a flow chart of a message routing matching method provided by an embodiment of the present application. Figure 1 As shown in , the message routing matching method provided by the embodiment of the present application includes:
[0063] S101: Determine a message type, message content, and at least one specified condition value of a generated target message.
[0064] S102, determining a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding at least one specified condition value, and a third scheme bit data set retaining at least one specified condition value based on the message type, the message content, and the at least one specified condition value of the target message.
[0065] S103, determining a subscription scheme bit data set meeting the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set.
[0066] S104, converting at least one subscription scheme bit data included in the subscription scheme bit data set into a corresponding at least one subscription scheme identifier.
[0067] S105, determining a to-be-pushed user set based on a pre-stored mapping relationship between a subscription scheme and a user, and pushing the target message to at least one target user in the to-be-pushed user set.
[0068] The message routing matching method of the front-end component provided in the embodiments of the present application can reduce the calculation level in the message routing matching process through the calculation of the bit data of the target message and the subscription scheme, and can quickly determine the corresponding subscription scheme. Meanwhile, according to the mapping relationship between the subscription scheme and the user, the users with the same message requirement are corresponded to the same subscription scheme, and the repeated routing matching calculation process is further reduced directly according to the matching relationship between the different subscription schemes and the users, thereby improving the efficiency of the message routing matching.
[0069] The exemplary steps of the embodiments of the present application are described below:
[0070] S101, determining the message type, the message content, and at least one specified condition value of the generated target message.
[0071] In the embodiments of the present application, different modes can be used for transmission in the message transmission process. Pub / Sub is a message transmission paradigm, which is used to decouple the sender (publisher) and the receiver (subscriber) of the message. The publisher does not directly send the message to the subscriber, but distributes the message through an intermediate agent (Broker / Channel), and the subscriber only receives the message of interest.
[0072] Exemplarily, refer to Figure 2 , Figure 2 The schematic diagram of the subscription information transmission model provided in the embodiments of the present application is as follows: Figure 2As shown, the subscription information transmission model includes publishers, publish-subscribe middleware and subscribers; the publisher generates different events, determines the characteristics of the generated events, and pushes the generated events to the publish-subscribe middleware. The publish-subscribe middleware determines the message routing and generates messages, and determines at least one subscription plan that matches the generated message, and then pushes the generated message to at least one user corresponding to the subscription plan to complete the message push.
[0073] In related technologies, publish-subscribe communication models primarily include three types: channel-based, topic-based, and content-based. These models exhibit unique characteristics and limitations in message routing and matching. Channel- and topic-based models, with their simplicity and efficiency, excel at message push, while also requiring relatively low system performance. However, these models struggle with content filtering, failing to provide users with precise content matching services.
[0074] In contrast, content-based models demonstrate strong filtering capabilities, accurately selecting messages based on user filtering criteria. However, this model requires individual filtering criteria for each message and each user during message processing, significantly increasing system performance overhead. This performance bottleneck is particularly pronounced when faced with massive event messages.
[0075] At present, the main methods for filtering message content include traversing user and content screening conditions in sequence, using regular expressions for screening, and matching messages based on B+ trees. However, these methods all have more or less shortcomings in terms of performance and flexibility. Although the method of traversing user and content screening conditions is simple and intuitive, its time complexity is relatively high and it is difficult to meet the needs of large-scale data processing. Although regular expressions can improve screening performance to a certain extent, their rules are fixed and new rules need to be modified. They lack sufficient flexibility. Although the message matching method based on B+ trees can improve matching efficiency to a certain extent, the construction and maintenance of B+ trees also consumes a lot of system resources. In other words, the message routing matching in the related art has the problem of low efficiency.
[0076] In one possible implementation, after receiving the generated target message, it is necessary to determine the message type, message content, and at least one specified condition of the target message, and then complete the subsequent message matching with the subscription plan according to the corresponding content, and then push it to the user.
[0077] For example, taking the subscription information in the airport flight field, the current event is a new flight event, and for the new flight event, the message content is that flight stand 02 is newly added at terminal T1. Then the message type of the target message generated for this event is a new flight, and at least one specified condition value is terminal: T1; new flight stand: 02.
[0078] Furthermore, after determining the message type, message content, and at least one specified condition value of the target message, it is necessary to generate a corresponding scheme bit data set based on the determined message type, message content, and at least one specified condition value of the target message.
[0079] S102. Based on the message type, the message content, and at least one specified condition value of the target message, determine a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding at least one specified condition value, and a third scheme bit data set retaining at least one specified condition value.
[0080] In one possible implementation, a bit is the most basic data unit, representing a binary digit (0 or 1). Bit data generally refers to data stored, transmitted, or processed in units of binary bits.
[0081] Exemplarily, bit data is divided into: 1 bit (1 bit): can represent 0 or 1; 4 bits (nibble): can represent 16 states; 8 bits (1 byte): standard byte unit, can represent 256 states; 16 / 32 / 64 bits: used for integers, floating-point numbers, memory addresses, etc.
[0082] In the embodiment of the present application, in order to facilitate subsequent memory storage, the binary identification bit can also be converted into the corresponding subscription plan identification (subscription plan ID).
[0083] For example, after calculation, the 5th bit and the 24th bit of the binary result are 1 and 1, and the remaining bits are 0, and the identification scheme IDs are 5 and 24; for storage readability, the subscription scheme identification (scheme ID) set is saved.
[0084] In a possible implementation, when determining the first scheme bit data set corresponding to the message type, the first scheme bit data set may be determined according to subscription scheme identifiers corresponding to different subscription schemes.
[0085] Specifically, the first scheme bit data set is determined by the following steps:
[0086] a1: Based on a plurality of pre-stored subscription schemes, determine at least one target subscription scheme consistent with the message type and a subscription scheme identifier of each target subscription scheme from the plurality of subscription schemes.
[0087] a2: Based on preset encoding mode parameters, determine the subscription scheme groups of each target subscription scheme obtained by calculating the subscription scheme identifier and the encoding mode parameters.
[0088] a3: For each determined subscription plan group, determine the grouping plan bit data corresponding to the subscription plan group through bit operation.
[0089] a4: Based on the bit data of each grouping scheme, determine the first scheme bit data set.
[0090] In an embodiment of the present application, after determining the message type of the target message, it is necessary to determine the subscription scheme identifier of at least one target subscription scheme consistent with the message type from multiple pre-stored subscription schemes, and then based on the preset encoding method parameters, determine the subscription scheme grouping obtained after calculation based on the subscription scheme identifier and the encoding method parameters for each target subscription scheme.
[0091] Here, the encoding mode parameter is determined by the encoding mode of the current computer. For example, if the computer currently processing the subscription information is a 64-bit encoding computer, then the current encoding mode parameter is 64. At this time, based on the computer's bit operations, the time complexity of the calculation is O(1) (within a certain time range), further reducing the message push calculation time.
[0092] In one possible implementation, for each target subscription plan, the subscription plan identifier of the target subscription plan is divided by a preset encoding method parameter, and the integer part represents the group to which the subscription plan identifier belongs; the subscription plan identifier and the preset encoding method parameter are modulo, and the remainder represents the number of the subscription plan identifier in the current group.
[0093] For example, if there are currently three target subscription plans that are consistent with the message type, namely target subscription plan 1, target subscription plan 2, and target subscription plan 3; here, the subscription plan identifier of target subscription plan 1 is 5, the subscription plan identifier of target subscription plan 2 is 13, and the subscription plan identifier of target subscription plan 3 is 94. At this time, according to the division by 64, it is known that target subscription plan 1 and target subscription plan 2 belong to the same subscription plan group, and target subscription plan 3 belongs to another subscription plan group.
[0094] In a possible implementation, for each subscription scheme group, it is necessary to determine the grouping scheme bit data of the subscription scheme group through bit operation.
[0095] Specifically, an OR operation may be performed on the subscription scheme identifier of each target subscription scheme in the same subscription scheme group, and finally corresponding grouping scheme bit data is obtained.
[0096] In a possible implementation, the grouping scheme bit data corresponding to each subscription scheme group may be calculated using the following formula:
[0097] B=∨ x∈X (1<<(xmod64-1));
[0098] Here, B is the grouping scheme bit data; X represents the subscription scheme identifier set of each target subscription scheme in the subscription scheme group; x represents the subscription scheme identifier of any target subscription scheme; ∨ represents a bitwise OR operation; << represents a left shift operation; and xmod64 represents the remainder of the subscription scheme identifier of any target subscription scheme and 64.
[0099] For example, for any subscription plan group, the group includes five target subscription plans, and the subscription plan identifiers of the target subscription plans are determined to be 1, 5, 13, 25, and 44 respectively; according to the above calculation formula, the calculation result is determined to be:
[0100]
[0101] The d subscript indicates decimal, and the b subscript indicates binary.
[0102] For example, see Figure 3 , Figure 3 A schematic diagram of binary storage of the subscription plan identifier provided in the embodiment of the present application, such as Figure 3 As shown, the subscription plan identifiers are 5, 13 and 94 respectively. If the preset encoding method parameter is 64, the subscription plan identifier 5 is divided by 64, the quotient is 0 and the remainder is 5, then the subscription plan identifier 5 is located at the fifth position of the first group; the subscription plan identifier 13 is divided by 64, the quotient is 0 and the remainder is 13, then the subscription plan identifier 13 is located at the thirteenth position of the first group; the subscription plan identifier 94 is divided by 64, the quotient is 1 and the remainder is 30, then the subscription plan identifier 94 is located at the thirtieth position of the second group; when binary storage is performed, the bit data of the fifth position of the first group, the thirteenth position of the first group and the thirtieth position of the second group are 1, and the bit data of the remaining positions are 0.
[0103] Furthermore, after determining the first scheme bit data set corresponding to the message type, the second scheme bit data set excluding at least one specified condition value, and the third scheme bit data set retaining at least one specified condition value, the subscription scheme bit data set that meets the message conditions of the target message can be determined.
[0104] S103: Determine a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set.
[0105] In one possible implementation, the subscription plan bit data set may be determined by using the second plan bit data to determine a second sub-plan bit data set that excludes all specified condition values, and by using the third plan bit data to determine a third sub-plan bit data set that retains only one specified condition value, and then combining the first plan bit data set.
[0106] Specifically, the step of “determining a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set” includes:
[0107] b1: Based on the second scheme bit data set, determine a second sub-scheme bit data set that excludes all specified condition values.
[0108] b2: Based on the third scheme bit data set, determine a third sub-scheme bit data set for retaining only one specified condition value.
[0109] b3: Based on the second sub-scheme bit data set and the third sub-scheme bit data set, determine a target scheme bit data set that does not meet the message condition of the target message.
[0110] b4: Based on the first scheme bit data set and the inverted target scheme bit data set, determine a subscription scheme bit data set that meets the message condition of the target message.
[0111] In a possible implementation, the subscription plan bit data for a condition value that specifies exclusion of a certain condition in the subscription plan may be calculated using the following formula:
[0112]
[0113] Among them, P i [m] indicates the subscription plan bit data that specifies the condition value that excludes a certain condition in the subscription plan; X i Represents the set of subscription plan identifiers in any subscription plan group; x represents the subscription plan identifier of any target subscription plan; ∨ represents a bitwise OR operation; << represents a left shift operation; xmod64 represents the remainder of the subscription plan identifier of any target subscription plan and 64.
[0114] In a possible implementation, the subscription plan bit data that satisfies at least one specified exclusion condition (which may be different conditions) of the event message in the subscription plan can be calculated using the following formula:
[0115]
[0116] Among them, P i Represents the subscription plan bit data of the condition value that satisfies at least one specified exclusion condition (which can be different conditions) of the event message in the subscription plan; Ni represents the set of subscription plan identifiers in the subscription plan group that meets any condition; n represents the subscription plan identifier of any target subscription plan in the set of subscription plan identifiers in the subscription plan group that meets any condition; ∨ represents a bitwise OR operation; < represents a left shift operation; xmod64 represents the remainder of the subscription plan identifier of any target subscription plan and 64.
[0117] In a possible implementation, the subscription plan bit data for retaining a condition value specified in the subscription plan may be calculated using the following formula:
[0118]
[0119] Among them, Q i [m] indicates the subscription plan bit data that specifies the condition value of a certain condition to be retained in the subscription plan; X i Represents the set of subscription plan identifiers in any subscription plan group; x represents the subscription plan identifier of any target subscription plan; ∨ represents a bitwise OR operation; << represents a left shift operation; xmod64 represents the remainder of the subscription plan identifier of any target subscription plan and 64.
[0120] In a possible implementation, the subscription scheme bit data that satisfies at least one retention condition (only one condition) specified in the event message in the subscription scheme may be calculated using the following formula:
[0121] R M =∨ m∈M (Q i [m]), where M = {m1, m2, ..., m n};
[0122] Among them, R M Indicates the subscription scheme bit data that satisfies at least one retention condition (only one condition) specified by the event message in the subscription scheme; Q i [m] represents the subscription plan bit data that specifies the condition value of a certain condition to be retained in the subscription plan; M represents all condition values representing the condition value; m is any retained condition.
[0123] In a possible implementation, the following formula may be used to calculate the subscription plan bit data for which only a single condition involved in the message is selected in the subscription plan:
[0124]
[0125] Among them, K represents the subscription plan bit data that has and only selects a single condition involved in the message in the subscription plan; Ni represents the subscription plan identifier set in the subscription plan group that meets any condition; R M Indicates the subscription scheme bit data that satisfies at least one retention condition (only one condition) specified by the event message in the subscription scheme; Q i [m] represents the subscription plan bit data that specifies the condition value of a certain condition to be retained in the subscription plan; M represents all condition values representing the condition value; ∨ represents the bitwise OR operation; ∧ represents the bitwise AND operation; Indicates the negation operation.
[0126] Furthermore, the determined second sub-scheme bit data set and the third sub-scheme bit data set are subjected to a bitwise OR operation to determine the target scheme bit data set; further, the first scheme bit data set and the inverted target scheme bit data set are subjected to a bitwise AND operation to determine the subscription scheme bit data set that meets the message conditions of the target message.
[0127] In one possible implementation, after determining the subscription scheme bit data set, at least one subscription scheme bit data contained in the subscription scheme bit data set is converted into at least one corresponding subscription scheme identifier, and at least one subscription scheme identifier that meets the current target message is determined, and then based on the determined at least one subscription scheme identifier, at least one target user that needs to be pushed is determined.
[0128] S104: Convert at least one subscription scheme bit data included in the subscription scheme bit data set into at least one corresponding subscription scheme identifier.
[0129] Here, the determined subscription scheme bit data may be converted into corresponding binary data, and then the corresponding subscription scheme identifier may be determined according to the data value at each data position in the binary data.
[0130] For example, taking the preset encoding parameter of 64 as an example, in the data converted into binary, the fifth bit of the first group, the thirteenth bit of the first group, and the thirtieth bit of the second group are 1, and the bit data of the remaining positions are 0, then the corresponding subscription plan identifiers can be determined to be 5, 13, and 94.
[0131] In a possible implementation, in order to improve the matching efficiency of the target message, different subscription scheme bit data can be cached in advance, and when message matching is performed, the matching can be directly performed according to the subscription scheme bit data, so that the matching efficiency of the message can be improved.
[0132] Specifically, the message routing matching method further includes:
[0133] c1: based on the received subscription scheme identifier of each piece of subscription information and subscription information; wherein the subscription information includes the subscription type of the subscription information and at least one specified condition value corresponding to the subscription information.
[0134] c2: based on each piece of subscription information, grouping each piece of subscription information according to the corresponding subscription type, and encoding each subscription type and the bit data corresponding to each subscription type, and caching the subscription scheme bit data corresponding to each subscription type.
[0135] In a possible implementation, see Figure 4 , Figure 4 The message push schematic diagram provided by the embodiments of the present application is shown in Figure 4 , the event triggered target message content is used to determine the message routing, and the intermediate cache data is used to determine which subscription schemes the message belongs to, and then the message is distributed to the corresponding user according to the subscription scheme.
[0136] Here, in the message subscription and screening process, the real-time generated data mainly includes: subscription information generated by user subscription information and event triggered message content. The subscription information details record the scheme ID (subscription scheme identifier), user ID (user identifier), event type, message condition name and message condition value, and other key fields. The event triggered message mainly includes: message ID, message content, message type, message condition name and message condition value set. The user subscription information will be cached as intermediate data; the event triggered message content is used to determine the message routing, and the intermediate cache data is used to determine which subscription schemes the message belongs to, and then the message is distributed to the corresponding user according to the subscription scheme.
[0137] Here, after receiving each piece of subscription information, the subscription scheme identifier of each piece of subscription information and the subscription information need to be determined, and the subscription information includes the subscription type of the subscription information and at least one specified condition value corresponding to the subscription information.
[0138] In one possible implementation, in order to further improve performance, the present application caches the relationships involved in subscriptions into the corresponding hash table of Redis. The relationships involved include: the solution relationship corresponding to the message type, the solution relationship corresponding to the inclusion condition, and the solution relationship corresponding to the non-inclusion condition. In terms of storage content, the content that can indicate the relationship is set as the key, such as: message type, etc. That is, when grouping, the message type can be used as the key to find different subscription events, and after determining each subscription type and the bit data encoding corresponding to each subscription type, the subscription solution bit data corresponding to each subscription type is cached with the corresponding key.
[0139] Specifically, the step of "caching the subscription plan bit data corresponding to each subscription type for each subscription type and the bit data encoding corresponding to each subscription type" includes:
[0140] d1: For each subscription information of each subscription type, based on the subscription scheme identifier of the subscription information and the preset encoding method parameters, determine the subscription scheme group to which the subscription information belongs and the specific position in the determined subscription scheme group.
[0141] d2: For each subscription plan group, perform an OR operation on the binary codes corresponding to at least one piece of subscription information belonging to the subscription plan group to obtain a binary code result.
[0142] d3: Based on the binary encoding result set corresponding to each subscription plan group, determine the bit data encoding for the subscription type.
[0143] d4: The subscription type is stored in association with the bit data encoding of the subscription type, and the subscription plan bit data corresponding to each subscription type is cached.
[0144] In a possible implementation, similarly, the encoding mode parameter is determined by the encoding mode of the current computer. For example, if the computer currently processing the subscription information is a 64-bit encoding computer, then the current encoding mode parameter is 64.
[0145] In one possible implementation, for the same subscription plan group, the binary codes corresponding to at least one subscription information belonging to the subscription plan group are ORed to obtain a binary coding result, and the determined multiple binary coding result sets are determined to be the bit data coding of the subscription type, and then the subscription type is associated with the bit data coding of the subscription type and stored, and the subscription plan bit data corresponding to each subscription type is cached.
[0146] Here, when the computer performs calculations, calculations and processing are all performed in binary. However, in order to facilitate viewing and reading by users, the binary results can be converted into decimal results for users to view.
[0147] For the above example, for event A, the subscription plan identifiers of the corresponding subscription plans are 1, 5, 13, 25, 44, and 94 respectively; after calculation with the preset encoding method parameters, it is determined that the subscription plans with subscription plan identifiers 1, 5, 13, 25, and 44 are one group, and the subscription plan with subscription plan identifier 94 is another group; the decimal code corresponding to the first subscription plan group is calculated to be 8796109803537; the decimal code corresponding to the second subscription plan group is 536870912, therefore, the cached subscription plan location data is {"Event A":[8796109803537, 536870912]}.
[0148] The encoding calculation method for different subscription plan groups is consistent with the calculation process of the grouping plan bit data, which will not be repeated here.
[0149] Furthermore, after determining at least one subscription scheme identifier, a set of users to be pushed may be determined according to a pre-stored mapping relationship between subscription schemes and users, and the target message may be pushed to each user in the set of users to be pushed.
[0150] S105: Determine a set of users to be pushed based on a pre-stored mapping relationship between subscription plans and users, and push the target message to at least one target user in the set of users to be pushed.
[0151] In one possible implementation, Figure 4 As shown, the subscription plans that match the target message are determined to be subscription plan 1, subscription plan 2, and subscription plan 3 respectively; according to the pre-stored mapping relationship between subscription plans and users, it can be determined that subscription plan 1 corresponds to user 1 and user 4, subscription plan 2 corresponds to user 1, and subscription plan 3 corresponds to user 2. At this time, it is determined that the set of users to be pushed includes user 1, user 2, and user 4. At this time, the target message can be pushed to user 1, user 2, and user 4.
[0152] In one possible implementation, before determining how to push messages, it is necessary to pre-store the mapping relationship between subscription plans and users. When determining the mapping relationship between subscription plans and users, it can be determined whether the user selects an existing subscription plan, and the method for determining subsequent mapping relationships can be determined based on the user's different selections.
[0153] Specifically, the message routing matching method further includes:
[0154] e1: In response to a user executing a plan subscription operation, determining a subscription requirement parameter of the user subscription operation.
[0155] e2: According to the subscription requirement parameters of the user subscription operation, it is detected whether there is at least one subscription plan that meets the user subscription requirement in the currently stored subscription plans.
[0156] e3: If there is at least one subscription plan that meets the user's subscription requirements among the currently stored subscription plans, a mapping relationship between the at least one subscription plan that meets the user's subscription requirements and the user is established.
[0157] In one possible implementation, the user's subscription requirements may include information such as message type and message condition value. If it is determined that a subscription plan that meets the user's requirements already exists, that is, there is a subscription plan in the current subscription plan whose message type and message conditions are consistent with the user's requirements, then the user identifier can be directly associated with the subscription plan identifier.
[0158] In another possible implementation, if there is no subscription plan that meets the user's needs, it is necessary to construct a new subscription plan identifier and associate it with the user identifier to obtain a mapping relationship between the subscription plan and the user.
[0159] Specifically, after the step of “detecting, based on the subscription requirement parameters of the user subscription operation, whether there is at least one subscription plan that meets the user subscription requirement in the currently stored subscription plans”, the message routing matching method further includes:
[0160] f1: If there is no subscription plan that meets the user's subscription requirements among the currently stored subscription plans, determine the subscription plan type in the user's subscription requirement parameters and at least one specified condition value.
[0161] f2: Based on the subscription plan type in the user subscription requirement parameter and at least one specified condition value, a new subscription plan is constructed, and the currently cached subscription plan bit data is adjusted.
[0162] f3: Build a mapping relationship between new subscription plans and users.
[0163] In one possible implementation, if it is determined that there is no subscription plan that meets the user's subscription requirements in the currently stored subscription plans, it is necessary to add a new subscription plan based on the subscription plan type in the user's subscription parameter requirements and at least one specified condition value, and update the currently cached subscription plan bit data based on the currently added subscription plan identifier. Finally, the user identifier is associated with the newly added subscription plan identifier to determine the mapping relationship between the pre-stored subscription plan and the user.
[0164] Here, the adjustment of the bit data may be performed on the bit data at a certain position in a certain group, or may be performed by adding another subscription plan group.
[0165] For the above example, the bit data of the fifth bit of the first group, the thirteenth bit of the first group, and the thirtieth bit of the second group are 1, and the bit data of the remaining positions are 0. If the newly added subscription plan identifier is 60, the subscription plan identifier 60 is divided by 64, the quotient is 0, and the remainder is 60, then the subscription plan identifier 60 is located at the sixtieth bit of the first group. At this time, the bit data of the sixtieth bit of the first group needs to be adjusted to 1; if the newly added subscription plan identifier is 129, the subscription plan identifier 129 is divided by 64, the quotient is 2, and the remainder is 1. At this time, a third group needs to be added, and the subscription plan identifier 129 is located at the first bit of the third group. At this time, the bit data of the first bit of the third group needs to be set to 1, and the bit data of the remaining positions are 0.
[0166] The following is an example to illustrate the message routing matching process in the embodiment of the present application:
[0167] Specifically, take the subscription message in the field of airport flights as an example: a new flight event is triggered, and a flight is added at terminal T1 and stand 02. This will trigger a message of the message type "flight not added" and the message attributes "terminal: T1, stand: 02".
[0168] Further, please refer to Table 1, which is a table of current subscription plans.
[0169] Table 1 Current subscription plan table
[0170]
[0171] According to the subscription scheme disclosed in Table 1, in the first step, the subscription scheme identifiers Id of the flight new message type are: (1, 5, 13, 25, 44, 94). Based on the result of divisibility by 64, the scheme ID can be divided into two groups (1, 5, 13, 25, 44), (94). Each group of data is generated through bitwise OR operation to generate a new data: The first group: 1<<(1-1)∨1<<(5-1)∨1<<(13-1)∨1<<(25-1)∨1<<(44-1)=8796109803537 d ; Second group: 1<<(94mod 64-1)=536870912 d ; Then the data F of all subscription plans that meet the message type is: F = [8796109803537,536870912,...].
[0172] In the second step, the subscription plan identifiers excluding seat 01 are: (1, 2, 6, 54). The first group: 1<<(1-1)∨1<<(2-1)∨1<<(6-1)∨1<<(54-1)=9007199254741027 d ;
[0173] The second group: If there is no corresponding subscription plan ID, the value is 0 d ; then the position data P(camera position,01) excluding camera position 01 is: P(camera position,01)=[9007199254741027,0,...].
[0174] Step 3: Reserve the subscription plan identifiers for slot 01: (34, 76), first group: 1<<(34-1)=8589934592 d ; Second group: 1<<(76mod 64-1)=2048 d ; Then the retained position data Q(camera position,01) of camera position 01 is: Q(camera position,01)=[8589934592,2048,...].
[0175] Step 4: Excluding the subscription plan identifiers for seat 02: (5, 23, 65), the first group: 1<<(5-1)∨1<<(23-1)=4194320 d ; Second group: 1<<(65mod 64-1)=1 d ; Then the position data P(camera position,02) excluding camera position 01 is: P(camera position,02)=[4194320,1,...].
[0176] Step 5: Reserve the subscription plan identifiers for slot 02: (69, 98). The first group: If there is no corresponding subscription plan identifier, the value is 0. d ; Second group: 1<<(69mod 64-1)∨1<<(98mod 64-1)=8589934608 d ; Then the retained position data Q(camera position, 01) of camera position 01 is: Q(camera position, 02) = [0, 8589934608, ...].
[0177] Step 6: Exclude the subscription plan identifiers of Terminal T1: (2, 5, 46). The first group: 1<<(2-1)∨1<<(5-1)∨1<<(46-1)=35184372088850 d ; The second group: if there is no corresponding subscription plan identifier, the value is 0 d ; then the bit data P(terminal, T1) excluding terminal T1 is: P(terminal, T1) = [35184372088850, 0, ...].
[0178] Step 7: Reserve the subscription plan identifiers for Terminal T2: (144, 154). The first group: If there is no corresponding subscription plan identifier, the value is 0. d ; The second group: if there is no corresponding subscription plan identifier, the value is 0 d; The third group: 1<<(144mod 64-1)∨1<<(154mod 64-1)=33587200 d ; Then the bit data Q(terminal,T2) of terminal T1 is: Q(terminal,T2)=[0,0,33587200,...].
[0179] In the eighth step, the position data of the subscription plan that is explicitly excluded is P = P(airport position, 02) ∨ P(terminal, T1), = [4194320, 1, 0...] ∨ [35184372088850, 0, 0...] = [4194320 ∨ 35184372088850, 1 ∨ 0, 0 ∨ 0, ...] = [35184376283154, 1, 0...].
[0180] Step 9: All subscription plan data with only one of the conditions selected: Seat: 02 and Terminal: T1
[0181] Among them, R(aircraft position) = Q(aircraft position, 01) ∨ Q(aircraft position, 02) ∨ ... = [8589934592 ∨ 0, 2048 ∨ 8589934608, 0 ∨ 0...] = [8589934592, 8589936656, 0...]; R(terminal) = Q(terminal, T1) ∨ Q(terminal, T2) ∨ ... = [0 ∨ 0, 0 ∨ 0, 33587200 ∨ 0] = [0, 0, 33587200].
[0182] Step 10: All subscription plans that do not meet the message conditions have data M=P∨K=[35184376283154,1,0]∨[8589934592,2048,33587200]=[35184376283154∨8589934592,2048∨1,33587200∨0]=[35192966217746,2049,33587200].
[0183] Step 11: All subscription plans that meet the message conditions are bit data
[0184] In the twelfth step, all subscription plan bit data S that meet the message conditions are converted into corresponding subscription plan identifiers, that is, [8796109803521,536870912,0] is converted into binary:
[0185] The first group is: 000000000000000000001000000000000000000010000000000001000000000001;
[0187] The second group is:
[0188] 000000000000000000000000000000000010000000000000000000000000000000.
[0189] According to the data value at each data position in the binary data, the eligible subscription plan identifiers are determined to be 1, 13, 25, 44, and 94, and then the set of users to be pushed corresponding to the subscription plan identifiers 1, 13, 25, 44, and 94 can be determined, and the new flight event can be pushed to at least one target user in the set of users to be pushed.
[0190] The message routing matching method provided by the embodiment of the present application determines the message type, message content, and at least one specified condition value of the generated target message; based on the message type, message content, and at least one specified condition value of the target message, determines a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding at least one specified condition value, and a third scheme bit data set retaining at least one specified condition value; based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set, determines a subscription scheme bit data set that meets the message condition of the target message; converts at least one subscription scheme bit data contained in the subscription scheme bit data set into at least one corresponding subscription scheme identifier; based on a pre-stored mapping relationship between subscription schemes and users, determines a set of users to be pushed, and pushes the target message to at least one target user in the set of users to be pushed. In this way, by calculating the bit data for the target message and the subscription scheme, the computational level in the message routing matching process can be reduced, and the corresponding subscription scheme can be quickly determined; at the same time, based on the mapping relationship between subscription schemes and users, users with the same message requirements are matched to the same subscription scheme, and the matching between different subscription schemes and users is directly calculated, further reducing repeated routing matching calculation processes and improving the efficiency of message routing matching.
[0191] Based on the same inventive concept, the embodiment of the present application also provides a message routing matching device corresponding to the message routing matching method. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned message routing matching method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0192] See also Figure 5 、 Figure 6 , Figure 5 This is one of the structural diagrams of a message routing matching device provided in an embodiment of the present application. Figure 6 This is a second structural diagram of a message routing matching device provided in an embodiment of the present application. Figure 5 As shown in , the message route matching device 500 includes:
[0193] A target message determination module 510 is configured to determine a message type and message content of a generated target message, and at least one specified condition value of the target message;
[0194] a scheme bit data set determining module 520 for determining, based on the message type, the message content, and at least one specified condition value of the target message, a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding the at least one specified condition value, and a third scheme bit data set retaining the at least one specified condition value;
[0195] A subscription scheme bit data determination module 530 is configured to determine a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set;
[0196] A subscription scheme identifier conversion module 540 is configured to convert at least one subscription scheme bit data included in the subscription scheme bit data set into at least one corresponding subscription scheme identifier;
[0197] The message push module 550 is configured to determine a set of users to be pushed based on a pre-stored mapping relationship between subscription plans and users, and push the target message to at least one target user in the set of users to be pushed.
[0198] In a possible implementation, the scheme bit data set determining module 520 is configured to determine the first scheme bit data set by:
[0199] Based on a plurality of pre-stored subscription schemes, determining at least one target subscription scheme consistent with the message type among the plurality of subscription schemes and a subscription scheme identifier of each target subscription scheme;
[0200] Based on preset encoding mode parameters, determining a subscription scheme group for each target subscription scheme obtained by calculating the subscription scheme identifier and the encoding mode parameters;
[0201] For each determined subscription plan group, determine the group plan bit data corresponding to the subscription plan group by bit operation;
[0202] Based on the respective grouping scheme bit data, the first scheme bit data set is determined.
[0203] In a possible implementation, when the subscription scheme bit data determination module 530 is used to determine the subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set, the subscription scheme bit data determination module 530 is used to:
[0204] Determining a second sub-scheme bit data set excluding all specified condition values based on the second scheme bit data set;
[0205] Based on the third scheme bit data set, determining a third sub-scheme bit data set for retaining only one specified condition value;
[0206] Determining a target scheme bit data set that does not meet the message condition of the target message based on the second sub-scheme bit data set and the third sub-scheme bit data set;
[0207] Based on the first scheme bit data set and the inverted target scheme bit data set, a subscription scheme bit data set that meets the message condition of the target message is determined.
[0208] In one possible implementation, Figure 6 As shown, the message route matching device 500 further includes a subscription scheme bit data cache module 560, and the subscription scheme bit data cache module 560 is used to:
[0209] A subscription scheme identifier and subscription scheme information based on each received subscription information; wherein the subscription scheme information includes a subscription type of the subscription information and at least one specified condition value of the subscription information;
[0210] Based on each piece of subscription information, each piece of subscription information is grouped according to the corresponding subscription type, and for each subscription type and the bit data encoding corresponding to each subscription type, the subscription plan bit data corresponding to each subscription type is cached.
[0211] In a possible implementation, when the subscription scheme bit data caching module 560 is used to cache the subscription scheme bit data corresponding to each subscription type and the bit data encoding corresponding to each subscription type, the subscription scheme bit data caching module 560 is used to:
[0212] For each subscription information of each subscription type, based on the subscription scheme identifier of the subscription information and the preset encoding method parameters, determine the subscription scheme group to which the subscription information belongs and the specific position in the determined subscription scheme group;
[0213] For each subscription scheme grouping, the binary encodings corresponding to at least one piece of subscription information belonging to the subscription scheme grouping are ORed to obtain a binary encoding result;
[0214] Based on the binary encoding result set corresponding to each subscription scheme grouping, bit data encoding for the subscription type is determined.
[0215] The subscription type and the bit data encoding of the subscription type are associatedly stored, and the subscription scheme bit data corresponding to each subscription type is cached.
[0216] In a possible implementation, as shown in FIG. 5, the message routing matching apparatus 500 further includes a user mapping relationship determining module 570, which is configured to: Figure 6
[0217] In response to a user performing a scheme subscription operation, determining a subscription demand parameter of the user subscription operation;
[0218] According to the subscription demand parameter of the user subscription operation, detecting whether there is at least one piece of subscription scheme satisfying the user subscription demand in the currently stored subscription scheme;
[0219] If there is at least one piece of subscription scheme satisfying the user subscription demand in the currently stored subscription scheme, constructing a mapping relationship between the at least one piece of subscription scheme satisfying the user subscription demand and the user.
[0220] In a possible implementation, the user mapping relationship determining module 570 is further configured to:
[0221] If there is no subscription scheme satisfying the user subscription demand in the currently stored subscription scheme, determining a subscription scheme type and at least one specified condition value in the user subscription demand parameter;
[0222] Based on the subscription scheme type and the at least one specified condition value in the user subscription demand parameter, constructing a new subscription scheme, and adjusting the currently cached subscription scheme bit data;
[0223] Constructing a mapping relationship between the new subscription scheme and the user.
[0224] The message routing matching device provided by the embodiment of the present application determines the message type, message content, and at least one specified condition value of the generated target message; based on the message type, message content, and at least one specified condition value of the target message, determines a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding at least one specified condition value, and a third scheme bit data set retaining at least one specified condition value; based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set, determines a subscription scheme bit data set that meets the message condition of the target message; converts at least one subscription scheme bit data contained in the subscription scheme bit data set into at least one corresponding subscription scheme identifier; based on a pre-stored mapping relationship between subscription schemes and users, determines a set of users to be pushed, and pushes the target message to at least one target user in the set of users to be pushed. In this way, by calculating the bit data for the target message and the subscription scheme, the computational level in the message routing matching process can be reduced, and the corresponding subscription scheme can be quickly determined; at the same time, according to the mapping relationship between subscription schemes and users, users with the same message requirements are matched with the same subscription scheme, and the matching between different subscription schemes and users is directly calculated, further reducing the repeated routing matching calculation process and improving the efficiency of message routing matching.
[0225] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown in FIG, the electronic device 700 includes a processor 710 , a memory 720 and a bus 730 .
[0226] The memory 720 stores machine-readable instructions executable by the processor 710. When the electronic device 700 is running, the processor 710 communicates with the memory 720 via the bus 730. When the machine-readable instructions are executed by the processor 710, the above-mentioned Figure 1 The steps of the message routing matching method in the illustrated method embodiment and the specific implementation thereof can be found in the method embodiment, which will not be described in detail here.
[0227] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the message routing matching method in the illustrated method embodiment and the specific implementation thereof can be found in the method embodiment, which will not be described in detail here.
[0228] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0229] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
[0230] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0231] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0232] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0233] Finally, it should be noted that the above-described embodiments are merely specific embodiments of the present application, which are used to illustrate the technical solutions of the present application, but not to limit the same. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that any skilled person in the art can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features, within the technical scope disclosed by the present application. The modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A message routing matching method, characterized in that: The message routing matching method includes: Determining a message type, message content, and at least one specified condition value of a generated target message; Based on the message type, the message content, and at least one specified condition value of the target message, determine a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding the at least one specified condition value, and a third scheme bit data set retaining the at least one specified condition value; Determining a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set; Converting at least one subscription scheme bit data included in the subscription scheme bit data set into at least one corresponding subscription scheme identifier; Based on a pre-stored mapping relationship between subscription plans and users, a set of users to be pushed is determined, and the target message is pushed to at least one target user in the set of users to be pushed.
2. The message routing matching method according to claim 1, characterized in that: The first scheme bit data set is determined by the following steps: Based on a plurality of pre-stored subscription schemes, determining at least one target subscription scheme consistent with the message type among the plurality of subscription schemes and a subscription scheme identifier of each target subscription scheme; Based on preset encoding mode parameters, determining a subscription scheme group for each target subscription scheme obtained by calculating the subscription scheme identifier and the encoding mode parameters; For each determined subscription plan group, determine the group plan bit data corresponding to the subscription plan group by bit operation; Based on the respective grouping scheme bit data, the first scheme bit data set is determined.
3. The message routing matching method according to claim 1, wherein: The determining, based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set, of a subscription scheme bit data set that meets the message condition of the target message includes: Determining a second sub-scheme bit data set excluding all specified condition values based on the second scheme bit data set; Based on the third scheme bit data set, determining a third sub-scheme bit data set for retaining only one specified condition value; Determining a target scheme bit data set that does not meet the message condition of the target message based on the second sub-scheme bit data set and the third sub-scheme bit data set; Based on the first scheme bit data set and the inverted target scheme bit data set, a subscription scheme bit data set that meets the message condition of the target message is determined.
4. The message routing matching method according to claim 1, wherein: The message routing matching method further includes: A subscription scheme identifier and subscription scheme information based on each received subscription information; wherein the subscription scheme information includes a subscription type of the subscription information and at least one specified condition value of the subscription information; Based on each piece of subscription information, each piece of subscription information is grouped according to the corresponding subscription type, and for each subscription type and the bit data encoding corresponding to each subscription type, the subscription plan bit data corresponding to each subscription type is cached.
5. The message routing matching method according to claim 4, characterized in that: The step of encoding the bit data corresponding to each subscription type and each subscription type and caching the subscription plan bit data corresponding to each subscription type includes: For each subscription information of each subscription type, based on the subscription scheme identifier of the subscription information and the preset encoding method parameters, determine the subscription scheme group to which the subscription information belongs and the specific position in the determined subscription scheme group; For each subscription plan group, perform an OR operation on the binary codes corresponding to at least one subscription information belonging to the subscription plan group to obtain a binary code result; Determine the bit data encoding for the subscription type based on the binary encoding result set corresponding to each subscription plan group; The subscription type is stored in association with the bit data encoding of the subscription type, and the subscription scheme bit data corresponding to each subscription type is cached.
6. The message routing matching method according to claim 1, characterized in that: The message routing matching method further includes: In response to a user executing a plan subscription operation, determining a subscription requirement parameter of the user subscription operation; detecting, based on the subscription requirement parameters of the user subscription operation, whether there is at least one subscription plan that meets the user subscription requirement in currently stored subscription plans; If there is at least one subscription plan that meets the user's subscription requirements in the currently stored subscription plans, a mapping relationship between the at least one subscription plan that meets the user's subscription requirements and the user is established.
7. The message routing matching method according to claim 1, characterized in that: After detecting, based on the subscription requirement parameters of the user subscription operation, whether there is at least one subscription plan that meets the user subscription requirement in the currently stored subscription plans, the message routing matching method further includes: If there is no subscription plan that meets the user's subscription requirements among the currently stored subscription plans, determine the subscription plan type and at least one specified condition value in the user's subscription requirement parameters; Based on the subscription plan type in the user subscription requirement parameter and at least one specified condition value, construct a new subscription plan and adjust the currently cached subscription plan bit data; Build a new mapping relationship between subscription plans and users.
8. A message routing matching device, characterized in that: The message routing matching device includes: a target message determination module, configured to determine a message type and message content of a generated target message, and at least one specified condition value of the target message; a scheme bit data set determining module, configured to determine, based on the message type, the message content, and at least one specified condition value of the target message, a first scheme bit data set corresponding to the message type, a second scheme bit data set excluding the at least one specified condition value, and a third scheme bit data set retaining the at least one specified condition value; a subscription scheme bit data determination module, configured to determine a subscription scheme bit data set that meets the message condition of the target message based on the first scheme bit data set, the second scheme bit data set, and the third scheme bit data set; a subscription scheme identifier conversion module, configured to convert at least one subscription scheme bit data included in the subscription scheme bit data set into at least one corresponding subscription scheme identifier; The message push module is used to determine a set of users to be pushed based on a pre-stored mapping relationship between subscription plans and users, and push the target message to at least one target user in the set of users to be pushed.
9. An electronic device, characterized in that: include: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the message routing matching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the message routing matching method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Kafka-based method for designing content publishing and subscribing communication mode
CN110263282A
Data query method and device, equipment and storage medium
CN114490656A
Method of Managing Database for Multi-conditionalTarget Advertisement
KR1020010068718A
Method of processing queries in a database system, and database system and software product for implementing such method
US20020095397A1
Techniques for executing join operations using bitmap indices
US20210240708A1