CN114449031A - Information acquisition method, device, equipment and storage medium - Google Patents

Information acquisition method, device, equipment and storage medium Download PDF

Info

Publication number
CN114449031A
CN114449031A CN202111466852.6A CN202111466852A CN114449031A CN 114449031 A CN114449031 A CN 114449031A CN 202111466852 A CN202111466852 A CN 202111466852A CN 114449031 A CN114449031 A CN 114449031A
Authority
CN
China
Prior art keywords
topic
message
pointers
subscriber information
subscriber
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
CN202111466852.6A
Other languages
Chinese (zh)
Other versions
CN114449031B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111466852.6A priority Critical patent/CN114449031B/en
Publication of CN114449031A publication Critical patent/CN114449031A/en
Application granted granted Critical
Publication of CN114449031B publication Critical patent/CN114449031B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides an information acquisition method, an information acquisition device, information acquisition equipment and a storage medium, and relates to the technical field of computers, in particular to the field of artificial intelligence such as cloud computing and the Internet of things. The information acquisition method comprises the following steps: receiving a message theme of a message to be routed, which is sent by a client; if the number of all subscriber information corresponding to the message topic is larger than a preset value, acquiring part of subscriber information in all subscriber information; and sending the part of subscriber information to the client. The present disclosure may extend the number of subscribers to the same message topic.

Description

Information acquisition method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of artificial intelligence such as cloud computing and internet of things, and in particular, to an information acquisition method, apparatus, device, and storage medium.
Background
In a software architecture, publish/subscribe is a messaging paradigm. The publisher of the message gives the subscriber of the message a message of a message topic (topic) to which the subscriber of the message subscribes.
In order to send a message to a subscriber, the subscriber information needs to be acquired first. The subscriber information can be obtained by adopting a routing system (or called as message middleware), a routing client in the routing system can send a message theme to a routing server, the routing server determines a theme pointer (topic-pointer) based on the message theme, and then the subscriber information (subscriber) is obtained according to the relationship between the theme pointer and the subscriber information stored in a database.
Disclosure of Invention
The disclosure provides an information acquisition method, an information acquisition device, information acquisition equipment and a storage medium.
According to an aspect of the present disclosure, there is provided an information acquisition method including: receiving a message theme of a message to be routed, which is sent by a client; if the number of all subscriber information corresponding to the message topic is larger than a preset value, acquiring part of subscriber information in all subscriber information; and sending the part of subscriber information to the client.
According to another aspect of the present disclosure, there is provided an information acquisition method including: sending a message theme of a message to be routed to a server, wherein the message theme is used for triggering the server to respond that the number of all subscriber information corresponding to the message theme is greater than a preset value, and acquiring part of the subscriber information in all the subscriber information based on the message theme; and receiving the part of subscriber information sent by the server.
According to another aspect of the present disclosure, there is provided an information acquisition apparatus including: the first receiving module is used for receiving a message theme of the message to be routed, which is sent by the client; the acquisition module is used for acquiring part of subscriber information in all subscriber information if the number of all subscriber information corresponding to the message theme is larger than a preset value; and the first sending module is used for sending the part of the subscriber information to the client.
According to another aspect of the present disclosure, there is provided an information acquisition apparatus including: the first sending module is used for sending a message theme of a message to be routed to a server, wherein the message theme is used for triggering the server to respond that the number of all subscriber information corresponding to the message theme is greater than a preset value, and acquiring part of the subscriber information in all the subscriber information based on the message theme; and the first receiving module is used for receiving the part of subscriber information sent by the server.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the above aspects.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method according to any one of the above aspects.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of the above aspects.
According to the technical scheme of the disclosure, the number of subscribers of the same message topic can be expanded.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 3 is a schematic diagram according to a third embodiment of the present disclosure;
FIG. 4 is a schematic diagram according to a fourth embodiment of the present disclosure;
FIG. 5 is a schematic diagram according to a fifth embodiment of the present disclosure;
FIG. 6 is a schematic diagram according to a sixth embodiment of the present disclosure;
FIG. 7 is a schematic diagram according to a seventh embodiment of the present disclosure;
fig. 8 is a schematic diagram of an electronic device for implementing the information acquisition method according to the embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the related art, all subscriber information (subscribers) corresponding to a topic-pointer (topic-pointer) are acquired at one time based on the topic-pointer, and if the number of subscribers of a certain topic is too large, the data volume of the subscriber information acquired at one time is too large, and problems such as network congestion and machine performance tension are caused. To avoid the above problem, the number of subscribers to a single message topic (topic) is often limited.
Fig. 1 is a schematic diagram according to a first embodiment of the present disclosure, which provides an information acquisition method, including:
101. and receiving the message theme of the message to be routed sent by the client.
102. And if the number of all subscriber information corresponding to the message theme is larger than a preset value, acquiring part of the subscriber information in all the subscriber information.
103. And sending the part of subscriber information to the client.
As shown in fig. 2, the routing system may include: a client 201, a server 202 and a database 203.
The client may specifically refer to a routing client, and the server may specifically refer to a routing server.
The method of the embodiment can be applied to a server.
The client 201 may be located at a publisher side, so that, based on the routing system, the publisher may know the subscriber information, and then, based on the subscriber information, the publisher may send a message to a subscriber corresponding to the subscriber information.
The server 202 and the database 203 may be located on a server, and the server may be a local server or a cloud. The server 202 and the database 203 may be located on the same or different servers.
The server 202 receives a message topic (topic) sent by the client 201, and determines a topic-pointer corresponding to the received topic based on a correspondence between the message topic and a topic pointer (topic-pointer) established in advance. Generally, one topoc corresponds to only one topoc-pointer.
In the related art, the database 203 stores the correspondence between the topic-pointer and the subscriber information (subscriber), and the correspondence is generally stored in a Key-Value pair (KV) form, that is, K is the topic-pointer and V is the subscriber. One topoic-pointer may correspond to one or more (a plurality means at least two) subscribers. One subscriber includes one subscriber-id and one subscriber-meta-information (subscriber-metadata), and all subscriber information (subscribers) corresponding to one topic-pointer are acquired at one time.
The message topic is used to identify the message type, as shown in fig. 3, the message topic may be represented by a character string having a hierarchical relationship, the same subscriber may subscribe to different message topics, and different subscribers may subscribe to the same message topic.
In the related art, for example, referring to the upper part of fig. 3, 0x000D is a topic-pointer (topic-pointer), the inbox1(0) is subscriber information (subscriber), and the inbox1 is subscriber identifier (subscriber-id), where 0 represents corresponding subscriber meta-information (subscriber-metadata).
Assuming that the message topic is a message topic (× for/stock/nyse) in the first row, it may be determined that the topic pointer corresponding to the message topic is 0x000D, and the corresponding subscribers include inbox1(0) and inbox2(1), at this time, all subscriber information (subscribers) corresponding to 0x000D, that is, inbox1(0) and inbox2(1), are read at one time. If the number of the subscriber information is large, the problem of network congestion and the like can be caused, and in order to avoid the problem of network congestion and the like, the number of the subscriber information corresponding to each topic pointer is generally limited.
In order to expand the number of subscribers of the same message topic, in this embodiment, if the number of all subscriber information corresponding to the message topic is greater than a preset value, part of the subscriber information in all the subscriber information is acquired, and part of the subscribers is newly sent to the client.
That is, part of the subscriber information is acquired at a time, not all of the subscriber information, for example, 100 pieces of all subscriber information and 10 pieces of partial subscriber information at a time, so that all of the subscriber information can be acquired 10 times. Therefore, based on the batch-wise acquisition mode, all subscriber information can be acquired for multiple times, and the number of subscribers corresponding to each message topic is theoretically unlimited.
In the embodiment of the present disclosure, if the number of all subscriber information corresponding to the message topic is greater than a preset value, part of the subscriber information in all the subscriber information is acquired, and batch acquisition of all subscriber information of the same message topic can be realized, so that the number of subscribers of the same message topic is expanded.
In some embodiments, before acquiring part of subscriber information in all subscriber information if the number of all subscriber information corresponding to the message topic is greater than a preset value, the method further includes: receiving a specified number sent by the client, wherein the specified number is used for indicating the number of the partial subscriber information; correspondingly, if the number of all subscriber information corresponding to the message topic is greater than a preset value, acquiring part of the subscriber information in all the subscriber information, including: and if the number of all subscriber information corresponding to the message theme is greater than a preset value, acquiring part of subscriber information with the specified number.
That is, the number of partial subscriber information may be specified by the client, and the server sends the client-specified number of partial subscriber information to the client.
Because the client can also execute other operations, such as message sending and the like, if a large amount of subscriber information is obtained, the client may not be in time to process, so that data backlog is caused, and a large amount of memory space is occupied.
In some embodiments, the obtaining part of the total subscriber information includes: acquiring all theme pointers corresponding to the message theme; acquiring a to-be-processed theme pointer in all the theme pointers; based on the to-be-processed subject pointer, acquiring identification information, wherein the identification information comprises: the to-be-processed topic pointer and subscriber identifications of partial subscribers subscribing to the to-be-routed message; obtaining subscriber meta-information of the part of subscribers corresponding to the identification information; and acquiring the partial subscriber information based on the subscriber identification and the subscriber meta-information.
The to-be-processed subject pointer may be an entire subject pointer or a part of the entire subject pointers.
In the related art, the data corresponding to K is topic-pointer, and the data corresponding to V is subscriber-id + subscriber-metadata, so that all subscriber information corresponding to the topic-pointer is acquired at one time.
In order to obtain part of the subscriber information at a time, the present embodiment may modify KV.
As shown in the lower part of FIG. 3, in this embodiment, the data corresponding to K is topoic-pointer + subscriber-id, and the data corresponding to V is subscriber-metadata.
That is, in this embodiment, the identification information corresponding to each message topic is no longer a topic pointer, but is data composed of a topic pointer and a subscriber identification, or a topic pointer is used as a prefix.
For example, referring to fig. 3, it is assumed that the message topic is a message topic (× form/stock/nyse) in the first row, the topic pointer at this time is 0x000D, and after the descriptor-id is placed in the K part, the identification information corresponding to the message topic at this time includes: 0x000D + inbox1 (denoted by <0x000D > < inbox1> in fig. 3), and 0x000D + inbox2 (denoted by <0x000D > < inbox2> in fig. 3), i.e., the identification information includes a topic pointer and subscriber identification.
After the identification information is determined, the subscriber meta-information corresponding to the identification information may be obtained, for example, if the identification information is <0x000D > < inbox1>, the corresponding subscriber meta-information is 0.
The server obtains the subscriber meta-information by using the identification information (topic pointer + subscriber identification), for example, data of one KV line shown in fig. 3 (see the following embodiments, the specific line number obtained at each time may be specified) may be obtained each time, so as to implement batch obtaining of subscriber information corresponding to a certain message topic, for example, obtaining subscriber meta-information corresponding to <0x000D > < inbox1> for the first time, and obtaining subscriber meta-information corresponding to <0x000D > < inbox2> for the second time, instead of reading all at once, so that theoretically, each message topic may correspond to infinite subscriber information.
After obtaining the subscriber meta-information, the server may combine with the subscriber identity to obtain complete subscriber information, that is, the subscriber information is subscriber identity + subscriber meta-data, for example, the subscriber meta-information corresponding to the identity information <0x000D > < inbox1> is 0, and since the subscriber identity at this time is inbox1, the subscriber information may be obtained as inbox1(0) after combination.
By determining the identification information corresponding to the message topic, wherein the identification information comprises the topic pointer and the subscriber identification, and acquiring the subscriber meta-information based on the identification information, batch acquisition of the subscriber information of the same message topic can be realized, so that the number of subscribers of the same message topic is expanded.
In some embodiments, after the obtaining all topic pointers corresponding to the message topic and before the obtaining a to-be-processed topic pointer in all topic pointers, the method further includes: sending at least part of the subject pointers in the whole subject pointers to the client; correspondingly, the obtaining of the to-be-processed subject pointer in all the subject pointers includes: and receiving the to-be-processed subject pointer sent by the client, wherein the to-be-processed subject pointer is determined by the client in at least part of the subject pointers.
In some embodiments, after the at least part of the topic pointers are part of the topic pointers and all topic pointers corresponding to the message topics are obtained, the method further includes: and sending the subscriber information corresponding to other topic pointers to the client, wherein the other topic pointers are the topic pointers except for the part of the topic pointers in all the topic pointers.
In some embodiments, after receiving the message topic of the message to be routed sent by the client, the method further includes: and if the number of all subscriber information corresponding to the message topic is less than or equal to the preset value, all subscriber information is sent to the client.
That is, the server may send, to the client, at least part of the topic pointer and/or subscriber information corresponding to another part of the topic pointer except for the at least part of the topic pointer.
Although one topic corresponds to one topic-pointer, a topic subscribed by a subscriber may correspond to a plurality of topics, and thus, a plurality of topics-pointers may be obtained based on one topic. For example, referring to fig. 3, the topic subscribed by a certain subscriber is the topic of the second row (× form/stock/#), where "#" is a wildcard, and therefore, the subscriber at this time also subscribes to the topic of the first row (× form/stock/nyse), and thus, the topic-pointer corresponding to the topic of the first row and the topic-pointer corresponding to the topic of the second row can be obtained based on the topic of the second row.
Taking the second line topic as an example, all the subject pointers at this time are topic-pointers corresponding to the topic of the first line and topic-pointers corresponding to the topic of the second line. At this time, both the subject pointers may be sent to the client; or, the subscriber information corresponding to some of the topic pointers and other some topic pointers may be sent to the client, for example, the topic-pointer corresponding to the topic of the first line and the subscriber information (inbox2(0)) corresponding to the topic of the first line may be sent to the client.
Assuming that the server sends a plurality of topic pointers (topic-pointers) of a certain topic to the client, the client may designate a to-be-processed topic pointer in the plurality of topic pointers, for example, select all or part of the received topic pointers as the to-be-processed topic pointers, and send the to-be-processed topic pointers to the server.
The client specifies the to-be-processed topic pointer, so that the subscriber information can be acquired in batches based on the client requirements.
When the server returns the topic pointer to the client, the server also returns the subscriber information, so that the client can prefetch at least part of the subscriber information, and the acquisition efficiency of the subscriber information is improved.
When the number of all subscriber information is small, all subscriber information is acquired at one time, so that a secondary request of a client to a server can be avoided, and resources are saved.
Fig. 4 is a schematic diagram according to a fourth embodiment of the present disclosure, where this embodiment provides an information obtaining method, and the method is implemented by a client as an example, and includes:
401. and sending a message theme of the message to be routed to a server, wherein the message theme is used for triggering the server to respond that the number of all subscriber information corresponding to the message theme is greater than a preset value, and acquiring part of the subscriber information in all the subscriber information based on the message theme.
402. And receiving the part of subscriber information sent by the server.
In some embodiments, before the receiving the partial subscriber information sent by the server, the method further includes:
and sending a specified number to the server, wherein the specified number is used for triggering the server to acquire the part of subscriber information of which the number is the specified number.
In some embodiments, after the sending the message topic of the message to be routed to the server and before the receiving the part of the subscriber information sent by the server, the method further includes:
receiving at least part of the subject pointers in all the subject pointers corresponding to the message subjects sent by the server;
determining a to-be-processed subject pointer in the at least part of the subject pointers;
sending the to-be-processed subject pointer to the server, where the to-be-processed subject pointer is used to trigger the server to obtain identification information based on the to-be-processed subject pointer, obtain subscriber meta-information based on the identification information, and obtain the partial subscriber information based on the identification information and the subscriber meta-information, where the identification information includes: the pointer to the topic to be processed, and subscriber identification of part of subscribers subscribing the message to be routed.
In some embodiments, the at least part of the topic pointer is a part of the topic pointer, and after the message topic of the message to be routed is sent to the server, the method further includes:
and receiving subscriber information corresponding to other topic pointers sent by the server, wherein the other topic pointers are topic pointers except for the part of topic pointers in all the topic pointers.
In some embodiments, after sending the message topic of the message to be routed to the server, the method further includes:
and receiving all the subscriber information sent by the server end in response to the fact that the number of all the subscriber information corresponding to the message topic is smaller than or equal to a preset value.
The process executed by the client corresponds to the process executed by the server, and specific contents and effects thereof may refer to the relevant description of the embodiment corresponding to the server.
In the embodiment of the disclosure, all subscriber information of the same message topic can be obtained in batches by receiving part of the subscriber information sent by the server, so that the number of subscribers of the same message topic is expanded.
Fig. 5 is a schematic diagram according to a fifth embodiment of the present disclosure, in this embodiment, an information obtaining method is provided, and in this embodiment, taking interaction between a client and a server as an example, the method of this embodiment includes:
501. and the client sends the message theme of the message to be routed to the server.
502. And the server side determines a subject pointer corresponding to the message subject based on the corresponding relation between the message subject and the subject pointer established in advance. And the server side sends the subject pointer and/or the prefetched subscriber information to the client side.
For example, the message topic in the second line of fig. 3 corresponds to the message topic in the first line and the message topic in the second line, so that one or more topic pointers can be obtained based on one message topic.
The process of 501-502 may be referred to as a topic matching (matchtopic) process.
In the related technology, the client side can send the message theme to the server side, the server side converts the message theme into a theme pointer, all subscriber information is searched based on the theme pointer, and all subscriber information is returned to the client side once again. In general, there is a network request between the client and the server.
In this embodiment, in order to implement batch acquisition of subscriber information, at this time, network requests may be divided into two times, where the first request may obtain a topic pointer, and the second request obtains subscriber information based on the topic pointer.
That is, after the server obtains the topic pointer based on the message topic, the topic pointer can be returned to the client. Alternatively, the first and second liquid crystal display panels may be,
after the server side obtains the topic pointer, if the number of all subscriber information corresponding to the topic pointer is small, all subscriber information can be directly returned to the client side at the moment without feedback of the topic pointer, that is, all subscriber information can be returned through one network request, so that one network request can be saved and the performance can be improved when the number of all subscriber information is small.
It is understood that it is also possible to return a portion of the topic pointer, and the subscriber information corresponding to the additional portion of the topic pointer.
The subscriber information returned by the server based on the first request (message topic) sent by the client may be referred to as prefetched subscriber information.
503. And the client sends the theme pointer to the server.
The process that the client acquires the subscriber information based on the topic pointer can be realized through fetchsubscribe service. Specifically, after the client receives the theme pointer sent by the server, the theme pointer may be used as a parameter to call the fetchSubscriber service, the fetchSubscriber service may be located at the client, and the fetchSubscriber service may send the theme pointer selected by the client to the server. The topic pointers sent by the client to the server can be one or more, and when the topic pointers are multiple, the topic pointers can be sent to the server together in a list form.
504. The client sends the specified number to the server.
The client may send the specified number (requestsize) one or more times, for example, a first specified number is sent for the first time, a second specified number is sent for the second time, and the specified numbers at each time may be the same or different.
The server side determines the theme pointer and sends the theme pointer to the client side, and the client side sends the theme pointer to the server side when obtaining the subscriber information. After the server determines the topic pointers, the topic pointers are not returned to the client, but when the client needs to acquire the subscriber information, the server sends the specified number to the server, and the server acquires the corresponding subscriber information according to the specified number and the previously determined topic pointers.
505. The server side sends the specified quantity to the database.
The database of this embodiment may be referred to as rearranged kv (orderdk), where K corresponds to topoic-pointer + subscriber-id, and V corresponds to subscriber-metadata.
506. And the database returns the KV to the server.
In order to ensure the accuracy of the data searched by the database, current identification information, which may also be referred to as a cursor (cursor), may be recorded each time KV is obtained based on a specified number, so that the search may be continued from the position of the current identification information next time.
For example, K in the database corresponds to identification information, the identification information includes topoic-pointer + subscriber-ID, and it is assumed that the identification information is represented by ID1, ID2, ID3, and the like, and it is assumed that the current specified number is 2, that is, the database can find data corresponding to ID1 and ID2, at this time, it may record that the current identification information is ID2, and continue to find from ID2 next time, that is, the first number of data corresponding to ID3 next time.
The data searched by the database and returned to the server may be referred to as KV, that is, include K and V, where K is a topic pointer and a subscriber identifier (topic-pointer + subscriber-id), and V is subscriber meta information (subscriber-metadata).
For a scene with a plurality of subject pointers, the total data volume of the plurality of subject pointers can be guaranteed to be a specified number, and the data volume of each subject pointer is not limited. For example, if the specified number is 10, the data size corresponding to the first topic pointer may be 2, and the data size corresponding to the second topic pointer may be 8; alternatively, the data size corresponding to the first subject pointer may be 5, and the data size corresponding to the second subject pointer may be 5.
507. And the server side sends the subscriber information to the client side.
After the server obtains the KV, the server may combine the subscriber identifier in K and the subscriber meta-information in V to obtain complete subscriber information, that is, subscriber-id + subscriber-meta-information, and then return the subscriber-id + subscriber-meta-information to the client.
In this embodiment, the subscripter is split, the subscripter-id is put into a key as a suffix, and the subscripter-meta is used as a value, that is, < topic-pointer + subscripter-id, and subscripter-metadata > are stored as a pair of KV, and the topic-pointer can be used as a prefix for batch reading during matching, so that a single topic can be subscribed by a large number of subscripters (theoretically, the number is not limited), and the situation of resource shortage such as network congestion is not caused.
It is understood that the details, which are not described in detail in one embodiment of the present disclosure, may be referred to in the description of other embodiments.
It is to be understood that the timing relationship between the steps in the embodiments is not limited, unless a timing relationship is necessarily required.
Fig. 6 is a schematic diagram according to a sixth embodiment of the present disclosure, which provides an information acquisition apparatus 600 including: a first receiving module 601, an obtaining module 602 and a first sending module 603.
The first receiving module 601 is configured to receive a message topic of a message to be routed, which is sent by a client; the obtaining module 602 is configured to obtain part of subscriber information in all subscriber information if the number of all subscriber information corresponding to the message topic is greater than a preset value; the first sending module 603 is configured to send the partial subscriber information to the client.
In some embodiments, the apparatus 600 further comprises: a second receiving module, configured to receive a specified number sent by the client, where the specified number is used to indicate the number of the partial subscriber information; the obtaining module 602 is further configured to: and acquiring the part of subscriber information with the specified number.
In some embodiments, the obtaining module 602 is further configured to: acquiring all theme pointers corresponding to the message theme; obtaining a to-be-processed subject pointer in all the subject pointers; based on the to-be-processed subject pointer, acquiring identification information, wherein the identification information comprises: the to-be-processed topic pointer and subscriber identifications of partial subscribers subscribing to the to-be-routed message; obtaining subscriber meta-information of the part of subscribers corresponding to the identification information; and acquiring the partial subscriber information based on the subscriber identification and the subscriber meta-information.
In some embodiments, the apparatus 600 further comprises: a second sending module, configured to send at least part of the all topic pointers to the client; the obtaining module 602 is further configured to: and receiving the to-be-processed subject pointer sent by the client, wherein the to-be-processed subject pointer is determined by the client in at least part of the subject pointers.
In some embodiments, the at least partial subject pointer is a partial subject pointer, the apparatus 600 further comprises: and a third sending module, configured to send subscriber information corresponding to other topic pointers to the client, where the other topic pointers are topic pointers except for the partial topic pointers in all the topic pointers.
In some embodiments, the apparatus 600 further comprises: and the fourth sending module is used for sending all the subscriber information to the client if the number of all the subscriber information corresponding to the message theme is less than or equal to the preset value.
In the embodiment of the present disclosure, if the number of all subscriber information corresponding to the message topic is greater than a preset value, part of the subscriber information in all the subscriber information is acquired, and batch acquisition of all subscriber information of the same message topic can be realized, so that the number of subscribers of the same message topic is expanded.
Fig. 7 is a schematic diagram according to a seventh embodiment of the present disclosure, which provides an information acquisition apparatus 700, including: a first transmitting module 701 and a first receiving module 702.
The first sending module 701 is configured to send a message topic of a message to be routed to a server, where the message topic is used to trigger the server to respond that the number of all subscriber information corresponding to the message topic is greater than a preset value, and obtain part of the subscriber information in all the subscriber information based on the message topic; the first receiving module 702 is configured to receive the part of the subscriber information sent by the server.
In some embodiments, the apparatus 700 further comprises: and the second sending module is used for sending a specified number to the server, wherein the specified number is used for triggering the server to obtain the part of subscriber information of which the number is the specified number.
In some embodiments, the apparatus 700 further comprises: a second receiving module, configured to receive at least part of the topic pointers in all topic pointers corresponding to the message topic sent by the server; a determining module, configured to determine a to-be-processed subject pointer in the at least part of subject pointers; a third sending module, configured to send the to-be-processed topic pointer to the server, where the to-be-processed topic pointer is used to trigger the server to obtain identification information based on the to-be-processed topic pointer, obtain subscriber meta information based on the identification information, and obtain the partial subscriber information based on the identification information and the subscriber meta information, where the identification information includes: the pointer to the topic to be processed, and subscriber identification of part of subscribers subscribing the message to be routed.
In some embodiments, the at least partial subject pointer is a partial subject pointer, the apparatus 700 further comprises: and a third receiving module, configured to receive subscriber information corresponding to other topic pointers sent by the server, where the other topic pointers are topic pointers except for the partial topic pointers in all the topic pointers.
In some embodiments, the apparatus 700 further comprises: and the fourth receiving module is used for receiving all the subscriber information sent by the server end in response to the fact that the number of all the subscriber information corresponding to the message theme is smaller than or equal to a preset value.
In the embodiment of the disclosure, all subscriber information of the same message topic can be obtained in batches by receiving part of the subscriber information sent by the server, so that the number of subscribers of the same message topic is expanded.
It is to be understood that in the disclosed embodiments, the same or similar elements in different embodiments may be referenced.
It is to be understood that "first", "second", and the like in the embodiments of the present disclosure are used for distinction only, and do not indicate the degree of importance, the order of timing, and the like.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the personal information of the related user are all in accordance with the regulations of related laws and regulations and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the electronic device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic apparatus 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the electronic device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and the like. The calculation unit 801 executes the respective methods and processes described above, such as the information acquisition method. For example, in some embodiments, the message routing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto the electronic device 800 via the ROM 802 and/or the communication unit 809. When loaded into RAM 803 and executed by computing unit 801, a computer program may perform one or more of the steps of the information acquisition method described above. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the information acquisition method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (25)

1. An information acquisition method, comprising:
receiving a message theme of a message to be routed, which is sent by a client;
if the number of all subscriber information corresponding to the message topic is larger than a preset value, acquiring part of subscriber information in all subscriber information;
and sending the part of subscriber information to the client.
2. The method according to claim 1, wherein before acquiring part of subscriber information in all subscriber information if the number of all subscriber information corresponding to the message topic is greater than a preset value, the method further comprises:
receiving a specified number sent by the client, wherein the specified number is used for indicating the number of the partial subscriber information;
correspondingly, if the number of all subscriber information corresponding to the message topic is greater than a preset value, acquiring part of the subscriber information in all the subscriber information, including:
and if the number of all subscriber information corresponding to the message theme is greater than a preset value, acquiring part of subscriber information with the specified number.
3. The method of claim 1, wherein the obtaining of the partial subscriber information of the total subscriber information comprises:
acquiring all theme pointers corresponding to the message theme;
obtaining a to-be-processed subject pointer in all the subject pointers;
based on the to-be-processed subject pointer, acquiring identification information, wherein the identification information comprises: the to-be-processed topic pointer and subscriber identifications of partial subscribers subscribing to the to-be-routed message;
obtaining subscriber meta-information of the part of subscribers corresponding to the identification information;
and acquiring the partial subscriber information based on the subscriber identification and the subscriber meta-information.
4. The method according to claim 3, wherein after the all topic pointers corresponding to the message topic are obtained and before the to-be-processed topic pointer in the all topic pointers is obtained, the method further comprises:
sending at least part of the subject pointers in the whole subject pointers to the client;
correspondingly, the obtaining of the to-be-processed subject pointer in all the subject pointers includes:
and receiving the to-be-processed subject pointer sent by the client, wherein the to-be-processed subject pointer is determined by the client in at least part of the subject pointers.
5. The method of claim 4, wherein the at least partial topic pointers are partial topic pointers, and after obtaining all topic pointers corresponding to the message topic, the method further comprises:
and sending the subscriber information corresponding to other topic pointers to the client, wherein the other topic pointers are the topic pointers except for the part of the topic pointers in all the topic pointers.
6. The method according to any of claims 1-5, after receiving a message topic of a message to be routed sent by a client, the method further comprising:
and if the number of all subscriber information corresponding to the message theme is less than or equal to the preset value, all subscriber information is sent to the client.
7. An information acquisition method, comprising:
sending a message theme of a message to be routed to a server, wherein the message theme is used for triggering the server to respond that the number of all subscriber information corresponding to the message theme is greater than a preset value, and acquiring part of the subscriber information in all the subscriber information based on the message theme;
and receiving the part of subscriber information sent by the server.
8. The method of claim 7, before the receiving the partial subscriber information sent by the server, the method further comprising:
and sending a specified number to the server, wherein the specified number is used for triggering the server to acquire the part of subscriber information of which the number is the specified number.
9. The method of claim 7, after sending a message topic for a message to be routed to a server and before receiving the partial subscriber information sent by the server, the method further comprising:
receiving at least part of the subject pointers in all the subject pointers corresponding to the message subjects sent by the server;
determining a to-be-processed subject pointer in the at least part of the subject pointers;
sending the to-be-processed subject pointer to the server, where the to-be-processed subject pointer is used to trigger the server to obtain identification information based on the to-be-processed subject pointer, obtain subscriber meta-information based on the identification information, and obtain the partial subscriber information based on the identification information and the subscriber meta-information, where the identification information includes: the pointer to the topic to be processed, and subscriber identification of part of subscribers subscribing the message to be routed.
10. The method of claim 9, wherein the at least partial topic pointer is a partial topic pointer, and after sending the message topic of the message to be routed to the server, the method further comprises:
and receiving subscriber information corresponding to other topic pointers sent by the server, wherein the other topic pointers are topic pointers except for the part of topic pointers in all the topic pointers.
11. The method according to any of claims 7-10, after sending the message topic of the message to be routed to the server, the method further comprising:
and receiving all the subscriber information sent by the server end in response to the fact that the number of all the subscriber information corresponding to the message topic is smaller than or equal to a preset value.
12. An information acquisition apparatus comprising:
the first receiving module is used for receiving a message theme of the message to be routed, which is sent by the client;
the acquisition module is used for acquiring part of subscriber information in all subscriber information if the number of all subscriber information corresponding to the message theme is larger than a preset value;
and the first sending module is used for sending the part of the subscriber information to the client.
13. The apparatus of claim 12, further comprising:
a second receiving module, configured to receive a specified number sent by the client, where the specified number is used to indicate the number of the partial subscriber information;
the acquisition module is further configured to:
and acquiring the part of subscriber information with the specified number.
14. The apparatus of claim 12, wherein the means for obtaining is further configured to:
acquiring all theme pointers corresponding to the message theme;
obtaining a to-be-processed subject pointer in all the subject pointers;
based on the to-be-processed subject pointer, acquiring identification information, wherein the identification information comprises: the to-be-processed topic pointer and subscriber identifications of partial subscribers subscribing to the to-be-routed message;
obtaining subscriber meta-information of the part of subscribers corresponding to the identification information;
and acquiring the partial subscriber information based on the subscriber identification and the subscriber meta-information.
15. The apparatus of claim 14, further comprising:
a second sending module, configured to send at least part of the all topic pointers to the client;
the acquisition module is further configured to:
and receiving the to-be-processed subject pointer sent by the client, wherein the to-be-processed subject pointer is determined by the client in at least part of the subject pointers.
16. The apparatus of claim 15, wherein the at least partial subject pointer is a partial subject pointer, the apparatus further comprising:
and a third sending module, configured to send subscriber information corresponding to other topic pointers to the client, where the other topic pointers are topic pointers except for the partial topic pointers in all the topic pointers.
17. The apparatus of any of claims 12-16, further comprising:
and the fourth sending module is used for sending all the subscriber information to the client if the number of all the subscriber information corresponding to the message theme is less than or equal to the preset value.
18. An information acquisition apparatus comprising:
the first sending module is used for sending a message theme of a message to be routed to a server, wherein the message theme is used for triggering the server to respond that the number of all subscriber information corresponding to the message theme is greater than a preset value, and acquiring part of the subscriber information in all the subscriber information based on the message theme;
and the first receiving module is used for receiving the part of subscriber information sent by the server.
19. The apparatus of claim 18, further comprising:
and the second sending module is used for sending a specified number to the server, wherein the specified number is used for triggering the server to obtain the part of subscriber information of which the number is the specified number.
20. The apparatus of claim 18, further comprising:
a second receiving module, configured to receive at least part of all topic pointers corresponding to the message topic sent by the server;
a determining module, configured to determine a to-be-processed subject pointer in the at least part of subject pointers;
a third sending module, configured to send the to-be-processed topic pointer to the server, where the to-be-processed topic pointer is used to trigger the server to obtain identification information based on the to-be-processed topic pointer, obtain subscriber meta information based on the identification information, and obtain the partial subscriber information based on the identification information and the subscriber meta information, where the identification information includes: the pointer to the topic to be processed, and subscriber identification of part of subscribers subscribing the message to be routed.
21. The apparatus of claim 20, wherein the at least partial subject pointer is a partial subject pointer, the apparatus further comprising:
and a third receiving module, configured to receive subscriber information corresponding to other topic pointers sent by the server, where the other topic pointers are topic pointers except for the partial topic pointers in all the topic pointers.
22. The apparatus of any of claims 18-21, further comprising:
and the fourth receiving module is used for receiving all the subscriber information sent by the server end in response to the fact that the number of all the subscriber information corresponding to the message theme is smaller than or equal to a preset value.
23. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
24. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-11.
25. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-11.
CN202111466852.6A 2021-12-03 2021-12-03 Information acquisition method, device, equipment and storage medium Active CN114449031B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111466852.6A CN114449031B (en) 2021-12-03 2021-12-03 Information acquisition method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111466852.6A CN114449031B (en) 2021-12-03 2021-12-03 Information acquisition method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114449031A true CN114449031A (en) 2022-05-06
CN114449031B CN114449031B (en) 2023-11-21

Family

ID=81364228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111466852.6A Active CN114449031B (en) 2021-12-03 2021-12-03 Information acquisition method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114449031B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050117538A1 (en) * 2003-11-28 2005-06-02 Alcatel System for transmitting multicast information
CN101295311A (en) * 2008-06-17 2008-10-29 浙江大学 Semantic matching algorithm of large scale issuance subscription system
CN103534988A (en) * 2013-06-03 2014-01-22 华为技术有限公司 Publish and subscribe messaging method and apparatus
CN103699616A (en) * 2013-12-17 2014-04-02 新浪网技术(中国)有限公司 Data structure establishment method, subscription message data sending method and related devices
US20160205536A1 (en) * 2015-01-14 2016-07-14 Qualcomm Incorporated Throughput and multi-sim call performance through efficient reuse of cached overhead information
WO2019157883A1 (en) * 2018-02-13 2019-08-22 论客科技(广州)有限公司 Method and device for pushing message on basis of member level, server and system
US20200120169A1 (en) * 2018-10-15 2020-04-16 Citrix Systems, Inc. Scalable message passing architecture a cloud environment
CN112751892A (en) * 2019-10-30 2021-05-04 腾讯科技(深圳)有限公司 Information distribution method, device, equipment and storage medium
CN113138995A (en) * 2021-05-13 2021-07-20 中国工商银行股份有限公司 Update notification method and device in micro-service cluster

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050117538A1 (en) * 2003-11-28 2005-06-02 Alcatel System for transmitting multicast information
CN101295311A (en) * 2008-06-17 2008-10-29 浙江大学 Semantic matching algorithm of large scale issuance subscription system
CN103534988A (en) * 2013-06-03 2014-01-22 华为技术有限公司 Publish and subscribe messaging method and apparatus
CN103699616A (en) * 2013-12-17 2014-04-02 新浪网技术(中国)有限公司 Data structure establishment method, subscription message data sending method and related devices
US20160205536A1 (en) * 2015-01-14 2016-07-14 Qualcomm Incorporated Throughput and multi-sim call performance through efficient reuse of cached overhead information
WO2019157883A1 (en) * 2018-02-13 2019-08-22 论客科技(广州)有限公司 Method and device for pushing message on basis of member level, server and system
US20200120169A1 (en) * 2018-10-15 2020-04-16 Citrix Systems, Inc. Scalable message passing architecture a cloud environment
CN112751892A (en) * 2019-10-30 2021-05-04 腾讯科技(深圳)有限公司 Information distribution method, device, equipment and storage medium
CN113138995A (en) * 2021-05-13 2021-07-20 中国工商银行股份有限公司 Update notification method and device in micro-service cluster

Also Published As

Publication number Publication date
CN114449031B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
CN108984553B (en) Caching method and device
CN110321252B (en) Skill service resource scheduling method and device
CN108764866B (en) Method and equipment for allocating resources and drawing resources
CN112118352B (en) Method and device for processing notification trigger message, electronic equipment and computer readable medium
CN108959294B (en) Method and device for accessing search engine
CN113761565A (en) Data desensitization method and apparatus
CN111159211A (en) Order information generation method, device and system, computer equipment and storage medium
CN113220705A (en) Slow query identification method and device
CN113590447B (en) Buried point processing method and device
CN112887426B (en) Information stream pushing method and device, electronic equipment and storage medium
CN113656731A (en) Advertisement page processing method and device, electronic equipment and storage medium
CN112966201B (en) Object processing method, device, electronic equipment and storage medium
CN114449031A (en) Information acquisition method, device, equipment and storage medium
CN113726885A (en) Method and device for adjusting flow quota
CN114546343A (en) Generation method and device of activity page
CN115373831A (en) Data processing method, device and computer readable storage medium
CN112860762A (en) Method and apparatus for detecting time period overlap
CN110019671B (en) Method and system for processing real-time message
CN113449230A (en) Method and system for determining exposure element, client and server
CN113779018A (en) Data processing method and device
CN111767447A (en) Method and device for determining user traffic path
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN113037608B (en) Message reply method and device, electronic equipment and readable storage medium
CN115203599B (en) Information recommendation method, device, equipment and storage medium
CN113766437B (en) Short message sending method and device

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