Data consumption method and device
By identifying and distributing backlog data in the message queue and dynamically splitting the message queue, the data backlog problem is solved, and data processing efficiency and system performance are improved.
Patent Information
- Application Number
- CN202411252116.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-31
AI Technical Summary
When processing large-scale business data, the prior art leads to a backlog of data in the message queue, reducing data processing efficiency and system performance.
By writing the received service data to the first message queue, the identification of the backlog data is determined, and distributed to the second or third message queue according to the consumption timestamp information, dynamic splitting of the message queue is realized to avoid data backlog.
It improves data processing efficiency, improves system performance and response speed, and solves the problem of data backlog in message queues.
Smart Images

Figure CN119226001A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data consumption method and device. Background Art
[0002] In the data technology architecture, different businesses have different business data volumes and data processing efficiency requirements. When the business data volume is large or the data processing efficiency requirements are high, the existing technology methods cannot consume data efficiently, which will lead to data backlogs in the message queue, reduce data processing efficiency, and affect the performance and response speed of the system. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure at least provide a data consumption method, device, electronic device and storage medium, which can solve the problem of data backlog in the message queue, improve data processing efficiency, and thus improve the performance and response speed of the system.
[0004] In a first aspect, an embodiment of the present disclosure provides a data consumption method, including:
[0005] Writing the received business data into the first message queue;
[0006] Determine the data identifier of the business data accumulated in the first message queue;
[0007] The business data with the data identifier in the first message queue is distributed to the second message queue.
[0008] Optionally, before distributing the service data with the data identifier in the first message queue to the second message queue, the method further includes:
[0009] Determine a second message queue consumption interval of the second message queue according to consumption timestamp information of the service data in the second message queue, and determine that the second message queue consumption interval is less than a first threshold;
[0010] In response to the second message queue consumption interval being greater than or equal to the first threshold, the business data with the data identifier in the first message queue is distributed to the third message queue.
[0011] Optionally, after determining the data identifier of the service data backlogged in the first message queue, the method further includes:
[0012] Determine the first message queue consumption interval according to the consumption timestamp information of the business data in the first message queue;
[0013] In response to the first message queue consumption interval being greater than or equal to a second threshold, writing the received business data with the data identifier into the second message queue;
[0014] In response to the first message queue consumption interval being less than the second threshold, the received business data with the data identifier is written into the first message queue.
[0015] Optionally, after determining the data identifier of the service data backlogged in the first message queue, the method further includes:
[0016] The business data without data identifier in the first message queue is distributed to the third message queue.
[0017] Optionally, after determining the data identifier of the service data backlogged in the first message queue, the method further includes:
[0018] Determine the first message queue consumption interval according to the consumption timestamp information of the business data in the first message queue;
[0019] In response to the first message queue consumption interval being greater than or equal to a third threshold, writing the received service data without a data identifier into a third message queue;
[0020] In response to the first message queue consumption interval being less than a third threshold, the received business data without a data identifier is written into the first message queue.
[0021] Optionally, the method further comprises:
[0022] In response to the priority of the received service data being a preset priority, the service data of the preset priority is written into the fourth message queue.
[0023] In a second aspect, an embodiment of the present disclosure provides a data consumption device, including:
[0024] A writing module, used for writing the received business data into the first message queue;
[0025] A determination module, used to determine the data identifier of the business data backlog in the first message queue;
[0026] The distribution module is used to distribute the business data with data identifiers in the first message queue to the second message queue.
[0027] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the above-mentioned first aspect, or the steps in any optional implementation of the first aspect are performed.
[0028] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect, or any optional implementation of the first aspect are executed.
[0029] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the method of any of the above embodiments when executed by a processor.
[0030] In any one of the above aspects or any implementation of any one of the aspects, the received business data is written into the first message queue; the data identifier of the business data accumulated in the first message queue is determined; and the business data with the data identifier in the first message queue is distributed to the second message queue. In this way, when a data backlog problem occurs in the message queue, the backlogged business data can be distributed from the current message queue to the new message queue, thereby realizing dynamic splitting of the message queue, improving data processing efficiency, and thus improving system performance and response speed.
[0031] The effects of the above-mentioned data consumption device, electronic device and storage medium refer to the description of the above-mentioned data consumption method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0033] Figure 1 A flow chart of a data consumption method provided by an embodiment of the present disclosure is shown;
[0034] Figure 2 A schematic diagram of a message queue in a technical architecture in a data consumption method provided by an embodiment of the present disclosure is shown;
[0035] Figure 3 A schematic diagram showing a message queue state change in a technical architecture in a data consumption method provided by an embodiment of the present disclosure is shown;
[0036] Figure 4 A schematic diagram of a data consumption device provided by an embodiment of the present disclosure is shown;
[0037] Figure 5An exemplary system architecture is shown in which embodiments of the present disclosure may be applied;
[0038] Figure 6 A schematic diagram of the structure of a computer system of a terminal device or a server used to implement an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0040] It should be noted that in the technical solution of the present invention, the collection, use, storage, sharing and transfer of user personal information involved are in compliance with the provisions of relevant laws and regulations, and it is necessary to inform the user and obtain the user's consent or authorization. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted.
[0041] The raising of the above problems and the solutions are the results obtained by the inventor after practice and careful research. The discovery process of the above problems and the solutions proposed for the above problems should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0042] The technical solutions in the present disclosure will be clearly and completely described below in conjunction with the drawings in the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0043] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0044] To facilitate understanding of this embodiment, a data consumption method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the data consumption method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the data consumption method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0045] See also Figure 1 FIG. 1 is a flowchart of a data consumption method provided by an embodiment of the present disclosure, and the method includes S101 to S103, wherein:
[0046] S101: Writing received business data into a first message queue.
[0047] In the embodiments of the present disclosure, the technical architecture may include multiple message queues, where different message queues may perform different functions. Figure 2 FIG. 1 is a schematic diagram of a message queue in a technical architecture in a data consumption method provided by an embodiment of the present disclosure. Figure 2 As shown, the first message queue can be the main queue in the current technical architecture. When the system receives business data, it can be written into the first message queue for subsequent data consumption; and Figure 2 The second message queue and the third message queue are transit queues, which can be used to temporarily store and forward data during the data transmission process.
[0048] It should be noted that the above description of each message queue is only a possible implementation in the embodiment of the present disclosure and does not constitute an improper limitation of the present invention. Each message queue mentioned above can be a separate message queue or a collection of message queues with the same function.
[0049] In the embodiments of the present disclosure, since there are differences in the priorities of different business data, in order to give priority to those business data with higher priorities, one or more message queues can be separately set up in the technical architecture to process these business data with higher priorities. This ensures that these business data can be processed in a timely manner and are not interfered with by other business data. By writing them into a separate message queue, complete isolation from other business data is achieved. Specifically, the method also includes: in response to the priority of the received business data being a preset priority, writing the business data with the preset priority into a fourth message queue.
[0050] In a specific implementation, priorities can be set in advance for different types of business data. For example, in the current technical architecture, three types of business data will be received, which come from tenant 1, tenant 2 and tenant 3 respectively; corresponding priorities can be set in advance for each type of business data, for example, the priority of tenant 1 can be set to level T0, and the priorities of tenants 2 and tenant 3 can be set to level T1. The preset priority indicates the priority of the business data that needs to be prioritized. Assuming that the preset priority is level T0, before writing the three types of received business data into the first message queue, it can be determined that the business data of tenant 1 is data of the preset priority, and it is written into the fourth message queue for separate priority processing. Assuming that the preset priority is level T1, only the business data of tenants 2 and tenant 3 can be separately prioritized according to demand, or business data higher than level T1 and level T1 itself can be separately prioritized, that is, the data of tenants 1, tenants 2 and tenants 3 are written into the fourth message queue. It should be noted that if the business data of the preset priority includes multiple types of data, it can be put into a priority queue (that is, the fourth message queue), or it can be put into different priority queues according to the type of business data, that is, the number of the fourth message queue can be one or more.
[0051] After the business data of preset priority is placed in the fourth message queue, the remaining non-preset priority data can be written into the first message queue. It should be noted that in the embodiment of the present disclosure, each business data will only be written into one message queue, for example, the business data of preset priority that has been written into the fourth message queue will no longer be written into the first message queue.
[0052] In another possible implementation, in addition to determining high-priority business data by comparing the priority of the business data with the preset priority, the business data may be parsed upon receipt, and high-priority business data may be determined based on the parsing results and placed in a fourth message queue. The disclosed embodiment does not specifically limit the scheme for determining high-priority data.
[0053] It should be noted that the above-mentioned different sources of business data as the classification dimension of business data is only used as an example of a possible implementation method in the embodiment of the present disclosure. In actual applications, any dimension such as business urgency, data processing complexity, dependency between business data and degree of data change can also be used as the classification dimension of business data. The embodiment of the present disclosure does not make any specific limitation on this, and the ability to realize its functions shall prevail.
[0054] S102: Determine the data identifier of the backlogged business data in the first message queue.
[0055] When the amount of business data used and the consumption speed can meet the data processing efficiency requirements of the business data, the business data can be consumed from the first message queue according to the conventional method.
[0056] When there is a backlog of business data in the first message queue, the data identifier of the backlog of business data can be determined first. The backlog of business data here can refer to business data with a surge in data volume within a certain period, or it can refer to business data in the first message queue whose business data volume exceeds a preset threshold. When determining whether there is data with a surge in business data volume in the first message queue, it can be determined by monitoring the timestamp information and the amount of data written to each type of business data in the first message queue; it can also be determined by any other feasible method, which is not specifically limited in the embodiments of the present disclosure.
[0057] In the embodiments of the present disclosure, data identifiers can be used to identify the categories of business data. For example, if the backlogged data in the first message queue is the business data of tenant 3, then the identification information corresponding to tenant 3 can be used as the data identifier of the backlogged business data; if the backlogged data in the first message queue is business data in JSON format, then the identification information corresponding to JSON can be used as the data identifier of the backlogged business data. It should be noted that the above-mentioned division of business data categories is only used as an example of a possible implementation method in the embodiments of the present disclosure, and does not constitute an improper limitation of the present invention.
[0058] In an embodiment of the present disclosure, after determining the data identifier of the backlog of business data in the first message queue, the method also includes: determining the consumption interval of the first message queue based on the consumption timestamp information of the business data in the first message queue; in response to the consumption interval of the first message queue being greater than or equal to a second threshold, writing the received business data with the data identifier into the second message queue; in response to the consumption interval of the first message queue being less than the second threshold, writing the received business data with the data identifier into the first message queue.
[0059] In a specific implementation, the consumption timestamp information of the business data in the above-mentioned first message queue refers to the timestamp of consuming the business data from the first message queue. According to the timestamp information, the consumption interval of the first message queue can be determined. When the consumption interval is greater than or equal to the preset threshold, it indicates that the backlog of business data in the first message queue has been successfully transferred out. At this time, the newly received business data with data identification can be directly written into the second message queue; when the consumption interval is less than the preset threshold, it indicates that the second message queue is still continuously consuming business data with business identification from the first message queue. In order to ensure that the business data can be consumed in sequence, the business data with data identification can be written into the first message queue first, and then the business data with data identification in the first message queue can be distributed to the second message queue, thereby ensuring the orderly consumption of business data and improving the processing efficiency of business data. It should be noted that the above-mentioned second threshold can be set according to actual needs, for example, it can be set to 5 seconds, 8 seconds, 1 minute, etc., and the embodiments of the present disclosure do not make specific limitations on this.
[0060] It should be noted that when determining the consumption interval of the first message queue for the first time based on the consumption timestamp information, a default timestamp can be preset, and the consumption interval of the first message queue can be determined based on the default timestamp and the consumption timestamp recorded for the first time. When determining the subsequent consumption interval of the first message queue, a new consumption interval can be obtained based on the consumption timestamp of the last record and the consumption timestamp of the current record. Regarding the setting of the above-mentioned default timestamp, it can be set to 0, or it can be set to a minimum value, so that when judging the consumption interval of the first message queue according to the second threshold, the accuracy of the judgment can be guaranteed.
[0061] In an embodiment of the present disclosure, after determining the data identifier of the backlog of business data in the first message queue, the method also includes: determining the consumption interval of the first message queue based on the consumption timestamp information of the business data in the first message queue; in response to the consumption interval of the first message queue being greater than or equal to a third threshold, writing the received business data without data identifier into the third message queue; in response to the consumption interval of the first message queue being less than the third threshold, writing the received business data without data identifier into the first message queue.
[0062] Similarly, by monitoring the consumption timestamp information of the first message queue, the timestamp information of transferring the business data without data identification in the first message queue to the third message queue can be determined, and the consumption interval of the third message queue consuming the business data without data identification from the first message queue can be calculated based on the timestamp information. When the consumption interval is greater than or equal to the third threshold, it indicates that the business data without data identification in the first message queue has been completely transferred to the third message queue. At this time, when new business data is received, the business data without data identification can be directly written into the third message queue; when the consumption interval is less than the preset threshold, it indicates that the third message queue is still continuously consuming the business data without data identification from the first message queue. In order to ensure the orderly consumption of business data, the received business data without data identification can be written into the first message queue, and then the business data without data identification in the first message queue can be transferred to the third message queue. The specific implementation method this time is similar to the method described above: "determining the consumption interval of the first message queue according to the consumption timestamp information of the business data in the first message queue; in response to the consumption interval of the first message queue being greater than or equal to the second threshold, writing the received business data with data identifier into the second message queue; in response to the consumption interval of the first message queue being less than the second threshold, writing the received business data with data identifier into the first message queue", and will not be repeated here.
[0063] S103: Distribute the business data with the data identifier in the first message queue to the second message queue.
[0064] In this step, after determining the data identifier of the backlog of business data in the first message queue, the business data with the data identifier in the current first message queue can be distributed to the second message queue. At the same time, the first message queue is also constantly writing new business data, and the business data with the above data identifier in these newly written business data can also be distributed to the second message queue.
[0065] Figure 3 A schematic diagram of a message queue state change in a technical architecture in a data consumption method provided in an embodiment of the present disclosure. Figure 3 As shown, when there is a backlog of business data in the first message queue, the queue state of the first message queue can be changed from a main message queue to a distribution queue. At this time, the second message queue can be used as a temporary queue to consume business data with data identifiers from the first message queue, thereby realizing the transfer of the backlog of business data, so that the backlog of business data can be written into a separate message queue for subsequent consumption steps, solving the problem of data backlog in a single message queue.
[0066] In a possible implementation, after determining the data identifier of the service data accumulated in the first message queue, the method further includes: distributing the service data without the data identifier in the first message queue to the third message queue.
[0067] In a specific implementation, the business data in the first message queue includes business data with the above data identifiers and business data without the above data identifiers. If only the business data with the data identifiers is distributed to the second message queue, while the business data without the data identifiers is kept in the first message queue for consumption, then the first message queue must not only continuously write new business data, but also simultaneously realize the distribution of business data with data identifiers and the subsequent consumption of business data without data identifiers, which will undoubtedly increase the load of the first message queue and may affect the efficiency of data consumption. Figure 3 As shown, in order to solve this problem, the business data without data identification in the first message queue can be distributed to the third message queue, so that the third message queue is used as the new main queue for subsequent data consumption. This realizes the splitting of the business data in the first message queue, further solves the data backlog problem in the message queue, improves data processing efficiency, and thus improves the performance and response speed of the system.
[0068] In an embodiment of the present disclosure, before distributing the business data with data identifiers in the first message queue to the second message queue, it also includes: determining the second message queue consumption interval of the second message queue based on the consumption timestamp information of the business data in the second message queue, and determining that the second message queue consumption interval is less than the first threshold; in response to the second message queue consumption interval being greater than or equal to the first threshold, distributing the business data with data identifiers in the first message queue to the third message queue.
[0069] In a specific implementation, based on the above steps, the backlog of business data has been successfully split from the first message queue to the second message queue. In this process, the consumption timestamp information of the business data in the second message queue can be recorded, and the consumption interval of the second message queue can be determined based on the consumption timestamp information. The consumption timestamp information here refers to the time when the business data with data identification is consumed from the second message queue. It should be noted that when the consumption interval of the second message queue is determined for the first time according to the consumption timestamp information, a default timestamp can be preset, and the consumption interval of the second message queue can be determined based on the default timestamp and the consumption timestamp recorded for the first time. When determining the subsequent consumption interval of the second message queue, the new consumption interval can be obtained based on the consumption timestamp of the last record and the consumption timestamp of the current record. Regarding the setting of the above-mentioned default timestamp, it can be set to 0, or it can be set to a minimum value, so that when the consumption interval of the second message queue is judged according to the first threshold, the accuracy of the judgment can be guaranteed.
[0070] In a specific implementation, when the consumption interval of the second message queue is less than the first threshold, it indicates that the business data with data identifiers in the second message queue is still being consumed, that is, the backlog of data has not been completely processed. At this time, the business data with data identifiers in the first message queue can be transferred to the second message queue for consumption. Figure 3 As shown, when the consumption interval of the second message queue is greater than or equal to the preset threshold, it indicates that the business data with data identification transferred to the second message queue has been processed, that is, the backlog of business data has been processed. At this time, you can stop transferring new data to the second message queue and directly write the business data to the third message queue. In this way, it is possible to process business data with data identification only in the second message queue, and after the business data with data identification is processed, the third message queue assumes the main queue function of the original first message queue, realizing the dynamic splitting of the message queue, improving the data processing efficiency, and thus improving the performance and response speed of the system.
[0071] According to a second aspect of the embodiment of the present disclosure, Figure 4 As shown, a data consumption device 400 is provided, comprising:
[0072] The writing module 401 is used to write the received service data into the first message queue;
[0073] A determination module 402 is used to determine a data identifier of the business data accumulated in the first message queue;
[0074] The distribution module 403 is used to distribute the business data with the data identifier in the first message queue to the second message queue.
[0075] Optionally, the distribution module 403 is further used for:
[0076] Determine a second message queue consumption interval of the second message queue according to consumption timestamp information of the service data in the second message queue, and determine that the second message queue consumption interval is less than a first threshold;
[0077] In response to the second message queue consumption interval being greater than or equal to the first threshold, the business data with the data identifier in the first message queue is distributed to the third message queue.
[0078] Optionally, the determination module 402 is further configured to:
[0079] Determine the first message queue consumption interval according to the consumption timestamp information of the business data in the first message queue;
[0080] In response to the first message queue consumption interval being greater than or equal to a second threshold, writing the received business data with the data identifier into the second message queue;
[0081] In response to the first message queue consumption interval being less than the second threshold, the received business data with the data identifier is written into the first message queue.
[0082] Optionally, the determination module 402 is further configured to:
[0083] The business data without data identifier in the first message queue is distributed to the third message queue.
[0084] Optionally, the determination module 402 is further configured to:
[0085] Determine the first message queue consumption interval according to the consumption timestamp information of the business data in the first message queue;
[0086] In response to the first message queue consumption interval being greater than or equal to a third threshold, writing the received service data without a data identifier into a third message queue;
[0087] In response to the first message queue consumption interval being less than a third threshold, the received business data without a data identifier is written into the first message queue.
[0088] Optionally, the writing module 401 is further used for:
[0089] In response to the priority of the received service data being a preset priority, the service data of the preset priority is written into the fourth message queue.
[0090] According to the third aspect of an embodiment of the present disclosure, there is provided an electronic device for data consumption, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided by the first aspect of the embodiment of the present invention.
[0091] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present disclosure is implemented.
[0092] According to a fifth aspect of an embodiment of the present invention, there is provided a computer program product, including a computer program, which implements the method of any of the above embodiments when executed by a processor.
[0093] Figure 5 An exemplary system architecture 500 to which the data consumption method or data consumption device implemented by the present disclosure can be applied is shown.
[0094] like Figure 5As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0095] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0096] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0097] The server 505 may be a server that provides various services, such as a background management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 501, 502, and 503. The background management server may process the received data consumption request and feed back the processing result (only an example) to the terminal device.
[0098] It should be noted that the data consumption method provided in the embodiment of the present invention is generally executed by the server 505, and accordingly, the data consumption device is generally set in the server 505. The data consumption method provided in the embodiment of the present invention can also be executed by the terminal devices 501, 502, 503, and accordingly, the data consumption device can be set in the terminal devices 501, 502, 503.
[0099] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0100] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0101] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0102] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0103] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0104] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0105] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0106] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, a processor includes a writing module, a determining module, and a distributing module, wherein the names of these modules do not constitute a limitation on the modules themselves in certain circumstances. For example, the writing module may also be described as "writing the received business data into the first message queue module".
[0107] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device implements the following method: writing received business data into a first message queue; determining the data identifier of the business data backlogged in the first message queue; distributing the business data with the data identifier in the first message queue to a second message queue.
[0108] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A data consumption method, characterized in that: include: Writing the received business data into the first message queue; Determine the data identifier of the business data accumulated in the first message queue; The business data having the data identifier in the first message queue is distributed to the second message queue.
2. The method according to claim 1, characterized in that Before distributing the service data having the data identifier in the first message queue to the second message queue, the method further includes: Determine a second message queue consumption interval of the second message queue according to consumption timestamp information of the service data in the second message queue, and determine that the second message queue consumption interval is less than a first threshold; In response to the second message queue consumption interval being greater than or equal to a first threshold, the business data with the data identifier in the first message queue is distributed to a third message queue.
3. The method according to claim 1, characterized in that After determining the data identifier of the service data accumulated in the first message queue, the method further includes: Determine the first message queue consumption interval according to the consumption timestamp information of the business data in the first message queue; In response to the first message queue consumption interval being greater than or equal to a second threshold, writing the received business data having the data identifier into the second message queue; In response to the first message queue consumption interval being less than a second threshold, the received business data having the data identifier is written into the first message queue.
4. The method according to claim 1, characterized in that: After determining the data identifier of the service data accumulated in the first message queue, the method further includes: The business data not having the data identifier in the first message queue is distributed to the third message queue.
5. The method according to claim 4, characterized in that After determining the data identifier of the service data accumulated in the first message queue, the method further includes: Determine the first message queue consumption interval according to the consumption timestamp information of the business data in the first message queue; In response to the first message queue consumption interval being greater than or equal to a second threshold, writing the received service data without the data identifier into the third message queue; In response to the first message queue consumption interval being less than a second threshold, the received business data without the data identifier is written into the first message queue.
6. The method according to claim 1, characterized in that The method further comprises: In response to the priority of the received service data being a preset priority, the service data of the preset priority is written into a fourth message queue.
7. A data consumption device, characterized in that: include: A writing module, used for writing the received business data into the first message queue; A determination module, used to determine the data identifier of the business data backlog in the first message queue; A distribution module is used to distribute the business data with the data identifier in the first message queue to the second message queue.
8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
