CN117194080A - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN117194080A
CN117194080A CN202311481100.6A CN202311481100A CN117194080A CN 117194080 A CN117194080 A CN 117194080A CN 202311481100 A CN202311481100 A CN 202311481100A CN 117194080 A CN117194080 A CN 117194080A
Authority
CN
China
Prior art keywords
message
subscription
jump table
filtering condition
topic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311481100.6A
Other languages
Chinese (zh)
Other versions
CN117194080B (en
Inventor
马进朝
柳正龙
董攀峰
宋平平
王强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hundsun Technologies Inc
Original Assignee
Hundsun Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hundsun Technologies Inc filed Critical Hundsun Technologies Inc
Priority to CN202311481100.6A priority Critical patent/CN117194080B/en
Publication of CN117194080A publication Critical patent/CN117194080A/en
Application granted granted Critical
Publication of CN117194080B publication Critical patent/CN117194080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a message processing method and a device, wherein the message processing method comprises the following steps: acquiring a subscription item submitted by a subscriber, and extracting a subscription theme and a message filtering condition from the subscription item; distributing the filtering condition value corresponding to the message filtering condition to the subscription theme, and determining a subscription array corresponding to the subscription theme according to the distribution result; constructing a message linked list according to the subscription array, and loading a jump table structure associated with the subscription item; and updating the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.

Description

Message processing method and device
Technical Field
The present application relates to the field of message subscription technologies, and in particular, to a message processing method and device.
Background
With the development of computer technology, distributed system designs are becoming more and more complex and diverse, and systems supporting subscription publishing or production consumption are rapidly developing. Such as RabbitMQ, kafka, rocketMQ, etc., all support cross-process, asynchronous communication mechanisms for passing messages upstream and downstream; reliable delivery of messages is ensured by the messaging system. However, there are limitations to the application of either Kafka or rubbi mq, or RocketMQ, which primarily performs message classification processing by subject and partition, or by switch and subject mode, when distinguishing messages. And the classification processing of the messages is finished only according to the topics and the partitions, so that the granularity is larger, and the subscription processing is more complex in a message subscription scene. The efficiency and performance of the classification processing of the messages according to the switch and the topic model are very low, and the real-time performance of the message subscription is seriously affected, so that an effective scheme is needed to solve the above problems.
Disclosure of Invention
In view of this, the embodiments of the present application provide a message processing method to solve the technical defects existing in the prior art. The embodiment of the application also provides a message processing device, a computing device and a computer readable storage medium.
According to a first aspect of an embodiment of the present application, there is provided a message processing method, including:
acquiring a subscription item submitted by a subscriber, and extracting a subscription theme and a message filtering condition from the subscription item;
distributing the filtering condition value corresponding to the message filtering condition to the subscription theme, and determining a subscription array corresponding to the subscription theme according to the distribution result;
constructing a message linked list according to the subscription array, and loading a jump table structure associated with the subscription item;
and updating the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
According to a second aspect of an embodiment of the present application, there is provided another message processing method, including:
acquiring a subscription item submitted by a subscriber, and extracting a subscription theme and a message filtering condition from the subscription item;
Determining a parent topic and a child topic according to the subscription topic, and respectively distributing filtering condition values corresponding to the message filtering conditions to the parent topic and the child topic;
determining subscription arrays respectively corresponding to the father theme and the subtopic according to the distribution result, and constructing a message linked list according to the subscription arrays respectively corresponding to the father theme and the subtopic;
and loading the jump table structure associated with the subscription item, and updating the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
According to a third aspect of an embodiment of the present application, there is provided a message processing apparatus including:
the acquisition module is configured to acquire subscription items submitted by subscribers and extract subscription topics and message filtering conditions from the subscription items;
the determining module is configured to distribute the filtering condition value corresponding to the message filtering condition to the subscription theme and determine a subscription array corresponding to the subscription theme according to the distribution result;
the construction module is configured to construct a message linked list according to the subscription array and load a jump table structure associated with the subscription item;
And the updating module is configured to update the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
According to a fourth aspect of an embodiment of the present application, there is provided another message processing apparatus, including:
acquiring a subscription item template, wherein the subscription item template is configured to acquire subscription items submitted by subscribers, and extracting subscription topics and message filtering conditions from the subscription items;
the distribution condition value module is configured to determine a father topic and a child topic according to the subscription topic, and distribute the filtering condition values corresponding to the message filtering conditions to the father topic and the child topic respectively;
the construction linked list module is configured to determine subscription arrays respectively corresponding to the father topic and the child topic according to the distribution result, and construct a message linked list according to the subscription arrays respectively corresponding to the father topic and the child topic;
and the skip list updating module is configured to load the skip list structure associated with the subscription item, and update the skip list structure into a target skip list structure according to the message linked list, the filtering condition value and the skip list node link relation corresponding to the message filtering condition.
According to a fifth aspect of embodiments of the present application, there is provided a computing device comprising:
a memory and a processor;
the memory is used for storing computer executable instructions, and the processor implements the steps of the message processing method when executing the computer executable instructions.
According to a sixth aspect of embodiments of the present application, there is provided a computer readable storage medium storing computer executable instructions which, when executed by a processor, implement the steps of the message processing method.
In order to improve the message processing efficiency and performance and at the same time, the message processing method provided by the embodiment has finer granularity of message distinguishing processing, under the condition that the subscription item submitted by the subscriber is obtained, the subscription subject and the message filtering condition can be extracted from the subscription item, the filtering condition value corresponding to the message filtering condition is distributed to the subscription subject on the basis of the subscription subject, so that the subscription array corresponding to the subscription subject is determined according to the distribution result, and then a message linked list is constructed on the basis of the subscription array, so that the message linked list is constructed according to the subscription item, and the message can be ensured to be more in accordance with the filtering condition of the subscription item. And then loading the jump table structure associated with the subscription item, and updating the jump table structure by combining the obtained message linked list, the filter condition value and the jump table node link relation corresponding to the filter condition, thereby obtaining the target jump table structure associated with the subscription item. In the subscription stage, the target jump table structure can be accurately hit by combining the subscription request of the publisher so as to complete the subscription of the message, so that the subscription of the message is more detailed and efficient, and the real-time performance of the subscription of the message is improved.
Drawings
FIG. 1 is a schematic diagram of a message processing method according to an embodiment of the present application;
FIG. 2 is a flow chart of a message processing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a skip list structure in a message processing method according to an embodiment of the present application;
FIG. 4 is a process flow diagram of a message processing method according to an embodiment of the present application;
FIG. 5 is a flow chart of another message processing method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a message processing apparatus according to an embodiment of the present application;
FIG. 7 is a schematic diagram of another message processing apparatus according to an embodiment of the present application;
FIG. 8 is a block diagram of a computing device according to one embodiment of the application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
The terminology used in the one or more embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the application. As used in one or more embodiments of the application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of the application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the application.
First, terms related to one or more embodiments of the present application will be explained.
Kafka: is a high throughput distributed publish-subscribe messaging system that can handle all action flow data for consumers in a web site. Such actions (web browsing, searching and other user actions) are a key factor in many social functions on modern networks. These data are typically addressed by processing logs and log aggregations due to throughput requirements.
RabbitMQ: is an open source message broker and queue server that is used to share data between different applications via common protocols (cross-platform cross-language). RabbitMQ is written using the Erlang language and is implemented based on the AMQP (Advanced Message Queuing Protocol ) protocol.
RocketMQ: is a low-delay, high-concurrency, high-availability, high-reliability distributed message middleware.
In the present application, a message processing method is provided. The present application relates to a message processing apparatus, a computing device, and a computer-readable storage medium, one by one, as described in detail in the following embodiments.
Referring to the schematic diagram shown in fig. 1, in order to improve the message processing efficiency and performance and meanwhile have finer granularity of message distinguishing processing, the message processing method provided by the embodiment can extract the subscription topic and the message filtering condition from the subscription item under the condition of acquiring the subscription item submitted by the subscriber, and allocate the filtering condition value corresponding to the message filtering condition to the subscription topic based on the subscription topic, thereby realizing that the subscription array corresponding to the subscription topic is determined according to the allocation result, and then construct a message linked list based on the subscription array, so as to construct the message associated with the topic in the form of the linked list according to the subscription item, thereby ensuring that the message can more accord with the filtering condition of the subscription item. And then loading the jump table structure associated with the subscription item, and updating the jump table structure by combining the obtained message linked list, the filter condition value and the jump table node link relation corresponding to the filter condition, thereby obtaining the target jump table structure associated with the subscription item. In the subscription stage, the target jump table structure can be accurately hit by combining the subscription request of the publisher so as to complete the subscription of the message, so that the subscription of the message is more detailed and efficient, and the real-time performance of the subscription of the message is improved.
Referring to fig. 2, fig. 2 shows a flowchart of a message processing method according to an embodiment of the present application, which specifically includes the following steps:
step S202, obtaining the subscription items submitted by the subscribers, and extracting subscription subjects and message filtering conditions from the subscription items.
The message processing method provided by the embodiment can be applied to any message subscription scene, such as subscription processing of stock market information and stock order transaction information in a stock scene; or subscription processing of bill sales information and bill residual information in the bill purchasing scene; and then, or subscribing the commodity sales information and the commodity purchasing information in the shopping scene. In this embodiment, an application of the message processing method in a security scene is taken as an example for illustration, and descriptions of other scenes can be referred to the same or corresponding descriptions in this embodiment, which are not repeated here.
Specifically, the subscriber specifically refers to an object that submits a subscription item and can perform multiple subscription actions, and is used for creating subscription items with different requirements according to actual requirements, so as to realize coverage of all message subscription scenes, and meet the message subscription requirements of any publisher. Correspondingly, the subscription item specifically refers to an information set composed of subscription subjects and message filtering conditions, and the information set is used for generating a jump table structure of the corresponding subscription item subsequently, so that the use of a message subscription stage is supported. Correspondingly, the subscription theme specifically refers to a generic name of a type of message, for example, under a securities scene, securities market and securities order exchanges belong to two different themes, and the subscription theme is used for dividing the message according to different themes, so that the message to be subscribed can be accurately positioned in the subscription stage. Correspondingly, the message filtering condition specifically refers to a condition that the message filtering is performed by supplementing the subscription subject, namely, after the subscription subject hits a type of message, the message to be subscribed can be filtered out from the type of message through the message filtering condition, so that the finally obtained message meets the subscription requirement. For example, in a stock market, if only the stock is concerned, the code of the stock can be used as a message filtering condition, so that the message corresponding to the stock code is filtered out from all the messages corresponding to the stock market, and is subscribed and pushed.
Based on the above, in order to improve the efficiency and performance of message processing, the subscription item can be submitted by the subscriber in a self-defined manner, and in order to meet the requirement of the subscriber for subscribing the message with finer granularity, the subscriber can be supported to submit the subscription item containing the subscription subject and the message filtering condition, and then the subscription subject and the message filtering condition are extracted from the subscription item, so that the determination of the skip list structure can be conveniently carried out in combination with the subscription subject and the message filtering condition, and when the subscription requirement of the corresponding subscription item is submitted under any scene, the determination and pushing of the message can be supported according to the determined skip list structure, thereby improving the message subscription efficiency and supporting the message subscription processing with finer granularity.
Step S204, the filtering condition value corresponding to the message filtering condition is distributed to the subscription theme, and a subscription array corresponding to the subscription theme is determined according to the distribution result.
Specifically, on the basis of the above conditions of extracting the subscription subject and filtering the message from the subscription item, further, considering that the filtering condition of the message is a fine-grained condition of filtering the message on the basis of the subscription subject, and the filtered message is influenced by the value of the filtering condition, the filtering condition value corresponding to the filtering condition of the message can be determined first and distributed to the subscription subject, so that the message type required to be subscribed and the more detailed message distinguishing condition are bound together, the subscription array corresponding to the subscription subject can be determined according to the distribution result, the subsequent use of the subscription array to construct a message linked list corresponding to the subscription item is facilitated, namely the subscription message screening strategy associated with the subscription item is determined, and the message can be distinguished and subscribed conveniently by querying the message linked list in the message subscription stage.
The filtering condition value specifically refers to a value corresponding to the message filtering condition, and the value is used for locating the most detailed message distinguishing processing condition, that is, the filtering condition value is the most detailed distinguishing value of the message to which the subscription item needs to be subscribed. Correspondingly, the subscription array specifically refers to a message structure formed by connecting message items related to subscription subjects, and is used for connecting all message items corresponding to the subscription items, so that a message linked list can be conveniently constructed subsequently, and the message to be subscribed can be positioned quickly and accurately in a message subscription stage.
Further, when the value allocation of the filtering condition and the determination of the subscription array are performed, considering that the class of messages corresponding to the subscription topics may have finer granularity, if the message filtering is performed only through one level of topics and the message filtering condition, the efficiency and the performance are lower; therefore, a mechanism of a parent-child theme can be adopted for independent division, and then the parent-child theme is processed respectively, so that the concurrency capacity is improved, and the processing efficiency is improved. In this embodiment, the specific implementation manner is as follows:
under the condition that the sub-topics exist in the subscription topics, taking the subscription topics as parent topics; determining a filtering condition value corresponding to the message filtering condition, and respectively distributing the filtering condition value to the parent theme and the child theme; determining a parent subscription array corresponding to the parent topic and a child subscription array corresponding to the child topic according to the distribution result;
Specifically, the parent-child topics specifically refer to topics having a hierarchical relationship, and the hierarchy is an inclusion relationship between two topics, i.e., the parent topic includes the child topics. For example, a theme market, a sh market, is a parent theme, and a sh market is a child theme. And because the parent theme comprises the sub-theme, the corresponding sub-theme subscribed to the parent theme is automatically subscribed, otherwise, the sub-theme is not automatically subscribed to the parent theme to which the sub-theme belongs.
Based on the above, in order to ensure that the message subscription requirement with finer granularity can be met in the message subscription stage when the subscription topic exists, the subscription topic can be used as a father topic, the topic contained in the subscription topic is used as a child topic, then, the filtering condition value corresponding to the message filtering condition is determined, the filtering condition value is respectively distributed to the father topic and the child topic, and after the distribution is completed, the father subscription array corresponding to the father topic and the child subscription array corresponding to the child topic can be respectively determined; and the message linked list corresponding to the subscription items is conveniently built and used by combining the subscription arrays respectively corresponding to the father and son topics.
In practical application, in order to avoid losing the information of the parent-child topics and facilitate maintenance of the topic information when determining that the subscription topic corresponds to the parent-child topic, names of the topics and corresponding filtering conditions of the topics are recorded in a table through a separate topic maintenance table, so that subsequent use is facilitated. In addition, for convenience of distinction, topic numbers respectively corresponding to the parent and child topics can be respectively recorded, and the topic numbers and the topics have unique corresponding relations so as to be convenient to use when the parent and child topics are used for subscribing the messages.
For example, receiving a subscription item submitted by a subscriber, determining that a subscription topic in the subscription item is quotation (hq), and that the filtering condition is type A stock, and stock_code (000000); and then determining that the theme quotation (hq) exists as a sub-theme through detection, wherein the sub-theme contained in the theme quotation (hq.sh) is a sh quotation, so that the quotation (hq) can be used as a father theme, the sh quotation (hq.sh) is used as a sub-theme, then, the filtering condition values corresponding to the filtering conditions can be determined and respectively distributed to father and son themes, and thus, subscription arrays respectively corresponding to the father and son themes are obtained and can be used for the subsequent generation of a doubly linked list.
In summary, through the processing of the subscription item in a mode of combining the father and son topics, the message distinction supporting finer granularity can be realized, so that the subscription of any message in any scene is satisfied, and the required subscription message can be pushed to the publisher.
Further, when the filtering condition values are allocated, considering that the message filtering conditions in the subscription item can be customized according to the requirement, the customized message filtering conditions may have multi-level conditions, at this time, a plurality of filtering condition values will exist, and when the parent-child topics are allocated to the plurality of filtering condition values, each filtering condition value needs to be allocated to each topic in turn. In this embodiment, the specific implementation manner is as follows:
Determining a filter condition value set corresponding to at least two sub-message filter conditions under the condition that the message filter conditions comprise the at least two sub-message filter conditions; splitting the filtering condition value set, and respectively distributing the filtering condition values obtained after splitting to the parent theme and the child theme.
Specifically, the sub-message filtering conditions specifically refer to filtering conditions corresponding to different levels included in the message filtering conditions, and are used for carrying out finer-granularity message distinction on the basis of the theme, so as to meet different message subscription scenes; and, the filtering condition of each hierarchy may correspond to at least one level message filtering condition, for example, the filtering condition is a type a stock and the stock_code (000000, 111111), and then the filtering condition includes two sub-message filtering conditions, namely, a type a stock and the stock_code (000000, 111111), and the sub-message filtering condition, namely, the stock_code (000000, 111111), further includes two level message filtering conditions, namely, 000000 and 111111. Under the condition that the message filtering condition comprises at least two sub-message filtering conditions, the corresponding filtering condition values of each sub-message filtering condition can form a filtering condition value set.
Based on the above, in order to meet the requirement of the message distinguishing processing of different granularities, the composivity of the filtering conditions in the subscription items submitted by subscribers can be supported, namely, under the condition that the message filtering conditions comprise at least two sub-message filtering conditions, a filtering condition value set consisting of filtering condition values corresponding to the at least two sub-message filtering conditions respectively can be determined at the moment; and then splitting the filtering condition value set to obtain filtering condition values corresponding to each sub-message filtering condition, and respectively distributing the filtering condition values corresponding to each sub-message filtering condition to the father theme and the sub-theme, so that the situation that the father theme and the sub-theme respectively correspond to the same number of filtering condition values can be realized, and when subscription arrays respectively corresponding to the father theme and the sub-theme are determined, the integrity of the coverage range of the subscription array can be ensured so as to support the subscription requirements of different granularities.
In summary, through supporting the filtering condition in the form of aggregation, the subscription requirement can be ensured to cover a scene with finer granularity, so that the generation of the target jump table structure can be performed for the subscription item in any form under any scene, the requirement of any message subscription is met in the message subscription stage, and the accurate message pushing to the publisher is realized.
Furthermore, after the distribution of the filtering condition values is completed, the subscription array is required to be determined independently for the father and son topics, so that the subsequent subscription arrays combined with different topics are convenient, and a message linked list corresponding to the subscription items is constructed; in this embodiment, the specific implementation manner is as follows:
obtaining at least two father subscription items corresponding to the father topic and at least two child subscription items corresponding to the child topic according to the distribution result; connecting the at least two father subscription items to obtain a father subscription array corresponding to the father topic, and connecting the at least two child subscription items to obtain a child subscription array corresponding to the child topic.
Specifically, after the filtering condition values are assigned to the parent topics, the items to which the to-be-subscribed messages belong under the parent topics obtained according to the assignment result, and the message filtering conditions comprise at least two sub-message filtering conditions, so that after the filtering condition values corresponding to each sub-filtering condition are assigned to the parent topics, different parent subscription items are respectively obtained, and the parent subscription arrays corresponding to the parent topics can be obtained by splicing the parent subscription items corresponding to each sub-filtering condition. Similarly, the sub-subscription items associated with the sub-topics are similar to the sub-subscription items, and the description of this embodiment is omitted here.
Because the message filtering condition includes at least two sub-message filtering conditions, when the filtering condition values are respectively allocated to the parent-child topics, the filtering condition value corresponding to each sub-message filtering condition is simultaneously allocated to the parent-child topics, at this time, at least two parent subscription items corresponding to the parent topics and at least two sub-subscription items corresponding to the sub-topics can be obtained according to the allocation result, that is, the filtering condition value corresponding to each sub-message filtering condition corresponds to one subscription item. And then, considering that the subscription of the messages is to subscribe the messages under the requirement, so that at least two father subscription items can be connected to obtain a father subscription array corresponding to the father topic, and similarly, at least two son subscription items are connected to obtain a son subscription array corresponding to the son topic. The subsequent set parent subscription array and the sub subscription array are convenient to construct a message linked list corresponding to the subscription item for use.
In practical application, the filtering condition value is used for filtering the subscription message after subscribing the message to obtain a value meeting the subscription requirement, so that the filtering condition value corresponding to each sub-message filtering condition needs to be respectively distributed to the father and son topics, and the filtering of the message in the messages corresponding to the father topic and the son topic is ensured.
Along the above example, after obtaining the parent theme-quotation (hq), the child theme-sh quotation (hq.sh), and the filtering condition a type stock and the stock_code (000000), determining that the filtering condition includes two sub-message filtering conditions, namely, the sub-message filtering condition 1=a type stock and the sub-message filtering condition 2=stock_code (000000); then the set of filtering condition values corresponding to the filtering condition 1 of the sub-message and the filtering condition 2 of the sub-message may be loaded, and split into the filtering condition value A1 corresponding to the filtering condition 1 of the sub-message and the filtering condition value S2 corresponding to the filtering condition 2 of the sub-message, and may be allocated to the parent-child subject respectively. It is determined from the allocation result that the parent topic-quotation (hq) corresponds to two subscription items (subsribeems), while the child topic-sh quotation (hq. Sh) will also correspond to two subscription items (subsribeems). And then, the two subscription items corresponding to the father theme and the son theme are connected in series, so that a father subscription array corresponding to the father theme-quotation (hq) and a son subscription array corresponding to the son theme-sh quotation (hq.sh) can be obtained, and the subsequent use is convenient.
In sum, after the father-son topics are allocated by combining different sub-message filtering conditions, a plurality of subscription items corresponding to the father-son topics can be obtained, and then the subscription items are spliced into a father-son subscription array, so that the conditions required to be filtered for the subscription items can be covered, and the subscription requirements of publishers with finer granularity can be met under the subscription scene.
Step S206, constructing a message linked list according to the subscription array, and loading the jump list structure associated with the subscription item.
Specifically, after the subscription array associated with the subscription theme is obtained, further, in order to support the message required to be subscribed in the subscription stage, a message linked list corresponding to the subscription item can be built by combining the subscription array, meanwhile, a jump table structure associated with the subscription item is loaded, the jump table structure is conveniently updated by combining multi-dimensional information, multi-dimensional information containing the message linked list is recorded in the updated jump table structure, so that the subscription requirement of any granularity is met, and the push of messages of different granularities for any publisher is supported.
The message linked list specifically refers to a bidirectional list linked list obtained by concatenating subscription arrays corresponding to subscription topics, and is used for associating the subscription arrays filtered by the filtering conditions in the subscription items together, so that required messages can be read according to the message linked list to be pushed in a message subscription stage. Correspondingly, the jump table structure specifically refers to a data structure formed by a plurality of nodes with jump requirements, each node corresponds to a filtering condition of each level, the whole jump table structure corresponds to a subscription item submitted by a subscriber, and by writing multidimensional information corresponding to the subscription item into the jump table structure, the updated jump table structure can be used for quickly and accurately hitting a message to be subscribed in a message subscription stage and pushing the message to a publisher. That is, the skip list structure is a structure configured in accordance with the subscription item when pushing a message.
Further, under the condition that the subscription topics comprise father-son topics, subscription arrays respectively corresponding to the father-son topics are obtained at the moment, and on the basis, the message linked list is constructed by connecting the subscription arrays respectively corresponding to the father-son topics; in this embodiment, the specific implementation manner is as follows: and constructing a message linked list according to the parent subscription array and the child subscription array.
When the method is implemented, after the father subscription array corresponding to the father topic and the child subscription array corresponding to the child topic are obtained, when the father subscription array and the child subscription array are combined to construct a message linked list, the father subscription array and the child subscription array are connected in series to form a memory data structure and are recorded, and the memory data structure is convenient to use when the jump table structure is updated, and the memory data structure and the child subscription array are recorded to nodes in the corresponding jump table structure so as to meet the requirement of use in a message subscription stage, and are loaded to a final message according to the message linked list and pushed to a publisher.
Further, when loading the skip list structure associated with the subscription item, considering that the skip list structure is the basis for supporting message subscription, the structure needs to be matched with the subscription item, so that the loading of the skip list structure can be completed in combination with the number of condition levels. In this embodiment, the specific implementation manner is as follows:
Loading a jump table structure associated with the subscription item according to the number of condition levels of the sub-message filtering conditions contained in the message filtering conditions, wherein the number of jump table nodes contained in the jump table structure is the same as the number of the condition levels;
specifically, the number of condition levels specifically refers to the number of all levels corresponding to the filtering condition of the sub-message, such as filtering condition a type stock, and stock_code (000000, 111111), which corresponds to the number of condition levels of 2. Accordingly, the number of nodes in the skip list refers to the number of nodes contained in the skip list structure, which is the same as the number of condition levels. Because the skip list structure is a structure for subscribing to messages, the filtering process of subscribing to the target message should meet the subscription requirement, i.e. the message filtering condition in the associated subscription item. Therefore, the number of the skip list nodes of the skip list structure is influenced by the number of the conditional hierarchies, so that the skip list structure is ensured to be matched with the subscription items.
Based on the above, when loading the skip list structure, in order to ensure that the skip list structure is matched with the subscription item, the method supports that the message associated with the subscription item can be subscribed in a message subscription stage, the skip list structure associated with the subscription item can be loaded according to the condition level number of the sub-message filtering condition contained in the message filtering condition, and the number of the skip list nodes contained in the skip list structure loaded is the same as the condition level number; so as to be convenient for the subsequent use in the application stage after configuration for the jump table structure.
Along the above example, after obtaining the parent subscription array and the child subscription array corresponding to the parent and child topics respectively, the parent subscription array and the child subscription array can be spliced, so that a bidirectional list linked list of the corresponding subscription item is obtained. And then, determining the number of the filtering conditions associated with the subscription item as 2 levels, so that a jump table structure with 2 jump table nodes can be loaded for use, and the jump table structure is convenient to be configured by combining the information subsequently for a publisher.
In summary, by selecting the jump table structure in combination with the number of condition levels corresponding to the message filtering condition in the subscription item, the relevance between the selected jump table structure and the subscription item can be ensured, and the target jump table structure configured based on the relevance meets the message subscription requirement of the subscription item.
Step S208, updating the jump table structure into a target jump table structure according to the message linked list, the filter condition value and the jump table node link relation corresponding to the message filter condition.
Specifically, after the message linked list and the skip list structure associated with the subscription item are obtained, the skip list structure can be updated according to the message linked list, the filtering condition value and the skip list node link relation corresponding to the message filtering condition, so that the multi-dimensional information of the corresponding subscription item is recorded in the skip list structure, and the target skip list structure associated with the subscription item is obtained. And in the application stage, the target skip list structure can be loaded to complete subscription of the corresponding message, so that the message subscription efficiency and performance are improved.
The jump table node link relation specifically refers to a jump relation between adjacent jump table nodes in the jump table structure, and is used for pointing to the next jump table node associated with the previous jump table node; and in the case that the filtering condition is one, the skip list structure also protects one node, and the skip list node link relation can be an empty set. Correspondingly, the target jump table structure specifically refers to a jump table structure obtained after the message linked list, the filtering condition value and the jump table node link relation are added to the corresponding nodes in the jump table structure, and the jump table structure contains the information, so that the corresponding message can be found by traversing the information contained in each jump table node in the target jump table structure in the application stage, and the message can be pushed to a publisher, thereby completing the pushing of the message.
Further, when the target jump table structure is constructed by combining the multidimensional information, a plurality of nodes exist in consideration of the fact that the target jump table structure is possibly influenced by the number of sub-conditions, so that the jump table node link relationship is determined by combining the conditional connection relationship corresponding to the sub-filtering conditions, and the target jump table structure is constructed. In this embodiment, the specific implementation manner is as follows:
Determining a condition connection relation corresponding to the at least two sub-message filtering conditions, and taking the condition connection relation as a jump table node link relation corresponding to the message filtering conditions; and updating each jump table node in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation, and obtaining a target jump table structure according to an updating result.
Specifically, the conditional join relationship specifically refers to a relationship corresponding to an adjacent word message filtering condition in the sub-message filtering condition, where the relationship affects a skip relationship between adjacent skip list nodes in the skip list structure. Correspondingly, the skip list nodes specifically refer to nodes contained in the skip list structure, and the number of the skip list nodes is the same as the number of the condition levels of the sub-message filtering condition.
Based on the above, when the jump table structure is updated, in order to ensure that the target jump table structure obtained after updating matches the subscription item, the condition connection relation corresponding to at least two sub-message filtering conditions can be determined first, and used as the jump table node link relation corresponding to the message filtering conditions; and updating each jump table node in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation, so that after the content corresponding to each jump table node is configured to the jump table node, the target jump table structure can be obtained according to the updating result. In order to realize that the target skip list structure can be used for searching and pushing the message in the application stage.
In summary, by determining the conditional connection relationship between the sub-message filtering conditions, the jump relationship can be allocated to the jump table nodes in the jump table structure, and the information configuration of the jump table nodes can be performed by combining the message linked list and the filtering condition value based on the jump relationship, so that the target jump table structure associated with the subscription item can be obtained.
Furthermore, in consideration of the filtering condition that each node of the skip list structure corresponds to different levels, the update of the skip list structure can be completed by combining the node configuration information of each level. In this embodiment, the specific implementation manner is as follows:
constructing node configuration information corresponding to each jump table node in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation; and sequentially writing node configuration information corresponding to each jump table node into the jump table nodes in the jump table structure, and obtaining a target jump table structure according to a writing result.
Specifically, the node configuration information specifically refers to configuration information formed by combining a message linked list associated with the skip list node, a filtering condition value and a skip list node link relation, and is used for carrying out configuration processing on the skip list node to which the node belongs. The message linked list associated with the skip list node is formed by splicing subscription arrays associated with sub-message filtering conditions corresponding to the node; correspondingly, the filter condition value associated with the skip list node is the filter condition value associated with the sub-message filter condition corresponding to the node. Correspondingly, the link relation of the skip list nodes associated with the skip list nodes is the link relation of the nodes between the sub-message filtering condition corresponding to the node and the sub-message filtering condition of the next level.
That is, since the message filtering condition in the subscription item includes at least two sub-message filtering conditions, and each sub-message filtering condition corresponds to a different hierarchy, the message link list, the filtering condition value, and the skip list node link relation of the different hierarchy are determined by the sub-message filtering condition corresponding to the hierarchy, when the node configuration information is constructed, the sub-message filtering condition of each hierarchy can be combined to extract the required content from the constructed message link list, filtering condition value, and skip list node link relation to generate.
Based on the above, after obtaining the message linked list, the filtering condition value and the link relation of the skip list nodes corresponding to all the sub-message filtering conditions, the content corresponding to each skip list node can be found from all the contents based on the sub-message filtering conditions, namely, the node configuration information corresponding to each skip list node in the skip list structure is constructed according to the message linked list, the filtering condition value and the link relation of the skip list node; each node configuration relation has a unique corresponding relation with the jump table node, so that the node configuration information corresponding to each jump table node can be sequentially written into the corresponding jump table node in the jump table structure, and the target jump table structure can be obtained according to the writing result.
For example, after obtaining the skip list structure 1 and the filter condition value A1 corresponding to the filter condition type a stock, the bidirectional list linked list corresponding to the filter condition stock_code (000000, 111111) and the filter condition value S1, the skip list structure including 2 nodes may be updated by combining the upper-lower hierarchical relationship between the filter condition type a stock and the filter condition stock_code (000000, 111111), that is, the information of each skip list node in the corresponding skip list structure is configured to the skip list node, and the target skip list structure as shown in fig. 3 may be obtained according to the configuration result. With implementation, since each skip list node needs to configure multidimensional information, each node in the first-stage skip list may be set to be a CF structure (cfilterindex item), where the CF structure is used to record list linked lists, values (filtering condition values) and skip list layer level relationships corresponding to the nodes, where the relationships may be identifiers of next-stage skip list nodes. Thereby supporting use in the application phase.
In summary, by filling node configuration information for the jump table structure by combining the multidimensional information, the updated target jump table structure can be matched with the subscription item, and when the release message of the associated subscription item is received, the target jump table structure can be directly multiplexed, so that the message pushing is completed quickly and efficiently.
In addition, after the construction of the target jump table structure is completed, if the publisher publishes the message, the publisher can traverse the target jump table structure in combination with the published message, so that the target message corresponding to the published message is obtained and pushed, and the message processing efficiency is improved. In this embodiment, the specific implementation manner is as follows:
under the condition that a release message submitted by a publisher is received, loading the target jump table structure according to a release message theme in the release message; reading the filtering condition value in the target jump table structure; traversing the target jump table structure under the condition that the filtering condition value is matched with the release filtering condition in the release message; and determining the message linked list according to the traversing result, loading the target message corresponding to the message linked list, and pushing the target message to the publisher.
Specifically, the publisher specifically refers to an object with a message subscription requirement, and correspondingly, the published information is information submitted by the publisher for the message to be subscribed, and the information records the message to be subscribed, which can be understood to also consist of a subscription topic and a filtering condition, wherein the topic and the condition are topics and conditions for screening out the push message. Accordingly, the topic of the published message is the topic to be subscribed in the published message. Correspondingly, the target message specifically refers to a message read according to a message linked list in the target skip list structure, namely a message to be subscribed by the publisher.
Based on this, in the case of receiving a published message submitted by a publisher, it is explained that the publisher needs each kind of message in the current scenario at this time, and in order to be able to push the message to the publisher quickly and accurately, the target jump table structure may be loaded first according to the topic of the published message in the published message. It should be noted that, the target skip list structure loaded by the published message theme is a skip list structure corresponding to the subscription requirement of the publisher, and this embodiment is described with the obtained target skip list structure for convenience of description, and the message pushing process matched with other types of published messages can be referred to in this embodiment.
Further, at this time, the filtering condition value may be read in the target skip list structure; under the condition that the filtering condition value is matched with the release filtering condition in the release message, the target jump table structure read at the moment is explained to meet the requirement of pushing the message subscribed by the publisher, so that the target jump table structure can be traversed; and determining a message linked list according to the traversing result, loading the target message corresponding to the message linked list, and pushing the target message to the publisher.
In practical application, when traversing the target skip list structure, the filtering condition value set by the publisher is extracted from the published message, and is matched with the filtering condition field in the target skip list structure, the first filtering condition is matched and then the first-level subItemSet is traversed, if the second filtering condition is matched, the second-level subItemSet is traversed, and so on, until all the traversal is completed, the message linked list can be read, and the message corresponding to the message linked list is searched and pushed to the publisher.
In summary, under the condition that the publisher subscribes to the message, the published message of the publisher can be matched to the target jump table structure, so that the target message is found and pushed to the publisher based on the target jump table structure, the message pushing efficiency is improved, and meanwhile, the message subscription requirement of any granularity is ensured.
On the basis, in order to avoid the wrong message from being pushed to the publisher, the accurate screening of the target message can be completed in a layer-by-layer matching condition field mode. In this embodiment, the specific implementation manner is as follows:
analyzing the release message to obtain at least one release condition field; sequentially matching the at least one release condition field with a target condition field contained in the target jump table structure; and in the case that the matching is passed, executing the step of reading the filtering condition value in the target jump table structure.
Specifically, the publishing condition field specifically refers to a field corresponding to a filtering condition set in the publishing message. Based on this, in order to accurately find the target jump table structure of the matching publisher, after obtaining the published message, at least one published condition field is parsed from the published message, and then at least one published condition field is matched with the target condition field contained in each jump table node in the target jump table structure in sequence, and only if all the matches pass, the subsequent processing can be continued.
Along the above example, after receiving the published message submitted by the publisher, analyzing the published message to determine that the topic in the published message is a market (hq), and the filtering condition values are A1 and S1, so that the corresponding target jump table structure is determined by combining the published message, searching can be performed in the first-stage jump table node in the jump table structure shown in fig. 3 according to the filtering condition value A1, searching can be performed in the second-stage jump table node in the jump table structure shown in fig. 3 according to the filtering condition value S1, until the doubly linked list is found, determining the target message (subscore) according to the doubly linked list, and then pushing the target message to the publisher.
In summary, by determining the message to be subscribed by the publisher in the mode of selecting the filtering condition matching, the accuracy of message subscription can be ensured, and the efficiency of message searching can be improved, thereby improving the real-time performance of message subscription.
In practical application, when receiving the subscription cancellation request, in order to avoid pushing the message to the publisher again later, the message linked list can be loaded and deleted by combining the target jump table structure, so as to achieve the purpose of deleting the subscription foundation and avoiding the generation of the message. In this embodiment, the specific implementation manner is as follows:
Receiving a subscription cancel request submitted by the publisher, and loading the target jump table structure according to the subscription cancel request; and acquiring the message linked list based on the target jump table structure, deleting the message linked list, and responding to the subscription cancellation request.
In particular, a subscription cancellation request refers in particular to a request submitted when no subscription is required for a certain type of message. Based on the above, when a publisher aims at a certain type of message or a certain message is not having attention requirements, a subscription cancel request can be submitted, and a target jump table structure can be loaded according to the subscription cancel request; and then acquiring a message linked list based on the target jump list structure, and deleting the message linked list, namely, responding to the subscription cancellation request. That is, when the message subscription is cancelled, the pre-stored message linked list is deleted, so that the message corresponding to the linked list is not found to be pushed in the message pushing stage.
In order to improve the message processing efficiency and performance and at the same time, the message processing method provided by the embodiment has finer granularity of message distinguishing processing, under the condition that the subscription item submitted by the subscriber is obtained, the subscription subject and the message filtering condition can be extracted from the subscription item, the filtering condition value corresponding to the message filtering condition is distributed to the subscription subject on the basis of the subscription subject, so that the subscription array corresponding to the subscription subject is determined according to the distribution result, and then a message linked list is constructed on the basis of the subscription array, so that the message linked list is constructed according to the subscription item, and the message can be ensured to be more in accordance with the filtering condition of the subscription item. And then loading the jump table structure associated with the subscription item, and updating the jump table structure by combining the obtained message linked list, the filter condition value and the jump table node link relation corresponding to the filter condition, thereby obtaining the target jump table structure associated with the subscription item. In the subscription stage, the target jump table structure can be accurately hit by combining the subscription request of the publisher so as to complete the subscription of the message, so that the subscription of the message is more detailed and efficient, and the real-time performance of the subscription of the message is improved.
The following is a description of the message processing method provided by the present application in a security scenario, taking the application of the message processing method in a security scenario as an example with reference to fig. 4. Fig. 4 shows a processing flow chart of a message processing method according to an embodiment of the present application, which specifically includes the following steps:
step S402, obtaining the subscription items submitted by the subscribers, and extracting the subscription subjects and the message filtering conditions from the subscription items.
Step S404, under the condition that the sub-topic exists in the subscription topic, the subscription topic is used as a father topic.
Step S406, in the case that the message filtering condition includes at least two sub-message filtering conditions, a set of filtering condition values corresponding to the at least two sub-message filtering conditions is determined.
Step S408, splitting the filter condition value set, and distributing the filter condition values obtained after splitting to the parent theme and the child theme respectively.
Step S410, at least two parent subscription items corresponding to the parent topic and at least two child subscription items corresponding to the child topic are obtained according to the distribution result.
Step S412, connecting the at least two parent subscription items to obtain a parent subscription array corresponding to the parent topic, and connecting the at least two child subscription items to obtain a child subscription array corresponding to the child topic.
Step S414, a message linked list is constructed according to the parent subscription array and the child subscription array.
Step S416, loading the jump table structure associated with the subscription item according to the condition level number of the sub-message filtering condition contained in the message filtering condition, wherein the jump table structure contains the same jump table nodes as the condition level number.
Step S418, determining the condition connection relation corresponding to at least two sub-message filtering conditions, and using the condition connection relation as the jump table node link relation corresponding to the message filtering conditions.
Step S420, updating each jump table node in the jump table structure according to the message linked list, the filter condition value and the jump table node link relation, and obtaining the target jump table structure according to the updating result.
Step S422, in the case of receiving the published message submitted by the publisher, loading the target skip list structure according to the subject of the published message in the published message, and reading the filtering condition value in the target skip list structure.
Step S424, traversing the target jump table structure if the filtering condition value matches the publishing filtering condition in the publishing message.
Step S426, determining a message linked list according to the traversing result, loading the target message corresponding to the message linked list and pushing the target message to the publisher.
In summary, the jump table structure is updated by combining the message linked list, the filter condition value and the jump table node link relation corresponding to the filter condition, so as to obtain the target jump table structure of the associated subscription item. In the subscription stage, the target jump table structure can be accurately hit by combining the subscription request of the publisher so as to complete the subscription of the message, so that the subscription of the message is more detailed and efficient, and the real-time performance of the subscription of the message is improved.
Corresponding to the above method embodiment, the present application further provides another message processing method embodiment, and fig. 5 shows a flowchart of another message processing method provided by an embodiment of the present application, as shown in fig. 5, where the method includes:
step S502, obtaining a subscription item submitted by a subscriber, and extracting a subscription theme and a message filtering condition from the subscription item;
step S504, determining a parent topic and a child topic according to the subscription topic, and respectively distributing filtering condition values corresponding to the message filtering conditions to the parent topic and the child topic;
step S506, determining subscription arrays corresponding to the father theme and the subtopic respectively according to the distribution result, and constructing a message linked list according to the subscription arrays corresponding to the father theme and the subtopic respectively;
Step S508, loading the jump table structure associated with the subscription item, and updating the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
The other message processing method provided in this embodiment corresponds to the above message processing method, and the same or similar description contents can be referred to the above embodiment, which is not repeated here.
Corresponding to the above method embodiment, the present application further provides an embodiment of a message processing apparatus, and fig. 6 shows a schematic structural diagram of a message processing apparatus according to an embodiment of the present application. As shown in fig. 6, the apparatus includes:
an acquisition module 602 configured to acquire a subscription item submitted by a subscriber, and extract a subscription topic and a message filtering condition from the subscription item;
a determining module 604, configured to allocate a filtering condition value corresponding to the message filtering condition to the subscription topic, and determine a subscription array corresponding to the subscription topic according to the allocation result;
a building module 606 configured to build a message linked list according to the subscription array and load a jump table structure associated with the subscription item;
And an updating module 608, configured to update the jump table structure to a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
In an alternative embodiment, the apparatus further comprises:
the pushing module is configured to load the target jump table structure according to the subject of the release message in the release message under the condition that the release message submitted by the publisher is received; reading the filtering condition value in the target jump table structure; traversing the target jump table structure under the condition that the filtering condition value is matched with the release filtering condition in the release message; and determining the message linked list according to the traversing result, loading the target message corresponding to the message linked list, and pushing the target message to the publisher.
In an alternative embodiment, the determining module 604 is further configured to:
under the condition that the sub-topics exist in the subscription topics, taking the subscription topics as parent topics; determining a filtering condition value corresponding to the message filtering condition, and respectively distributing the filtering condition value to the parent theme and the child theme; determining a parent subscription array corresponding to the parent topic and a child subscription array corresponding to the child topic according to the distribution result;
The build module 606 is further configured to: and constructing a message linked list according to the parent subscription array and the child subscription array.
In an alternative embodiment, the determining module 604 is further configured to:
determining a filter condition value set corresponding to at least two sub-message filter conditions under the condition that the message filter conditions comprise the at least two sub-message filter conditions; splitting the filtering condition value set, and respectively distributing the filtering condition values obtained after splitting to the parent theme and the child theme.
In an alternative embodiment, the determining module 604 is further configured to:
obtaining at least two father subscription items corresponding to the father topic and at least two child subscription items corresponding to the child topic according to the distribution result; connecting the at least two father subscription items to obtain a father subscription array corresponding to the father topic, and connecting the at least two child subscription items to obtain a child subscription array corresponding to the child topic.
In an alternative embodiment, the building module 606 is further configured to:
loading a jump table structure associated with the subscription item according to the number of condition levels of the sub-message filtering conditions contained in the message filtering conditions, wherein the number of jump table nodes contained in the jump table structure is the same as the number of the condition levels;
The update module 608 is further configured to: determining a condition connection relation corresponding to the at least two sub-message filtering conditions, and taking the condition connection relation as a jump table node link relation corresponding to the message filtering conditions;
and updating each jump table node in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation, and obtaining a target jump table structure according to an updating result.
In an alternative embodiment, the update module 608 is further configured to:
constructing node configuration information corresponding to each jump table node in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation; and sequentially writing node configuration information corresponding to each jump table node into the jump table nodes in the jump table structure, and obtaining a target jump table structure according to a writing result.
In an alternative embodiment, the apparatus further comprises:
the analysis module is configured to analyze the release message to obtain at least one release condition field; sequentially matching the at least one release condition field with a target condition field contained in the target jump table structure; and in the case that the matching is passed, executing the step of reading the filtering condition value in the target jump table structure.
In an alternative embodiment, the apparatus further comprises:
the deleting module is configured to receive a subscription cancel request submitted by the publisher and load the target jump table structure according to the subscription cancel request; and acquiring the message linked list based on the target jump table structure, deleting the message linked list, and responding to the subscription cancellation request.
In order to improve the message processing efficiency and performance and at the same time have finer granularity of message distinguishing processing, the message processing device provided by the embodiment can extract the subscription subject and the message filtering condition from the subscription item under the condition of acquiring the subscription item submitted by the subscriber, and distribute the filtering condition value corresponding to the message filtering condition to the subscription subject on the basis of the subscription subject, thereby realizing the determination of the subscription array corresponding to the subscription subject according to the distribution result, and then construct a message linked list on the basis of the subscription array, so as to construct the message associated with the subject in the form of the linked list according to the subscription item, thereby ensuring that the message can more accord with the filtering condition of the subscription item. And then loading the jump table structure associated with the subscription item, and updating the jump table structure by combining the obtained message linked list, the filter condition value and the jump table node link relation corresponding to the filter condition, thereby obtaining the target jump table structure associated with the subscription item. In the subscription stage, the target jump table structure can be accurately hit by combining the subscription request of the publisher so as to complete the subscription of the message, so that the subscription of the message is more detailed and efficient, and the real-time performance of the subscription of the message is improved.
The above is an exemplary scheme of a message processing apparatus of the present embodiment. It should be noted that, the technical solution of the message processing apparatus and the technical solution of the message processing method belong to the same concept, and details of the technical solution of the message processing apparatus, which are not described in detail, can be referred to the description of the technical solution of the message processing method. Furthermore, the components in the apparatus embodiments should be understood as functional blocks that must be established to implement the steps of the program flow or the steps of the method, and the functional blocks are not actually functional partitions or separate limitations. The device claims defined by such a set of functional modules should be understood as a functional module architecture for implementing the solution primarily by means of the computer program described in the specification, and not as a physical device for implementing the solution primarily by means of hardware.
Corresponding to the above method embodiment, the present application further provides another embodiment of the message processing apparatus, and fig. 7 shows a schematic structural diagram of another message processing apparatus according to an embodiment of the present application. As shown in fig. 7, the apparatus includes:
an acquire subscription item template 702 configured to acquire subscription items submitted by subscribers and extract subscription topics and message filtering conditions from the subscription items;
An allocation condition value module 704 configured to determine a parent topic and a child topic according to the subscription topic, and allocate filter condition values corresponding to the message filter conditions to the parent topic and the child topic, respectively;
the link list constructing module 706 is configured to determine subscription arrays corresponding to the parent topic and the child topic respectively according to the allocation result, and construct a message link list according to the subscription arrays corresponding to the parent topic and the child topic respectively;
and an update jump table module 708, configured to load the jump table structure associated with the subscription item, and update the jump table structure to a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
The above is another exemplary embodiment of the message processing apparatus of the present embodiment. It should be noted that, the technical solution of the message processing apparatus and the technical solution of the message processing method belong to the same concept, and details of the technical solution of the message processing apparatus, which are not described in detail, can be referred to the description of the technical solution of the message processing method. Furthermore, the components in the apparatus embodiments should be understood as functional blocks that must be established to implement the steps of the program flow or the steps of the method, and the functional blocks are not actually functional partitions or separate limitations. The device claims defined by such a set of functional modules should be understood as a functional module architecture for implementing the solution primarily by means of the computer program described in the specification, and not as a physical device for implementing the solution primarily by means of hardware.
Fig. 8 illustrates a block diagram of a computing device 800 provided in accordance with an embodiment of the present application. The components of computing device 800 include, but are not limited to, memory 810 and processor 820. Processor 820 is coupled to memory 810 through bus 830 and database 850 is used to hold data.
Computing device 800 also includes access device 840, access device 840 enabling computing device 800 to communicate via one or more networks 860. Examples of such networks include public switched telephone networks (PSTN, public Switched Telephone Network), local area networks (LAN, local Area Network), wide area networks (WAN, wide Area Network), personal area networks (PAN, personal Area Network), or combinations of communication networks such as the internet. Access device 840 may include one or more of any type of network interface, wired or wireless, such as a network interface card (NIC, network interface controller), such as an IEEE802.11 wireless local area network (WLAN, wireless Local Area Network) wireless interface, a worldwide interoperability for microwave access (Wi-MAX, worldwide Interoperability for Microwave Access) interface, an ethernet interface, a universal serial bus (USB, universal Serial Bus) interface, a cellular network interface, a bluetooth interface, a near field communication (NFC, near Field Communication) interface, and so forth.
In one embodiment of the application, the above-described components of computing device 800, as well as other components not shown in FIG. 8, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device illustrated in FIG. 8 is for exemplary purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as desired.
Computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or personal computer (PC, personal Computer). Computing device 800 may also be a mobile or stationary server.
Wherein processor 820 is configured to execute computer-executable instructions of the message processing method.
The foregoing is a schematic illustration of a computing device of this embodiment. It should be noted that, the technical solution of the computing device and the technical solution of the message processing method belong to the same concept, and details of the technical solution of the computing device, which are not described in detail, can be referred to the description of the technical solution of the message processing method.
An embodiment of the present application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used in a message processing method.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the message processing method belong to the same concept, and details of the technical solution of the storage medium which are not described in detail can be referred to the description of the technical solution of the message processing method.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be increased or decreased appropriately according to the requirements of the patent practice, for example, in some areas, according to the patent practice, the computer readable medium does not include an electric carrier signal and a telecommunication signal.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the application disclosed above are intended only to assist in the explanation of the application. Alternative embodiments are not intended to be exhaustive or to limit the application to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and the full scope and equivalents thereof.

Claims (14)

1. A method of message processing comprising:
acquiring a subscription item submitted by a subscriber, and extracting a subscription theme and a message filtering condition from the subscription item;
distributing the filtering condition value corresponding to the message filtering condition to the subscription theme, and determining a subscription array corresponding to the subscription theme according to the distribution result;
constructing a message linked list according to the subscription array, and loading a jump table structure associated with the subscription item;
and updating the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
2. The message processing method according to claim 1, wherein after the step of updating the jump table structure to the target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition is performed, the method further comprises:
under the condition that a release message submitted by a publisher is received, loading the target jump table structure according to a release message theme in the release message;
reading the filtering condition value in the target jump table structure;
Traversing the target jump table structure under the condition that the filtering condition value is matched with the release filtering condition in the release message;
and determining the message linked list according to the traversing result, loading the target message corresponding to the message linked list, and pushing the target message to the publisher.
3. The method for processing messages according to claim 1, wherein said assigning the filtering condition value corresponding to the message filtering condition to the subscription topic and determining the subscription array corresponding to the subscription topic according to the assignment result includes:
under the condition that the sub-topics exist in the subscription topics, taking the subscription topics as parent topics;
determining a filtering condition value corresponding to the message filtering condition, and respectively distributing the filtering condition value to the parent theme and the child theme;
determining a parent subscription array corresponding to the parent topic and a child subscription array corresponding to the child topic according to the distribution result;
the constructing a message linked list according to the subscription array comprises the following steps:
and constructing a message linked list according to the parent subscription array and the child subscription array.
4. A message processing method according to claim 3, wherein said determining a filter condition value corresponding to said message filter condition, and assigning said filter condition value to said parent topic and said child topic, respectively, comprises:
Determining a filter condition value set corresponding to at least two sub-message filter conditions under the condition that the message filter conditions comprise the at least two sub-message filter conditions;
splitting the filtering condition value set, and respectively distributing the filtering condition values obtained after splitting to the parent theme and the child theme.
5. The message processing method according to claim 4, wherein the determining the parent subscription array corresponding to the parent topic and the child subscription array corresponding to the child topic according to the allocation result includes:
obtaining at least two father subscription items corresponding to the father topic and at least two child subscription items corresponding to the child topic according to the distribution result;
connecting the at least two father subscription items to obtain a father subscription array corresponding to the father topic, and connecting the at least two child subscription items to obtain a child subscription array corresponding to the child topic.
6. The message processing method of claim 4, wherein loading the skip list structure associated with the subscription item comprises:
loading a jump table structure associated with the subscription item according to the number of condition levels of the sub-message filtering conditions contained in the message filtering conditions, wherein the number of jump table nodes contained in the jump table structure is the same as the number of the condition levels;
The updating the jump table structure to a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition comprises the following steps:
determining a condition connection relation corresponding to the at least two sub-message filtering conditions, and taking the condition connection relation as a jump table node link relation corresponding to the message filtering conditions;
and updating each jump table node in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation, and obtaining a target jump table structure according to an updating result.
7. The message processing method according to claim 6, wherein updating each of the jump table nodes in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation, and obtaining a target jump table structure according to an update result comprises:
constructing node configuration information corresponding to each jump table node in the jump table structure according to the message linked list, the filtering condition value and the jump table node link relation;
and sequentially writing node configuration information corresponding to each jump table node into the jump table nodes in the jump table structure, and obtaining a target jump table structure according to a writing result.
8. The message processing method according to claim 2, characterized in that the method further comprises:
analyzing the release message to obtain at least one release condition field;
sequentially matching the at least one release condition field with a target condition field contained in the target jump table structure;
and in the case that the matching is passed, executing the step of reading the filtering condition value in the target jump table structure.
9. A message processing method according to claim 2 or 8, characterized in that the method further comprises:
receiving a subscription cancel request submitted by the publisher, and loading the target jump table structure according to the subscription cancel request;
and acquiring the message linked list based on the target jump table structure, deleting the message linked list, and responding to the subscription cancellation request.
10. A method of message processing comprising:
acquiring a subscription item submitted by a subscriber, and extracting a subscription theme and a message filtering condition from the subscription item;
determining a parent topic and a child topic according to the subscription topic, and respectively distributing filtering condition values corresponding to the message filtering conditions to the parent topic and the child topic;
Determining subscription arrays respectively corresponding to the father theme and the subtopic according to the distribution result, and constructing a message linked list according to the subscription arrays respectively corresponding to the father theme and the subtopic;
and loading the jump table structure associated with the subscription item, and updating the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
11. A message processing apparatus, comprising:
the acquisition module is configured to acquire subscription items submitted by subscribers and extract subscription topics and message filtering conditions from the subscription items;
the determining module is configured to distribute the filtering condition value corresponding to the message filtering condition to the subscription theme and determine a subscription array corresponding to the subscription theme according to the distribution result;
the construction module is configured to construct a message linked list according to the subscription array and load a jump table structure associated with the subscription item;
and the updating module is configured to update the jump table structure into a target jump table structure according to the message linked list, the filtering condition value and the jump table node link relation corresponding to the message filtering condition.
12. A message processing apparatus, comprising:
acquiring a subscription item template, wherein the subscription item template is configured to acquire subscription items submitted by subscribers, and extracting subscription topics and message filtering conditions from the subscription items;
the distribution condition value module is configured to determine a father topic and a child topic according to the subscription topic, and distribute the filtering condition values corresponding to the message filtering conditions to the father topic and the child topic respectively;
the construction linked list module is configured to determine subscription arrays respectively corresponding to the father topic and the child topic according to the distribution result, and construct a message linked list according to the subscription arrays respectively corresponding to the father topic and the child topic;
and the skip list updating module is configured to load the skip list structure associated with the subscription item, and update the skip list structure into a target skip list structure according to the message linked list, the filtering condition value and the skip list node link relation corresponding to the message filtering condition.
13. A computing device, comprising:
a memory and a processor;
the memory is configured to store computer executable instructions and the processor is configured to execute the computer executable instructions to implement the steps of the method of any one of claims 1 to 10.
14. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 10.
CN202311481100.6A 2023-11-08 2023-11-08 Message processing method and device Active CN117194080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311481100.6A CN117194080B (en) 2023-11-08 2023-11-08 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311481100.6A CN117194080B (en) 2023-11-08 2023-11-08 Message processing method and device

Publications (2)

Publication Number Publication Date
CN117194080A true CN117194080A (en) 2023-12-08
CN117194080B CN117194080B (en) 2024-02-06

Family

ID=88998379

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311481100.6A Active CN117194080B (en) 2023-11-08 2023-11-08 Message processing method and device

Country Status (1)

Country Link
CN (1) CN117194080B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110208559A1 (en) * 2010-02-24 2011-08-25 Marcus Fontoura Automatic Management of Networked Publisher-Subscriber Relationships
CN106059924A (en) * 2016-08-19 2016-10-26 华为技术有限公司 Information management method, devices and system
CN109862063A (en) * 2018-11-12 2019-06-07 平安科技(深圳)有限公司 Distribution subscription matching process, device and storage medium based on MQTT
CN110222143A (en) * 2019-05-31 2019-09-10 北京小米移动软件有限公司 Character string matching method, device, storage medium and electronic equipment
CN114722092A (en) * 2022-03-10 2022-07-08 阿里云计算有限公司 Time series data processing method, system, storage medium and electronic equipment
CN115766314A (en) * 2022-10-31 2023-03-07 海尔优家智能科技(北京)有限公司 Method and device for transmitting messages among components, storage medium and electronic device
CN116366418A (en) * 2023-03-02 2023-06-30 苏州智能交通信息科技股份有限公司 Device message subscription method, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110208559A1 (en) * 2010-02-24 2011-08-25 Marcus Fontoura Automatic Management of Networked Publisher-Subscriber Relationships
CN106059924A (en) * 2016-08-19 2016-10-26 华为技术有限公司 Information management method, devices and system
CN109862063A (en) * 2018-11-12 2019-06-07 平安科技(深圳)有限公司 Distribution subscription matching process, device and storage medium based on MQTT
CN110222143A (en) * 2019-05-31 2019-09-10 北京小米移动软件有限公司 Character string matching method, device, storage medium and electronic equipment
CN114722092A (en) * 2022-03-10 2022-07-08 阿里云计算有限公司 Time series data processing method, system, storage medium and electronic equipment
CN115766314A (en) * 2022-10-31 2023-03-07 海尔优家智能科技(北京)有限公司 Method and device for transmitting messages among components, storage medium and electronic device
CN116366418A (en) * 2023-03-02 2023-06-30 苏州智能交通信息科技股份有限公司 Device message subscription method, device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MOUSSALLI, ROGER: "A Study on Parallelizing XML Path Filtering Using Accelerators", ACM TRANSACTIONS ON EMBEDDED COMPUTING SYSTEMS VOLUME13 ISSUE4 *
张玉杰;张海涛;张婷婷;: "基于MQTT的物联网系统消息发布/订阅方法研究", 电视技术, no. 3, pages 215 - 219 *

Also Published As

Publication number Publication date
CN117194080B (en) 2024-02-06

Similar Documents

Publication Publication Date Title
CN111241185B (en) Data processing method and device
CN102682052B (en) The data query that filtering data stores
RU2500023C2 (en) Document synchronisation on protocol not using status information
CN101802815B (en) Data-driven synchronization
Vats et al. An independent time optimized hybrid infrastructure for big data analytics
CN109669925B (en) Management method and device of unstructured data
CN110119473A (en) A kind of construction method and device of file destination knowledge mapping
CN111343241B (en) Graph data updating method, device and system
CN111858676A (en) Data processing method and device
CN112667860A (en) Sub-graph matching method, device, equipment and storage medium
CN111488615A (en) Cross-link realization method and device for service data block chain
CN104579909A (en) Method and equipment for classifying user information and acquiring user grouping information
CN114329096A (en) Method and system for processing native map database
JP2005025362A (en) Device, method and program for controlling data synchronization
CN111427918A (en) Transaction detail data comparison method and device
CN104461893B (en) Data processing method and data processing equipment
CN117194080B (en) Message processing method and device
Huang et al. A novel social event organization approach for diverse user choices
CN110199277A (en) It include metadata in data resource
CN112241474A (en) Information processing method, device and storage medium
CN112269839A (en) Data storage method and device in block chain, electronic equipment and storage medium
Lu et al. Genderpredictor: a method to predict gender of customers from e-commerce website
CN115017185A (en) Data processing method, device and storage medium
Hashem et al. Pre-processing and modeling tools for bigdata
Li et al. A resilient index graph for querying large biological scientific data

Legal Events

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