A method and device for processing business data

By querying the data information of the business module in the task system, generating task messages and notifying the business module for processing through the message queue, paging and random time processing are used to solve the concurrency pressure problem of the task system when processing massive data and improve business data Processing efficiency and system availability.

CN111367688BActive Publication Date: 2024-10-18JINGDONG TECH HLDG CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202010131312.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-28
Publication Date
2024-10-18
Estimated Expiration
2040-02-28

AI Technical Summary

Technical Problem

When the task system regularly triggers the distributed business system to process massive business data, it causes excessive concurrency pressure on the business system and affects processing efficiency.

Method used

By querying the data information to be processed from the business module, task messages are generated and sent to the business module through the message queue to avoid centralized processing of large amounts of data. It uses paging processing and random time sending methods, combined with scheduled tasks and message queue retry mechanisms, to improve concurrency. processing power and data processing efficiency.

Benefits of technology

It improves the efficiency of business data processing, enhances the high concurrency and high availability capabilities of the system, and solves the problem of low business data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111367688B_ABST
    Figure CN111367688B_ABST
Patent Text Reader

Abstract

The present application relates to a method and device for processing business data, wherein the method comprises: querying data information of business data to be processed by the business module from the business module; generating a task message corresponding to the business data one by one according to the data information; sending the task message to the business module through a message queue, wherein the task message is used to instruct the business module to process the business data corresponding to the task message. The present application solves the technical problem of low processing efficiency of business data in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a method and device for processing business data. Background Art

[0002] Most task systems process massive amounts of data by processing their own task data, but some scenarios require the task system to regularly trigger the distributed business system, and the business system itself processes massive amounts of business data. The business system needs to ensure concurrent processing capabilities and the final correctness of the data. For example, some task systems need to regularly trigger the business system to process massive amounts of business data at the end of the month. The business system needs to ensure the concurrent processing capabilities of the business and the final correctness of the data.

[0003] The task system periodically notifies the distributed business system, and the business system processes the corresponding data until all the data is processed. In the process of implementing the present invention, the inventor found that such data is generally large in scale, which will cause excessive concurrency pressure on the business system and may affect normal business services. Therefore, it may lead to a decrease in the processing efficiency of business data.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The present application provides a method and device for processing business data, so as to at least solve the technical problem of low efficiency in processing business data in related technologies.

[0006] According to one aspect of an embodiment of the present application, a method for processing business data is provided, including:

[0007] Querying data information of business data to be processed by the business module from the business module;

[0008] Generate a task message corresponding to the business data one by one according to the data information;

[0009] The task message is sent to the service module through a message queue, wherein the task message is used to instruct the service module to process the service data corresponding to the task message.

[0010] Optionally, the data information includes the total amount of the business data, wherein generating the task message corresponding to the business data one by one according to the data information includes:

[0011] Dividing the total amount of data into multiple paging data amounts;

[0012] Creating a plurality of paging tasks corresponding to the plurality of paging data volumes one by one;

[0013] The task message corresponding to the business data of each paging data volume is generated by each paging task corresponding to each paging data volume in the multiple paging tasks.

[0014] Optionally, generating the task message corresponding to the business data of each paging data volume through each paging task corresponding to each paging data volume in the multiple paging tasks includes:

[0015] Sending a query request to the business module through each paging task, wherein the query request is used to request data information of the business data of each paging data volume;

[0016] Receiving the data information returned by the business module in response to the query request;

[0017] By using the data information to create an atomic task for each piece of data in the business data of each piece of data, each paging task corresponding to each paging task is obtained, wherein the atomic task is used to indicate a task for processing each piece of data;

[0018] The task message corresponding to each of the atomic tasks is generated through each of the paging tasks, wherein the task message is used to indicate processing of each of the atomic tasks.

[0019] Optionally, sending the task message to the business module through a message queue includes:

[0020] Sending the task message to the message queue;

[0021] The task message is forwarded to the service module through the message queue.

[0022] Optionally, forwarding the task message to the business module through the message queue includes:

[0023] The task message is randomly sent to the business module through the message queue within a target time period.

[0024] Optionally, querying the business module for data information of business data to be processed by the business module includes:

[0025] Execute a scheduled task at a target time interval, wherein the scheduled task is used to drive the task module to notify the service module to process service data according to the target time interval;

[0026] In response to the scheduled task, the business module is queried for the total amount of the business data.

[0027] Optionally, after sending the task message to the business module through a message queue, the method further includes:

[0028] Detecting the sending result of the task message and the processing result of the task message returned by the business module through the message queue;

[0029] When the sending result indicates that the task message fails to be sent, or when the processing result indicates that the task message fails to be processed, the task message is resent to the business module through the message queue.

[0030] According to another aspect of an embodiment of the present application, a device for processing business data is also provided, including:

[0031] A query module, used to query data information of business data to be processed by the business module from the business module;

[0032] A generating module, used for generating a task message corresponding to the business data one by one according to the data information;

[0033] The first sending module is used to send the task message to the business module through a message queue, wherein the task message is used to instruct the business module to process the business data corresponding to the task message.

[0034] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above method is executed when the program is run.

[0035] According to another aspect of an embodiment of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above method through the computer program.

[0036] In an embodiment of the present application, data information of business data to be processed by the business module is queried from the business module; a task message corresponding to the business data is generated according to the data information; and the task message is sent to the business module through a message queue, wherein the task message is used to indicate the way in which the business module processes the business data corresponding to the task message. When it is necessary to notify the business module to process the business data, data information of the business data to be processed by the business module is queried from the business module, a task message is generated according to the data information, and the task message is notified to the business module through the message queue, thereby avoiding the situation where the business module needs to concentrate on processing a large amount of business data within a certain period of time, thereby achieving the purpose of improving the high concurrency and high availability capabilities of the service, thereby achieving the technical effect of improving the processing efficiency of business data, and then solving the technical problem of low processing efficiency of business data in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 is a schematic diagram of a hardware environment of a method for processing business data according to an embodiment of the present application;

[0040] Figure 2 is a flowchart of an optional method for processing business data according to an embodiment of the present application;

[0041] Figure 3 is a schematic diagram of a process of processing business data according to an optional embodiment of the present application;

[0042] Figure 4 is a schematic diagram of an optional device for processing business data according to an embodiment of the present application;

[0043] as well as

[0044] Figure 5 It is a structural block diagram of a terminal according to an embodiment of the present application. DETAILED DESCRIPTION

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

[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. 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 comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0047] According to one aspect of an embodiment of the present application, a method embodiment for processing business data is provided.

[0048] Optionally, in this embodiment, the above-mentioned method for processing business data can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 103 shown in FIG. Figure 1 As shown, the server 103 is connected to the terminal 101 through a network, and can be used to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 103. The above network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, etc. The method for processing the business data of the embodiment of the present application can be executed by the server 103, or by the terminal 101, or by the server 103 and the terminal 101. Among them, the terminal 101 executes the method for processing the business data of the embodiment of the present application, which can also be executed by the client installed thereon.

[0049] Figure 2 is a flowchart of an optional method for processing business data according to an embodiment of the present application, such as Figure 2 As shown, the method may include the following steps:

[0050] Step S202, querying data information of business data to be processed by the business module from the business module;

[0051] Step S204, generating a task message corresponding to the business data one by one according to the data information;

[0052] Step S206: Send the task message to the service module through a message queue, wherein the task message is used to instruct the service module to process the service data corresponding to the task message.

[0053] Through the above steps S202 to S206, when it is necessary to notify the business module to process the business data, the data information of the business data to be processed by the business module is queried from the business module, a task message is generated according to the data information, and the task message is notified to the business module through the message queue, thereby avoiding the situation where the business module needs to concentrate on processing a large amount of business data within a certain period of time, achieving the purpose of improving the high concurrency and high availability capabilities of the service, thereby achieving the technical effect of improving the processing efficiency of business data, and further solving the technical problem of low processing efficiency of business data in related technologies.

[0054] Optionally, in this embodiment, the above-mentioned method for processing business data may be, but is not limited to, executed by a task module (also referred to as a task system). The above-mentioned business module may also be referred to as a business system. The above-mentioned method for processing business data may be, but is not limited to, applied to a scenario where a task module is required to notify a business module to process business data.

[0055] In the technical solution provided in step S202, the above-mentioned task modules and business modules can be but are not limited to task modules and business modules in applications with various functions, such as: online education applications, instant messaging applications, community space applications, game applications, shopping applications, browser applications, financial applications, multimedia applications, live broadcast applications, etc.

[0056] As an optional embodiment, the data information includes the total amount of the business data, wherein generating the task message corresponding to the business data one by one according to the data information includes:

[0057] S11, dividing the total amount of data into multiple paging data amounts;

[0058] S12, creating a plurality of paging tasks corresponding to the plurality of paging data volumes one by one;

[0059] S13: Generate the task message corresponding to the business data of each paging data volume through each paging task corresponding to each paging data volume in the multiple paging tasks.

[0060] Optionally, in this embodiment, the data information may include but is not limited to the total amount of business data, that is, the acquired data information may be the amount of data that the business module needs to process. Then, paging is performed according to the amount of data, and the paging method is not limited, such as even division, division according to a certain ratio, or random division, or an AI model that can automatically perform quantity division can be obtained through training model to divide the paging data amount.

[0061] For example, if 10,000 records are found and divided into 10 pages, each page will contain 1,000 records.

[0062] Optionally, in this embodiment, a paging task is created for each of the multiple paging data volumes to process the paging data volume. Each paging task is used to generate a task message corresponding to the business data of the paging data volume that the paging task is responsible for.

[0063] As an optional embodiment, generating the task message corresponding to the business data of each paging data volume through each paging task corresponding to each paging data volume in the multiple paging tasks includes:

[0064] S21, sending a query request to the business module through each paging task, wherein the query request is used to request data information of the business data of each paging data volume;

[0065] S22, receiving the data information returned by the business module in response to the query request;

[0066] S23, using the data information to create an atomic task for each piece of data in the business data of each paging data volume by each paging task, to obtain an atomic task for each paging data volume corresponding to each paging task, wherein the atomic task is used to indicate a task for processing each piece of data;

[0067] S24, generating the task message corresponding to each of the atomic tasks through each of the paging tasks, wherein the task message is used to indicate processing of each of the atomic tasks.

[0068] Optionally, in this embodiment, each paging task queries the business module for details of each data it is responsible for (ie, data information), uses the data information to generate an atomic task, and generates a task message for notifying a message queue.

[0069] In the above embodiment, for the 10 generated paging tasks, each paging task will query the task details. For example, each paging task queries 1000 items and generates 1000 atomic tasks. Ten paging tasks will generate 10*1000 atomic tasks, and finally there will be a total of 10,000 atomic tasks.

[0070] As an optional embodiment, sending the task message to the business module through a message queue includes:

[0071] S31, sending the task message to the message queue;

[0072] S32: forwarding the task message to the business module through the message queue.

[0073] Optionally, in this embodiment, the task message may be forwarded by a message queue.

[0074] Optionally, in this embodiment, the message queue may not be limited to the MQ mechanism. MQ is a distributed asynchronous message queue that achieves peak shaving and current limiting through asynchronous notification. The sender converts the request data into json and persists it in the MQ queue. The MQ middleware then sends the queue data to the recipient who subscribes to the message. After receiving the notification, the recipient parses the queue data for business processing.

[0075] The advantages of using the MQ mechanism in this embodiment are: first, asynchronization, which can ensure high throughput of the task system, without synchronously waiting for the business system processing results, and quickly respond to batch task processing. Second, the automatic retry mechanism of MQ can ensure that the business system instance can automatically retry when an exception occurs when processing asynchronous requests.

[0076] Optionally, in this embodiment, when a single task processes data, the synchronous call to the business system is adjusted to message notification, so that the task thread execution efficiency is higher, the task processing throughput is improved, and the retry is guaranteed by the message, while solving the single point problem of the business system.

[0077] As an optional embodiment, forwarding the task message to the business module through the message queue includes:

[0078] S41, randomly sending the task message to the business module within a target time period through the message queue.

[0079] Optionally, in this embodiment, the message sending can be processed randomly, so that the business module receives 10,000 message notifications within a certain period of time and then processes them. Distributed tasks and random time methods are used to process, and the previous centralized time processing is weakened to time-sharing processing, avoiding concurrency problems in a short period of time.

[0080] Optionally, in this embodiment, the task system queries the total amount of data in the business system, divides the data into pages according to the total amount, and uses a combination of distributed tasks and random time processing to generate distributed paging tasks and corresponding atomic tasks, thereby improving the concurrent processing capabilities of tasks and effectively controlling the concurrent processing volume of the business system through random time.

[0081] As an optional embodiment, querying the data information of the business data to be processed by the business module from the business module includes:

[0082] S51, executing a scheduled task at a target time interval, wherein the scheduled task is used to drive the task module to notify the business module to process business data according to the target time interval;

[0083] S52, in response to the scheduled task, querying the business module for the total amount of the business data.

[0084] Optionally, in this embodiment, when the task module is processing a task, the scheduled task can drive the task module to notify the business module to process business data. The target time interval for executing the scheduled task can be but is not limited to one week, one month, one quarter, half a year, one year, etc.

[0085] As an optional embodiment, after sending the task message to the business module through the message queue, the method further includes:

[0086] S61, detecting, through the message queue, the sending result of the task message and the processing result of the task message returned by the business module;

[0087] S62, when the sending result indicates that the task message fails to be sent, or when the processing result indicates that the task message fails to be processed, resending the task message to the business module through the message queue.

[0088] Optionally, in this embodiment, the message queue is used to monitor whether the task message is sent successfully or processed successfully. If it is not sent successfully or processed successfully, the retry mechanism of the message queue can be triggered to resend the task message, thereby greatly improving the success rate of task data processing through the retry mechanism.

[0089] The present application also provides an optional embodiment, which provides a way for a task system to notify a business system to process business data. Figure 3 is a schematic diagram of a business data processing process according to an optional embodiment of the present application, such as Figure 3As shown, there are two services, one is the task service (equivalent to the above task module), and the other is the basic law service. The basic law service is equivalent to a business service (equivalent to the above business module). When processing tasks, the task service is driven by the scheduled task and generates an initial task at a fixed time. This initial task can be notified in the form of MQ messages. After sending the message, it will query the total data of the business system. For example, if 10,000 pieces of data are found, a paging distributed task can be applied through sharding. Assuming that 10,000 pieces of data are divided into 1000 pieces, they are divided into ten paging tasks. For these ten paging tasks, each paging task will query the details of the task. For example, each paging task queries 1000 pieces and generates 1000 atomic tasks. 10 paging tasks will generate 10*1000 atomic tasks, and finally there are a total of 10,000 atomic tasks. When the atomic task is executed, it notifies the business system in the form of MQ. After the business system receives the message, it processes the task. The system can randomly process the message sending, so that the business system receives 10,000 message notifications within a certain period of time and then processes them.

[0090] For most tasks, the timer-driven task is that the task system sends a message to the business system at a fixed time, and the business system completes the task by itself; the business system can use the sharding mechanism to complete the task, that is, when notified, the business system will execute the task in shards according to the sharding situation of its own machine until all data processing is completed. However, there is a problem with this solution, that is, when the system executes the task, the concurrency pressure at a certain execution time point will be very large, which will affect its normal business services, and when executing through sharding technology, it is possible that a single machine server cannot guarantee the correct execution of the data in the end, and the processing may fail or the service may crash. This requires abnormal monitoring and retry mechanisms to ensure the final correctness, and this design method will be more complicated.

[0091] In this optional embodiment, a task processing method of a message-driven paging mode is adopted. When the task system performs a timed trigger task, it does not directly tell the business system the data that needs to be processed, but first queries the business system to query the total amount of data it needs to process, and then divides the total amount of data into N small amounts of data based on the total amount of data. For the divided data, distributed tasks and random time are used to process it, weakening the previous centralized time processing to time-sharing processing, avoiding concurrency problems in a short time.

[0092] For each paging task, it will generate its own distributed paging task and corresponding atomic task. For example, 1 million data can be paginated in units of 10,000 data and divided into 100 paging tasks. In this way, each paging task only needs to care about the 10,000 data on the page it is on, which can improve the task concurrent processing capability. The 1 million data are not processed serially or according to the sharding of the business system. Instead, the task system first divides the 1 million data into 100 paging tasks, and each paging task processes 10,000 data.

[0093] On the basis of this paging, message-driven can be added. For the 10,000 atomic tasks generated by the paging task, each atomic task does not synchronize the business system when processing data, because it takes a long time to synchronize the business system. Assuming that the duration of the data processing of an atomic task is one minute, each call needs to maintain one minute. When the number of atomic tasks is large, the call duration will be very long, which may cause the number of links in the business system to be exhausted. The method adopted in this optional embodiment is to process by message. When each atomic task is executed, it only needs to send a message notification. Through the message-driven business system, the business system monitors this message to process, which is equivalent to changing a synchronous process to an asynchronous method of message notification. This method can make the execution efficiency of the task thread of the task system higher, because the time consuming of sending a message is extremely short compared to the call that maintains one minute, so that the task system can continue to send other messages with the saved time.

[0094] At the same time, through the message method, each business system can retry failed tasks, because after a machine hears a message, the message may be consumed by the machine itself or by other machines. If the machine has an abnormality and cannot provide services, the message will be processed and consumed by other machines. There will be no single point problem.

[0095] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0097] According to another aspect of an embodiment of the present application, a business data processing device for implementing the above-mentioned business data processing method is also provided. Figure 4 is a schematic diagram of an optional service data processing device according to an embodiment of the present application, such as Figure 4 As shown, the device may include:

[0098] A query module 42, used to query data information of business data to be processed by the business module from the business module;

[0099] A generating module 44, configured to generate a task message corresponding to the business data in a one-to-one manner according to the data information;

[0100] The first sending module 46 is used to send the task message to the service module through a message queue, wherein the task message is used to instruct the service module to process the service data corresponding to the task message.

[0101] It should be noted that the query module 42 in this embodiment can be used to execute step S202 in the embodiment of the present application, the generation module 44 in this embodiment can be used to execute step S204 in the embodiment of the present application, and the first sending module 46 in this embodiment can be used to execute step S206 in the embodiment of the present application.

[0102] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware.

[0103] Through the above-mentioned module, when it is necessary to notify the business module to process the business data, the data information of the business data to be processed by the business module is queried from the business module, a task message is generated according to the data information, and the task message is notified to the business module through the message queue, thereby avoiding the situation where the business module needs to concentrate on processing a large amount of business data within a certain period of time, achieving the purpose of improving the high concurrency and high availability capabilities of the service, thereby achieving the technical effect of improving the processing efficiency of business data, and then solving the technical problem of low processing efficiency of business data in related technologies.

[0104] As an optional embodiment, the data information includes the total amount of the business data, wherein the generating module includes:

[0105] A division unit, used for dividing the total amount of data into a plurality of paging data amounts;

[0106] A creating unit, used for creating a plurality of paging tasks corresponding to the plurality of paging data volumes one by one;

[0107] A generating unit is used to generate the task message corresponding to the business data of each paging data volume through each paging task corresponding to each paging data volume in the multiple paging tasks.

[0108] As an optional embodiment, the generating unit is used for:

[0109] Sending a query request to the business module through each paging task, wherein the query request is used to request data information of the business data of each paging data volume;

[0110] Receiving the data information returned by the business module in response to the query request;

[0111] By using the data information to create an atomic task for each piece of data in the business data of each piece of data, each paging task corresponding to each paging task is obtained, wherein the atomic task is used to indicate a task for processing each piece of data;

[0112] The task message corresponding to each of the atomic tasks is generated through each of the paging tasks, wherein the task message is used to indicate processing of each of the atomic tasks.

[0113] As an optional embodiment, the first sending module includes:

[0114] A sending unit, used for sending the task message to the message queue;

[0115] A forwarding unit is used to forward the task message to the service module through the message queue.

[0116] As an optional embodiment, the forwarding unit is used for:

[0117] The task message is randomly sent to the business module through the message queue within a target time period.

[0118] As an optional embodiment, the query module is used to:

[0119] Execute a scheduled task at a target time interval, wherein the scheduled task is used to drive the task module to notify the service module to process service data according to the target time interval;

[0120] In response to the scheduled task, the business module is queried for the total amount of the business data.

[0121] As an optional embodiment, the device further includes:

[0122] A detection module, used for detecting, through the message queue, a sending result of the task message and a processing result of the task message returned by the business module after the task message is sent to the business module through the message queue;

[0123] The second sending module is used to resend the task message to the business module through the message queue when the sending result indicates that the task message fails to be sent, or the processing result indicates that the task message fails to be processed.

[0124] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.

[0125] According to another aspect of the embodiments of the present application, a server or terminal for implementing the above-mentioned () method is also provided.

[0126] Figure 5 is a structural block diagram of a terminal according to an embodiment of the present application, such as Figure 5 As shown, the terminal may include: one or more (only one is shown in the figure) processors 501, a memory 503, and a transmission device 505, such as Figure 5 As shown, the terminal may also include an input and output device 507.

[0127] Among them, the memory 503 can be used to store software programs and modules, such as program instructions / modules corresponding to the processing method and device of business data in the embodiment of the present application, and the processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 503, that is, realizing the above-mentioned processing method of business data. The memory 503 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 503 may further include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0128] The above-mentioned transmission device 505 is used to receive or send data via a network, and can also be used for data transmission between a processor and a memory. The above-mentioned network specific examples may include wired networks and wireless networks. In one example, the transmission device 505 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 505 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.

[0129] Specifically, the memory 503 is used to store application programs.

[0130] The processor 501 may call the application stored in the memory 503 through the transmission device 505 to perform the following steps:

[0131] S1, querying data information of business data to be processed by the business module from the business module;

[0132] S2, generating a task message corresponding to the business data one by one according to the data information;

[0133] S3, sending the task message to the service module through a message queue, wherein the task message is used to instruct the service module to process the service data corresponding to the task message.

[0134] By adopting the embodiment of the present application, a solution for processing business data is provided. When it is necessary to notify the business module to process the business data, the data information of the business data to be processed by the business module is queried from the business module, a task message is generated according to the data information, and the task message is notified to the business module through the message queue, thereby avoiding the situation where the business module needs to concentrate on processing a large amount of business data within a certain period of time, achieving the purpose of improving the high concurrency and high availability capabilities of the service, thereby achieving the technical effect of improving the processing efficiency of business data, and then solving the technical problem of low processing efficiency of business data in related technologies.

[0135] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0136] It can be understood by those skilled in the art that Figure 5 The structure shown is for illustration only, and the terminal may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 5 It does not limit the structure of the above electronic device. For example, the terminal may also include Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations shown.

[0137] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0138] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to execute the program code of the method for processing business data.

[0139] Optionally, in this embodiment, the storage medium may be located on at least one network device among a plurality of network devices in the network shown in the above embodiment.

[0140] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0141] S1, querying data information of business data to be processed by the business module from the business module;

[0142] S2, generating a task message corresponding to the business data one by one according to the data information;

[0143] S3, sending the task message to the service module through a message queue, wherein the task message is used to instruct the service module to process the service data corresponding to the task message.

[0144] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0145] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0146] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0147] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0148] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0149] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0151] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0152] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing business data, It is characterized in that include: Querying data information of business data to be processed by the business module from the business module; The data information includes the total amount of the business data; Divide the total amount of data in the data information into a plurality of paging data amounts, and generate a task message corresponding to the business data of each paging data amount; Sending the task message to a message queue, and randomly sending it to the business module through the message queue within a target time period, wherein the task message is used to instruct the business module to process the business data corresponding to the task message; The message queue uses the MQ mechanism to send the task message to the business module through asynchronous notification; Wherein, randomly sending the task messages to the service module through the message queue within a target time period includes: the service module receives a plurality of the task messages within a certain time period; Among them, querying data information of business data to be processed by the business module from the business module includes: executing a scheduled task at each target time interval, wherein the scheduled task is used to drive the task module to notify the business module to process the business data according to the target time interval; in response to the scheduled task, querying the business module for the total amount of data of the business data.

2. The method according to claim 1, It is characterized in that Also includes: Creating a plurality of paging tasks corresponding to the plurality of paging data volumes one by one; The generating of the task message corresponding to the business data of each paging data volume includes: generating the task message corresponding to the business data of each paging data volume through each paging task corresponding to each paging data volume in the plurality of paging tasks.

3. The method according to claim 2, It is characterized in that Generating a task message corresponding to the business data of each paging data volume through each paging task corresponding to each paging data volume in the multiple paging tasks includes: Sending a query request to the business module through each paging task, wherein the query request is used to request data information of the business data of each paging data volume; Receiving the data information returned by the business module in response to the query request; By using the data information to create an atomic task for each piece of data in the business data of each piece of data, each paging task corresponding to each paging task is obtained, wherein the atomic task is used to indicate a task for processing each piece of data; A task message corresponding to each of the atomic tasks is generated through each of the paging tasks, wherein the task message is used to indicate processing of each of the atomic tasks.

4. The method according to claim 1, It is characterized in that After sending the task message to the business module through the message queue, the method further includes: Detecting the sending result of the task message and the processing result of the task message returned by the business module through the message queue; When the sending result indicates that the task message fails to be sent, or when the processing result indicates that the task message fails to be processed, the task message is resent to the business module through the message queue.

5. A device for processing business data, It is characterized in that include: A query module, used to query data information of business data to be processed by the business module from the business module; The data information includes the total amount of the business data; A generating module, used for dividing the total amount of data in the data information into a plurality of paging data amounts, and generating a task message corresponding to the business data of each paging data amount; A first sending module, used for sending the task message to a message queue, and randomly sending the task message to the service module through the message queue within a target time period, wherein the task message is used to instruct the service module to process the service data corresponding to the task message; The message queue uses the MQ mechanism to send the task message to the business module through asynchronous notification; Wherein, randomly sending the task messages to the service module through the message queue within a target time period includes: the service module receives a plurality of the task messages within a certain time period; Among them, querying data information of business data to be processed by the business module from the business module includes: executing a scheduled task at each target time interval, wherein the scheduled task is used to drive the task module to notify the business module to process the business data according to the target time interval; in response to the scheduled task, querying the business module for the total amount of data of the business data.

6. A storage medium, It is characterized in that The storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 4 when executed.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that The processor executes the method described in any one of claims 1 to 4 through the computer program.

Citation Information

Patent Citations

  • Method and device for sending Web service message

    CN103595812A

  • Batch task processing method and system

    CN108536532A

  • High-concurrency data processing method, device and client server

    CN109344172A

  • Message-based distributed task distribution scheduling method and device

    CN110659123A