A method, device, equipment and medium for orderly sending information

By determining the time interval, pre-send order and topic of task information based on the characteristics of task requests and task information flow in Kafka system, and determining the target generation time based on the initial generation time and time interval, the different in the distributed message system are solved. The problem of messaging disorder between Topics achieves the effect of sending different Topic information in an orderly manner.

CN115550455BActive Publication Date: 2025-02-18AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211262498.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-14
Publication Date
2025-02-18
Estimated Expiration
2042-10-14

AI Technical Summary

Technical Problem

When the existing distributed message system ensures the orderliness of messages within the same Topic, it cannot guarantee the orderliness between different Topics.

Method used

In the Kafka system, based on the characteristics of task requests and task information flow, the time interval, pre-send order and subject of task information are determined, and the target generation time is determined based on the initial generation time and time interval, and written to the information table to be sent. Finally, the transmission order is determined based on the target generation time, and the orderly transmission of different Topic messages is realized.

Benefits of technology

It realizes the effect of sending different Topic information in an orderly manner when the Producer generates multiple different Topic messages, ensuring the orderliness of the messages span multiple Topics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550455B_ABST
    Figure CN115550455B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and medium for orderly sending information. The method is applied to an information management system established based on Kafka, and the method includes: based on the characteristics of task requests and task information flows, determining the time interval, pre-sending order and subject of task information in the task information flow, wherein the task information includes the initial generation time; if the subject corresponds to multiple different topic types, then based on the time interval, pre-sending order and initial generation time, determining the target generation time of the task information, and writing the task information into the information table to be sent; determining the sending order according to the target generation time, and sending the task information in the information table to be sent according to the sending order. The technical solution of the embodiment of the present invention realizes the effect of orderly sending different Topic information when the Producer generates multiple different Topic messages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and medium for orderly sending information. Background Art

[0002] With the development of technology, a large number of Internet-related companies use distributed databases and distributed computing clusters to analyze business data and count keywords. Since storing a large amount of data in a database consumes a lot of memory, and directly storing a large amount of data in a hard disk will reduce work efficiency, message systems have emerged, especially distributed message systems.

[0003] Currently, Kafka is a distributed messaging system developed by LinkedIn to build real-time data pipelines and streaming applications. It is used by many companies due to its high level of scalability and high throughput. In the Kafka architecture, the Producer is responsible for sending messages to the Topic, and the Consumer can obtain historical messages through the offset. The Partition can ensure the order of messages in the Topic.

[0004] However, the order of messages within the same Topic can be guaranteed by specifying partitions, but when the Producer generates messages for multiple different Topics, the order between different Topics cannot be guaranteed. Summary of the invention

[0005] The present invention provides a method, device, equipment and medium for sending information in an orderly manner, so as to realize the orderliness of sending different Topic messages.

[0006] In a first aspect, an embodiment of the present invention provides a method for sending information in an orderly manner, which is applied to an information management system established based on Kafka, and the method includes:

[0007] Based on the characteristics of the task request and the task information flow, determining the time interval, pre-sending order and subject of the task information in the task information flow, wherein the task information includes the initial generation time;

[0008] If the topic corresponds to multiple different topic types, determining the target generation time of the task information based on the time interval, the pre-sending order and the initial generation time, and writing the task information into the to-be-sent information table;

[0009] The sending order is determined according to the target generation time, and the task information in the to-be-sent information table is sent according to the sending order.

[0010] In a second aspect, an embodiment of the present invention provides a device for sending information in an orderly manner, which is configured in an information management system established based on Kafka, and the device includes:

[0011] A subject determination module, used to determine the time interval, pre-sending order and subject of the task information in the task information flow based on the characteristics of the task request and the task information flow, wherein the task information includes the initial generation time;

[0012] An information writing module, for determining a target generation time of the task information based on the time interval, the pre-sending order and the initial generation time, and writing the task information into a table of information to be sent if the topic corresponds to a plurality of different topic types;

[0013] The information sending module is used to determine the sending order according to the target generation time, and send the task information in the to-be-sent information table according to the sending order.

[0014] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0015] at least one processor;

[0016] and a memory communicatively coupled to the at least one processor;

[0017] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the method for orderly sending information of the first aspect mentioned above.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement the method of orderly sending information according to the first aspect when executed.

[0019] The scheme for orderly sending information provided by the embodiment of the present invention determines the time interval, pre-sending order and subject of the task information in the task information flow based on the characteristics of the task request and the task information flow, wherein the task information includes the initial generation time, and if the subject corresponds to multiple different subject types, then based on the time interval, the pre-sending order and the initial generation time, the target generation time of the task information is determined, and the task information is written into the information table to be sent, the sending order is determined according to the target generation time, and the task information in the information table to be sent is sent according to the sending order. By adopting the above technical scheme, according to the characteristics of the task request and the task information flow, the time interval, pre-sending order and subject of the task information are determined, and then the target generation time of the task information of multiple different subject types is determined, and the task information is stored in the information table to be sent, and finally according to the order of the target generation time, the task information in the information table to be sent is sent, so that when the Producer generates multiple different Topic messages, the effect of orderly sending different Topic information is achieved.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 is a flowchart of a method for orderly sending information provided according to Embodiment 1 of the present invention;

[0023] Figure 2 is a flowchart of a method for orderly sending information provided according to Embodiment 2 of the present invention;

[0024] Figure 3 is a schematic diagram of the structure of a device for orderly sending information provided according to Embodiment 3 of the present invention;

[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In the description of the present invention, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are an "or" relationship. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1 A flowchart of a method for sending information in an orderly manner is provided for Embodiment 1 of the present invention. This embodiment is applicable to the situation of sending messages of different topics in an orderly manner. The method can be executed by a device for sending information in an orderly manner. The device for sending information in an orderly manner can be implemented in the form of hardware and / or software. The device for sending information in an orderly manner can be configured in an information management system established based on Kafka. The information management system can run in an electronic device. The electronic device can be composed of two or more physical entities or one physical entity.

[0030] like Figure 1 As shown, the method for orderly sending information provided by the first embodiment of the present invention specifically includes the following steps:

[0031] S101. Based on the characteristics of a task request and a task information flow, determine the time interval, pre-sending order and subject of the task information in the task information flow.

[0032] The task information includes the initial generation time.

[0033] In this embodiment, in the Kafka system, task information can be generated according to each task request. The time when the task information is generated is the initial generation time. If it is determined that multiple task information needs to be generated according to the task request, the interval time when sending the multiple task information, that is, the time interval, and the sending order, that is, the pre-sending order, can be pre-configured. For example, task information a and task information b are sent at an interval of 1s, and task information a is sent before task information b. When multiple task information are generated, a corresponding information flow can be formed. The subject of the task information can be determined according to the characteristics of the task information in the information flow. The characteristics of the task information can be the specific role of the task information, etc. For example, task information for changing a database table belongs to subject a, and task information for deleting a database table belongs to subject b. The task request can be determined according to the specific request or demand of the Consumer. The task information can include the initial generation time, key value, and task information body. The key value of the task information of the same task request is the same. The subjects of the multiple task information contained in the information flow can be the same or different. Whether they are the same can be determined by the characteristics of the task information, but the correspondence between the subject of the task information and the characteristics of the task information can be preset.

[0034] S102: If the topic corresponds to a plurality of different topic types, a target generation time of the task information is determined based on the time interval, the pre-sending order and the initial generation time, and the task information is written into a table of information to be sent.

[0035] In this embodiment, when the subjects of multiple task information included in the information flow are different, that is, the subject types are different, the initial generation time of all task information can be changed according to the time interval, pre-sending order and initial generation time, or the initial generation time of part of the task information can be changed to obtain the target generation time, so that the generation time of the task information that is ranked later in the pre-sending order is later. For example, if task information a is earlier than task information b in the pre-sending order, the initial generation time of a is not changed, but the target generation time of b is determined to be later than the initial generation time of a, and then all task information is written into the information to be sent table, wherein, when the initial generation time of multiple task information is the same, the difference between the initial generation time and the target generation time can be consistent with the value of the time interval, when the initial generation time of multiple task information is different, the difference between different target generation times can be consistent with the value of the time interval, and the initial sending time can be specifically expressed in the form of a few minutes. The subject types of the same subject are the same, and the information to be sent table can be expressed in the form of a list of information to be sent, or a collection of information to be sent, a group of information to be sent, and a library of information to be sent.

[0036] S103: Determine a sending order according to the target generation time, and send the task information in the to-be-sent information table according to the sending order.

[0037] In this embodiment, in the Kafka system, task information with an earlier generation time will be sent first. The task information in the information to be sent table can be sent in the order corresponding to the target generation time and / or initial generation time in the information to be sent table.

[0038] The method for orderly sending information provided by the embodiment of the present invention determines the pre-sending time of the task information in the task information flow and the subject of the task information based on the characteristics of the task request and the task information flow, wherein the task information contains the subject and the initial generation time of the task information, the pre-sending time is determined based on the initial generation time and time interval of the task information, the time interval is used to determine the time interval for sending the task information, if the subject corresponds to multiple different subject types, the task information corresponding to the subject is written into the information table to be sent, if the pre-sending time is different, the task information in the information table to be sent is sent based on the sequence of the pre-sending time. The technical solution of the embodiment of the present invention determines the time interval, pre-sending order and subject of the task information according to the characteristics of the task request and the task information flow, then determines the target generation time of the task information of multiple different subject types, and stores the task information in the information table to be sent, and finally sends the task information in the information table to be sent according to the sequence of the target generation time, so as to achieve the effect of orderly sending different Topic information when the Producer generates multiple different Topic messages.

[0039] Embodiment 2

[0040] Figure 2 This is a flowchart of a method for orderly sending information provided by Embodiment 2 of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions, and provides a method for orderly sending messages of different topics.

[0041] Optionally, determining the sending order according to the target generation time includes: determining a scanning interval of the information table to be sent, and scanning the information table to be sent once every scanning interval to determine the sending order of the task information in the information table to be sent, wherein the scanning interval is less than or equal to the time interval. The advantage of such a setting is that by setting a reasonable scanning time, it can be ensured that the task information in the information table to be sent is sent on time.

[0042] Optionally, the determining of the time interval, pre-sending order and subject of the task information in the task information flow based on the task request and the characteristics of the task information flow includes: determining the initial generation time, interval time and pre-sending order of each task information in the task information flow according to the task request, wherein the task information flow contains multiple task information; determining the subject of each task information in the task information flow according to the characteristics of each task information in the task information flow. The advantage of such a setting is that by determining the initial generation time, time interval, subject and pre-sending order of each task information, a guarantee is provided for the subsequent accurate sending of the task information.

[0043] Optionally, if the topic corresponds to multiple different topic types, then based on the time interval, the pre-sending order and the initial generation time, the target generation time of the task information is determined, and the task information is written into the information table to be sent, including: if the topic corresponds to multiple different topic types and the time interval is greater than zero, then according to the time interval of the task information and the pre-sending order, the first task information among the multiple task information is determined; based on the time interval, the initial generation time of the first task information is adjusted to obtain the target generation time; the first task information and the second task information are written into the information table to be sent, wherein the task information includes the first task information and the second task information, and the second task information is the task information corresponding to the generation time that has not been adjusted. The advantage of this setting is that, since in the Kafka system, the task information with an earlier generation time will be sent first, the sending order of the task information can be set by changing the initial generation time.

[0044] Optionally, after sending the task information in the to-be-sent information table, the method further includes: generating an actual sending time of the task information, deleting the task information from the to-be-sent information table, and adding the actual sending time and the task information to a sent history table. The advantage of such a setting is that, by comparing the pre-sent time of the task information with the actual sending time, it is possible to check whether the sending order of the task information satisfies the sending order corresponding to the pre-sent time.

[0045] like Figure 2 As shown, a method for orderly sending information provided by Embodiment 2 of the present invention specifically includes the following steps:

[0046] S201. Determine the initial generation time, time interval and pre-sending order of each task information in the task information flow according to the task request.

[0047] The task information flow includes multiple task information.

[0048] Specifically, the initial generation time, time interval, pre-sending order, key value, and information body of the task information can be configured according to business needs or Consumer's task request.

[0049] S202: Determine the subject of each task information in the task information flow according to the characteristics of each task information in the task information flow.

[0050] For example, if the characteristic of task information is to modify database table A in a storage area in the Kafka cluster, the task information can be determined as topic A; if the characteristic of task information is to modify database table B in a storage area in the Kafka cluster, the task information can be determined as topic B.

[0051] S203: If the topic corresponds to multiple different topic types and the time interval is greater than zero, determine the first task information among the multiple task information according to the time interval of the task information and the pre-sending order.

[0052] Specifically, the first task information may be task information that is ranked first in the pre-sending sequence, that is, after the task information that is sent first.

[0053] For example, if the time interval is one minute, the topic types of topic A and topic B are different, the initial generation time of topic A's task information is 8 a.m., the initial generation time of topic B's task information is also 8 a.m., and the pre-sending order is A before B, then the task information of topic B can be determined as the first task information.

[0054] S204: Adjust the initial generation time of the first task information based on the time interval to obtain a target generation time.

[0055] Specifically, the target generation time of the first task information may be determined to be a time later than the initial generation time of topic A by a time interval.

[0056] Optionally, adjusting the initial generation time of the first task information based on the time interval to obtain a target generation time includes: when the initial generation times of the multiple task information are the same, calculating the sum of the initial generation time of the first task information and the interval time to obtain the target generation time.

[0057] Exemplarily, as described in the above example, the initial time of the task information of subject B can be adjusted to 8:01 am.

[0058] Optionally, the initial generation time of the first task information is adjusted based on the time interval to obtain a target generation time, including: when the initial generation times of the multiple task information are different, the sum of the initial generation time of the second task information in the multiple task information and the interval time can be calculated to obtain the target generation time.

[0059] For example, if the time interval is 5 minutes, the initial generation time of the task information of topic A is 8:00 a.m., the initial generation time of the task information of topic B is 8:01 a.m., and the initial generation time of the task information of topic C is 8:02 a.m., and the pre-sending order is A before B, and B before C, then the task information of topics B and C can be determined as the first task information, and the task information of topic A can be determined as the second task information, then the target generation time of the task information of topics B and C are both 8:05.

[0060] S205: Write the first task information and the second task information into the information table to be sent.

[0061] The task information includes the first task information and the second task information, and the second task information is the task information corresponding to the generation time that has not been adjusted.

[0062] Exemplarily, as described in the above example, the task information of Topic A, Topic B and Topic C can be written into the table of information to be sent.

[0063] Optionally, if the topic corresponds to multiple different topic types and the time interval is zero, the task information of the topic is stored in the information table to be sent; when the initial generation time of the task information is the same, the task information in the information table to be sent is sent at the same time.

[0064] Exemplarily, if the time interval is zero, the task information of topic A and topic B can be directly written into the table of information to be sent. If the initial generation time of topic A and topic B is the same, the task information of topic A and topic B will be sent at the same time.

[0065] S206: Determine a scanning interval of the information to be sent table, and scan the information to be sent table once every scanning interval to determine a sending order of the task information in the information to be sent table.

[0066] Wherein, the scanning interval is less than or equal to the time interval.

[0067] Exemplarily, as described in the above example, if the time interval is 5 minutes, and the information table to be sent only contains task information of topics A, B and C, the scanning interval can be set to 5 minutes, that is, the information table to be sent is scanned every 5 minutes. Since the initial generation time of topic A is earlier than the target generation time of topics B and C, the sending order of the task information in the information table to be sent can be determined as follows: the task information of topic A is sent first, and then the task information of topic B and topic C are sent at the next scan, that is, 5 minutes later.

[0068] S207: Send the task information in the to-be-sent information table according to the sending order.

[0069] S208: Generate the actual sending time of the task information, delete the task information from the to-be-sent information table, and add the actual sending time and the task information to the sent history table.

[0070] Exemplarily, as described in the above example, after the task information of topic A is sent, the time corresponding to this sending will be determined as the actual sending time of the task information, and the task information of topic A will be deleted from the information to be sent table, and the actual sending time of the task information of topic A and the task information will be added to the sent history table.

[0071] The method for orderly sending information provided by the embodiment of the present invention determines the pre-sending order, initial generation time, time interval and topic of the task information according to the characteristics of the task request and the task information flow, and then updates the target generation time of the first task information and the second task information in the task information according to the pre-sending order and time interval, and then stores the first task information and the second task information in the information to be sent table, determines the scanning time interval of the information to be sent table, and finally sends the task information in the information to be sent table according to the sequence of the target generation time and / or the initial generation time in the information to be sent table. According to the pre-sending order and time interval of the task information, the sending order of the task information of different topics is reasonably determined. Based on the principle of sending data in the Kafka system, the initial generation time of the task information that needs to be sent later is increased in a targeted manner, so that when the Producer generates multiple different Topic messages, the effect of sending different Topic information in an orderly manner is achieved.

[0072] Embodiment 3

[0073] Figure 3 This is a schematic diagram of the structure of a device for orderly sending information provided by Embodiment 3 of the present invention. The device can be configured in an information management system established based on Kafka. Figure 3 As shown, the device includes: a topic determination module 301, an information writing module 302 and an information sending module 303, wherein:

[0074] A subject determination module, based on the characteristics of the task request and the task information flow, determines the time interval, pre-sending order and subject of the task information in the task information flow, wherein the task information includes an initial generation time;

[0075] An information writing module, for determining a target generation time of the task information based on the time interval, the pre-sending order and the initial generation time, and writing the task information into a table of information to be sent if the topic corresponds to a plurality of different topic types;

[0076] The information sending module is used to determine the sending order according to the target generation time, and send the task information in the to-be-sent information table according to the sending order.

[0077] The device for orderly sending information provided by an embodiment of the present invention determines the time interval, pre-sending order and subject of the task information according to the characteristics of the task request and the task information flow, then determines the target generation time of the task information of multiple different subject types, and stores the task information in the information table to be sent, and finally sends the task information in the information table to be sent according to the sequence of the target generation time, thereby achieving the effect of orderly sending different Topic information when the Producer generates multiple different Topic messages.

[0078] Optionally, the information sending module includes:

[0079] A scanning unit is used to determine a scanning interval of the information table to be sent, and scan the information table to be sent once every scanning interval to determine the sending order of task information in the information table to be sent, wherein the scanning interval is less than or equal to the time interval.

[0080] Optionally, the subject determination module includes:

[0081] A time determination unit, used to determine the initial generation time, interval time and pre-sending order of each task information in the task information flow according to the task request, wherein the task information flow includes multiple task information;

[0082] The subject determination unit is used to determine the subject of each task information in the task information flow according to the characteristics of each task information in the task information flow.

[0083] Optionally, the information writing module includes:

[0084] A first task information determining unit, configured to determine, if the topic corresponds to a plurality of different topic types and the time interval is greater than zero, the first task information among the plurality of task information according to the time interval of the task information and the pre-sending order;

[0085] a target generation time determination unit, configured to adjust the initial generation time of the first task information based on the time interval to obtain a target generation time;

[0086] An information writing unit is used to write the first task information and the second task information into the information table to be sent, wherein the task information includes the first task information and the second task information, and the second task information is the task information corresponding to the generation time without the adjustment.

[0087] Optionally, the information writing module also includes:

[0088] An information storage unit, used for storing the task information of the topic into a table of information to be sent if the topic corresponds to a plurality of different topic types and the time interval is zero;

[0089] The information sending unit is used to simultaneously send the task information in the to-be-sent information table when the initial generation time of the task information is the same.

[0090] Optionally, the device further comprises:

[0091] The sent history table updating module is used to generate the actual sending time of the task information after sending the task information in the to-be-sent information table, delete the task information from the to-be-sent information table, and add the actual sending time and the task information to the sent history table.

[0092] The step of adjusting the initial generation time of the first task information based on the time interval to obtain the target generation time includes: when the initial generation times of the multiple task information are the same, calculating the sum of the initial generation time of the first task information and the interval time to obtain the target generation time.

[0093] The device for orderly sending information provided by the embodiment of the present invention can execute the method for orderly sending information provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0094] Embodiment 4

[0095] Figure 4A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0096] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0097] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0098] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as a method for sending information in an orderly manner.

[0099] In some embodiments, the method of orderly sending information can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the method of orderly sending information described above can be performed. Alternatively, in other embodiments, the processor 41 can be configured to perform the method of orderly sending information by any other appropriate means (for example, by means of firmware).

[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0101] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0102] The computer device provided above can be used to execute the method for orderly sending information provided by any of the above embodiments, and has corresponding functions and beneficial effects.

[0103] Embodiment 5

[0104] In the context of the present invention, a computer-readable storage medium may be a tangible medium, wherein the computer-executable instructions, when executed by a computer processor, are used to perform a method for orderly sending information, the method comprising:

[0105] Based on the characteristics of the task request and the task information flow, determining the time interval, pre-sending order and subject of the task information in the task information flow, wherein the task information includes the initial generation time;

[0106] If the topic corresponds to multiple different topic types, determining the target generation time of the task information based on the time interval, the pre-sending order and the initial generation time, and writing the task information into the to-be-sent information table;

[0107] The sending order is determined according to the target generation time, and the task information in the to-be-sent information table is sent according to the sending order.

[0108] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by an instruction execution system, device or equipment or used with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0109] The computer device provided above can be used to execute the method for orderly sending information provided by any of the above embodiments, and has corresponding functions and beneficial effects.

[0110] It is worth noting that in the embodiment of the above-mentioned device for sending information in an orderly manner, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0111] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for sending information in an orderly manner, characterized in that: Applied to an information management system established based on Kafka, the method includes: Based on the characteristics of the task request and the task information flow, determining the time interval, pre-sending order and subject of the task information in the task information flow, wherein the task information includes the initial generation time; The topic corresponds to a plurality of different topic types, and based on the time interval, the pre-sending order and the initial generation time, the target generation time of the task information is determined, and the task information is written into the table of information to be sent; Determine a sending order according to the target generation time, and send the task information in the to-be-sent information table according to the sending order; Wherein, determining the sending order according to the target generation time includes: Determine a scanning time interval of the information table to be sent, and scan the information table to be sent once every scanning time interval to determine the sending order of task information in the information table to be sent, wherein the scanning time interval is less than or equal to the time interval.

2. The method according to claim 1, characterized in that The determining, based on the characteristics of the task request and the task information flow, the time interval, the pre-sending order and the subject of the task information in the task information flow comprises: Determine, according to the task request, the initial generation time, time interval and pre-sending order of each task information in the task information stream, wherein the task information stream includes multiple task information; According to the characteristics of each piece of task information in the task information flow, a subject of each piece of task information in the task information flow is determined.

3. The method according to claim 2, characterized in that The topic corresponds to a plurality of different topic types, and based on the time interval, the pre-sending order and the initial generation time, the target generation time of the task information is determined, and the task information is written into the to-be-sent information table, including: The topic corresponds to a plurality of different topic types and the time interval is greater than zero, and the first task information among the plurality of task information is determined according to the time interval of the task information and the pre-sending order; Adjusting the initial generation time of the first task information based on the time interval to obtain a target generation time; The first task information and the second task information are written into the to-be-sent information table, wherein the task information includes the first task information and the second task information, and the second task information is the task information corresponding to the generation time that has not been adjusted.

4. The method according to claim 3, characterized in that Also includes: The topic corresponds to a plurality of different topic types and the time interval is equal to zero, and the task information of the topic is stored in the table of information to be sent; When the initial generation time of the task information is the same, the task information in the to-be-sent information table is sent simultaneously.

5. The method according to claim 1, characterized in that After sending the task information in the to-be-sent information table, the method further includes: The actual sending time of the task information is generated, the task information is deleted from the to-be-sent information table, and the actual sending time and the task information are added to the sent history table.

6. The method according to claim 3, wherein adjusting the initial generation time of the first task information based on the time interval to obtain the target generation time comprises: When the initial generation time of the plurality of task information is the same, the sum of the initial generation time of the first task information and the time interval is calculated to obtain the target generation time.

7. A device for sending information in an orderly manner, characterized in that: The device is configured in an information management system based on Kafka, and includes: A subject determination module, used to determine the time interval, pre-sending order and subject of the task information in the task information flow based on the characteristics of the task request and the task information flow, wherein the task information includes the initial generation time; An information writing module, used for the topic corresponding to a plurality of different topic types, determining the target generation time of the task information based on the time interval, the pre-sending order and the initial generation time, and writing the task information into the to-be-sent information table; An information sending module, used to determine a sending order according to the target generation time, and send the task information in the to-be-sent information table according to the sending order; The information sending module includes a scanning unit; The scanning unit is used to determine the scanning interval of the information table to be sent, and scan the information table to be sent once every scanning interval to determine the sending order of the task information in the information table to be sent, wherein the scanning interval is less than or equal to the time interval.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for orderly sending information according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for orderly sending information according to any one of claims 1 to 6 when executed.

Citation Information

Patent Citations

  • Message processing method and device

    CN109788026A

  • Message transmission method and device and electronic equipment

    CN111031135A