Order data processing method and device

CN113781133BActive Publication Date: 2025-03-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010574918.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-22
Publication Date
2025-03-18
Estimated Expiration
2040-06-22

AI Technical Summary

Technical Problem

In the prior art, order data processing is poor in time and low in efficiency, and cannot display the current order data information in real time, and the monitoring effect is poor.

Method used

The real-time message information in the consumption order is stored in the cache, and the identifier generated according to the real-time message information is placed in the cache queue; the real-time message information data in the memory is batch written into the database according to the preset time interval set by the cache; the queue in the cache is queried through the earliest preset number of identifiers that have been entered in the queue, and then statistically processed with the preset minimum time granularity and stored in the database.

Benefits of technology

Real-time processing and display of order data is realized, supports multi-dimensional query on the same period, supports multi-platform display of PC and mobile terminals, and supports customized alarm settings, improving monitoring effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113781133B_ABST
    Figure CN113781133B_ABST
Patent Text Reader

Abstract

The present invention discloses an order data processing method and device, and relates to the field of computer technology. A specific implementation of the method includes storing real-time message information of consumer orders in a cache, and placing an identifier generated according to the real-time message information of the order into a queue in the cache; batch-writing the real-time message information data of the order in the memory into a database according to a preset time interval set by the cache; querying the queue in the cache through a scheduled task, looping through the earliest preset number of identifiers entering the queue, and then performing statistical processing with a preset minimum time granularity and storing them in the database. Therefore, the implementation of the present invention can solve the problems of poor timeliness and low efficiency of existing order data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an order data processing method and device. Background Art

[0002] With the rapid development of Internet technology, e-commerce has penetrated into every aspect of our lives and has had a profound impact on society. People's daily lives are inseparable from e-commerce, and orders in e-commerce occupy an absolutely core position. It directly shows whether the daily operation of the entire company is normal and whether the revenue is healthy. It plays an important guiding role in the company's strategic formulation and even determines the company's survival. Therefore, the display, monitoring and alarm of order quantity have become the most important things for the company.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] The acquisition, statistics, display and detection of order quantity data are generally obtained directly through scripts or commands, and the order data will eventually be persisted to the hard disk or database. In addition, the database quantity data information is queried through code programs for statistics, which cannot display the current order data information in real time. It needs to be queried on a daily or monthly basis, and displayed in non-intuitive ways such as report statistics, curve charts, bar charts, and pie charts. In addition, the alarm part is generally missing or the report data is manually checked to detect and judge whether the order quantity is normal, which is time-consuming and labor-intensive, and the monitoring effect is poor. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides an order data processing method and device, which can solve the problems of poor timeliness and low efficiency of existing order data processing.

[0006] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, there is provided an order data processing method, including storing real-time message information of consumption orders in a cache, and placing an identifier generated according to the real-time message information of the order into a queue in the cache; batch writing the real-time message information data of the order in the memory into a database according to a preset time interval set by the cache; querying the queue in the cache through a scheduled task, cyclically traversing the earliest preset number of identifiers entering the queue, and then performing statistical processing at a preset minimum time granularity and storing them in the database.

[0007] Optionally, an identifier is generated according to the real-time message information of the order, including:

[0008] Get the data and time of each dimension in the real-time order message information, combine them into second-level or minute-level identifiers according to the preset dimensions, and put them into the queue in the cache.

[0009] Optionally, it also includes:

[0010] Receive a query request, obtain a query time period in the request, and determine whether the query time period is consistent with a storage time period set in the current cache;

[0011] If so, the statistical processing results in the cache are returned; if not, the database is queried and a cache corresponding to the query time period is constructed for statistical processing.

[0012] Optionally, after performing statistical processing at a preset minimum time granularity, the method further includes:

[0013] By comparing the statistical processing result at the current time point with the statistical processing result at the same time point on a preset day, if the comparison result meets the preset threshold, the alarm program is activated.

[0014] Optionally, after the alarm procedure is initiated, it includes:

[0015] Alert the target alarm group through the preset notification method.

[0016] Optionally, after statistical processing is performed at a preset minimum time granularity and stored in a database, the following steps are included:

[0017] Obtain corresponding statistical processing results based on business requests and display them on the front-end page.

[0018] In addition, the present invention also provides an order data processing device, including an acquisition module, which is used to store the real-time message information of the consumption order in a cache, and put the identifier generated according to the real-time message information of the order into a queue in the cache;

[0019] The processing module is used to write the real-time order message information data in the memory into the database in batches according to the preset time interval set by the cache; query the queue in the cache through the scheduled task, loop through the earliest preset number of identifiers entering the queue, and then perform statistical processing with the preset minimum time granularity and store them in the database.

[0020] Optionally, the processing module is further used to:

[0021] Receive a query request, obtain a query time period in the request, and determine whether the query time period is consistent with a storage time period set in the current cache;

[0022] If so, the statistical processing results in the cache are returned; if not, the database is queried and a cache corresponding to the query time period is constructed for statistical processing.

[0023] One embodiment of the above invention has the following advantages or beneficial effects: because the real-time message information of the consumption order is stored in the cache, and the identifier generated according to the real-time message information of the order is placed in the queue in the cache; the real-time message information data of the order in the memory is written into the database in batches according to the preset time interval set by the cache; the queue in the cache is queried through the scheduled task, the earliest preset number of identifiers in the queue are looped, and then statistical processing is performed with the preset minimum time granularity and stored in the database, so the technical problem of poor timeliness and low efficiency of existing order data processing is overcome. Thus, the technical effect of consuming, parsing, counting, storing and displaying the real-time data messages of the order is realized, which can achieve real-time and intuitive display by order type, support multi-dimensional query of the same period, year-on-year and historical, support PC and mobile multi-platform display and support customized alarm setting.

[0024] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0026] Figure 1 is a schematic diagram of the main flow of the order data processing method according to the first embodiment of the present invention;

[0027] Figure 2 is a schematic diagram of the main flow of the order data processing method according to the second embodiment of the present invention;

[0028] Figure 3 is a schematic diagram of the main flow of the order data processing method according to the third embodiment of the present invention;

[0029] Figure 4 is a schematic diagram of the architecture of the order data processing method according to the present invention;

[0030] Figure 5 is a schematic diagram of main modules of an order data processing device according to an embodiment of the present invention;

[0031] Figure 6 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0032] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0034] Figure 1 FIG. 1 is a schematic diagram of the main flow of the order data processing method according to the first embodiment of the present invention. Figure 1 As shown, the order data processing method includes:

[0035] Step S101, the consumption order real-time message information is stored in a cache, and an identifier generated according to the order real-time message information is placed in a queue in the cache.

[0036] In some embodiments, the real-time order message may be a MQ message sent after a user successfully places an order. The message content includes user information, shopping information, platform channel information, order type, order time and other information. It is a comprehensive user order information.

[0037] A preferred embodiment consumes real-time order message information, parses it to distinguish order types, and then stores it in Guava Cache according to minute and second dimensions. Among them, Guava Cache provides cache recovery methods based on capacity, time and reference. The capacity-based method uses the LRU algorithm internally, and the reference-based recovery makes good use of the garbage collection mechanism of the Java virtual machine. The cache constructor CacheBuilder uses the builder pattern to provide a cache object with various parameters set. The internal class Segment in the cache core class LocalCache inherits from ReetrantLock, and there are six queues to achieve a rich local cache solution.

[0038] As other embodiments, the specific implementation process of generating an identifier according to the real-time order message information includes:

[0039] Get the data and time of each dimension in the real-time order message information, combine them into a second-level or minute-level identifier according to the preset dimensions and put them into the queue in the cache. For example: according to the data and time of each dimension in the message, combine them into a second-level or minute-level key (i.e. identifier) ​​and put them into the queue. There can be many combined dimensions, such as:

[0040] Order Type 1_20200409161830 means: Order Type 1 generates an order at 16:18:30 on April 9, 2020

[0041] Platform 1_Channel 1_202004091618 means: Channel 1 of Platform 1 generated an order at 16:18 on April 9, 2020

[0042] Step S102, write the order real-time message information data in the memory into the database in batches according to the preset time interval set by the cache; query the queue in the cache through a scheduled task, loop through the earliest preset number of identifiers entering the queue, and then perform statistical processing with a preset minimum time granularity and store them in the database.

[0043] In some embodiments, according to the setting of Guava Cache, the order real-time message information data in the memory is batch-written into Redis every 500ms, that is, it is first accumulated in Redis, such as the order volume of the same order type at the same time, and the accumulated data can be used for real-time data display on the front-end page. Among them, Redis (full name: Remote DictionaryServer Remote Dictionary Service) is an open source log-type, Key-Value database written in ANSI C language, supporting the network, memory-based and persistent, and provides APIs in multiple languages.

[0044] In addition, it is worth noting that by querying the key queue in the cache through the scheduled task, the earliest preset number (for example, 1000) keys in the queue are looped and traversed to query the specific real-time order message information data, and the real-time order message information data is statistically processed and stored in the database with a preset minimum time granularity, for example, with minutes as the minimum granularity for statistics, persistence, and storage in the MySQL database. MySQL is a relational database management system.

[0045] For example: according to the key of each dimension combination of order real-time message information data, cumulative statistics are performed (different order real-time messages, but the spelled keys may be the same), and then stored in the database, and the current and two-day data are stored in the memory. For example, the result of the accumulation of key (order type 1_20200409161830) is the order volume generated by order type 1 at 20200409161830. By analyzing 20200409161830, the full-day order volume and hourly order volume of order type 1 can also be obtained. In addition, different time dimensions (such as: order type 1) can be selected: year-on-year and month-on-month by day, hour, minute or second. In other words, the embodiment of the present invention supports querying the statistical data of order real-time message information data by 1 minute, 5 minutes, 10 minutes, 30 minutes, 60 minutes, week, month, and specified time period.

[0046] At the same time, the present invention can directly display data curves (such as data curves of today and yesterday) according to statistical processing results, and supports adding data curves of specified dates for comparison.

[0047] As some other embodiments, after statistical processing is performed with a preset minimum time granularity, the statistical processing result at the current time point can be compared with the statistical processing result at the same time point on a preset day. If the comparison result is monitored to meet a preset threshold, the alarm program is initiated.

[0048] It should be noted that the embodiment of the present invention supports personalized setting of alarm thresholds for different orders, for example, different alarm thresholds can be set according to different order types. In addition, the present invention supports monitoring of order types at the second level.

[0049] In addition, you can set the alarm program to be turned on or off. You can also set the alarm permission application and allocation, that is, you can allocate alarm monitoring permissions to different objects.

[0050] It is worth noting that the present invention can also determine whether preset alarm conditions are met by judging the trend of N consecutive points of data in a preset time period, such as a steep drop alarm and an order drop to zero alarm.

[0051] In a further embodiment, after the alarm program is started, the present invention can send an alarm to the target alarm group through a preset notification method. For example, the present invention sets an alarm group through different mailboxes and mobile phones, and sends an alarm through email and SMS when the alarm threshold is reached.

[0052] In addition, in the embodiment of the present invention, a voice alarm can be set, for example, a voice alarm is performed in a manner supported by a browser's own component. Preferably, the present invention supports voice alarms at ten levels, such as 10%, 20%, and 50%.

[0053] As some further embodiments, a query request is received, a query time period in the request is obtained, and it is determined whether the query time period is consistent with a storage time period set in the current cache; if so, the statistical processing results in the cache are returned; if not, the database is queried and a cache corresponding to the query time period is constructed for statistical processing.

[0054] For example, you can query the data and trends of each order type in real time through PC and mobile phone. The current data and data within two days can be directly queried in cache, and historical data can be queried in database. After the historical data is queried, a cache will be built to improve the response speed of the next query.

[0055] It is also worth noting that different order views are supported. Specifically, the present invention can view statistical processing results according to different types.

[0056] In summary, the order data processing method proposed in the present invention solves the problem that the existing order data display monitoring and alarm methods cannot be real-time, effective, intuitive, multi-dimensional, multi-platform, multi-mode statistical display, query and customized alarm setting methods. That is, the present invention consumes, analyzes, counts, stores and displays real-time order data messages through a program, which can achieve real-time and intuitive display by order type, support multi-dimensional query of the same period month-on-month, year-on-year and historical, support PC and mobile terminal multi-platform display and support customized alarm setting.

[0057] Figure 2 : is a schematic diagram of the main flow of the order data processing method according to the second embodiment of the present invention. The order data processing method may include:

[0058] Step S201, the real-time message information of the consumption order is stored in the cache.

[0059] Step S202, obtaining the data and time of each dimension in the real-time message information of the order, combining them into a second-level or minute-level identifier according to the preset dimension combination and putting them into the queue in the cache.

[0060] Step S203, writing the order real-time message information data in the memory into the database in batches according to the preset time interval set by the cache.

[0061] Step S204, querying the queue in the cache through the scheduled task, looping through the preset number of identifiers that entered the queue the earliest, and then performing statistical processing with a preset minimum time granularity and storing them in the database.

[0062] Step S205 , by comparing the statistical processing result at the current time point with the statistical processing result at the same time point on a preset day, if it is detected that the comparison result meets the preset threshold, the alarm program is started.

[0063] In some embodiments, an alarm is sent to a target alarm group via a preset notification method.

[0064] Figure 3 : is a schematic diagram of the main flow of the order data processing method according to the third embodiment of the present invention. The order data processing method may include:

[0065] Step S301, the real-time message information of the consumption order is stored in the cache.

[0066] Step S302, obtaining the data and time of each dimension in the real-time message information of the order, combining them into a second-level or minute-level identifier according to the preset dimension combination and putting them into the queue in the cache.

[0067] Step S303, writing the order real-time message information data in the memory into the database in batches according to the preset time interval set by the cache.

[0068] Step S304, querying the queue in the cache through the scheduled task, looping through the preset number of identifiers that entered the queue the earliest, and then performing statistical processing with a preset minimum time granularity.

[0069] Step S305, receiving a query request, obtaining a query time period in the request, and determining whether the query time period is consistent with a storage time period set in the current cache. If so, proceed to step S306, otherwise proceed to step S307.

[0070] Step S306, returning the statistical processing result in the cache.

[0071] Step S307, query the database and build a cache corresponding to the query time period for statistical processing.

[0072] Figure 4 : This is a schematic diagram of the architecture of the order data processing method according to the present invention. The present invention is provided with the ability to perform statistics, display, monitoring alarm and second-level monitoring on order data. In addition, the processing results of statistics, display, monitoring alarm and second-level monitoring and order real-time message information data can be written into Redis. Among them, a configuration service (TPconfig) can be provided for Redis. Of course, the order real-time message information data and processing results can also be persistently stored in a MySQL database.

[0073] Furthermore, when the order data is counted, it is necessary to consume the real-time message information of the order, parse it to distinguish the order type, and then store it in Guava Cache according to the minute and second dimensions. According to the setting of Guava Cache, the real-time message information data of the order in the memory is written to Redis in batches every 500ms. Through the scheduled task query key queue in the cache (preferably, JMQ message middleware can be used to perform statistical processing on the keys in the queue), the earliest preset number of keys (for example, 1000) in the queue are looped through, and the specific real-time message information data of the order is queried, and the real-time message information data of the order is counted and persisted with the minimum granularity of minutes, and stored in the MySQL database. Among them, the real-time message information data of the order for statistical counting can be processed in advance through the order decompression and error interface.

[0074] In addition, when displaying order data, the statistical results obtained according to business needs can be displayed on the web. That is, the corresponding statistical processing results are obtained according to the business request and displayed on the front-end page.

[0075] In addition, when monitoring and alarming, the real-time order message information data can be verified first (preferably, the JMQ message middleware can be used to verify the real-time order message information data) to determine whether the alarm conditions are met. When it is determined that the alarm conditions are met, different alarm interfaces can be called according to business needs to perform alarm procedures, such as: SMS interface, traffic light interface, commodity cashback interface, commodity promotion library interface, commodity promotion information interface, etc. Among them, the commodity cashback interface, commodity promotion library interface, and commodity promotion information interface can be regarded as some commodity activities that need to be carried out when the real-time order message information data meets the alarm conditions, and the traffic light interface can be regarded as the control of the monitoring switch of the commodity when the real-time order message information data meets the alarm conditions.

[0076] Figure 5 is a schematic diagram of the main modules of the order data processing device according to an embodiment of the present invention. Figure 5 As shown, the order data processing device 500 includes an acquisition module 501 and a processing module 502. The acquisition module 501 stores the real-time message information of the consumption order in the cache, and puts the identifier generated according to the real-time message information of the order into the queue in the cache; the processing module 502 writes the real-time message information data of the order in the memory into the database in batches according to the preset time interval set by the cache; through the scheduled task querying the queue in the cache, the earliest preset number of identifiers entering the queue are looped through, and then statistical processing is performed at the preset minimum time granularity and stored in the database.

[0077] In some embodiments, the acquisition module 501 generates an identifier according to the order real-time message information, including:

[0078] Get the data and time of each dimension in the real-time order message information, combine them into second-level or minute-level identifiers according to the preset dimensions, and put them into the queue in the cache.

[0079] In some embodiments, the processing module 502 is further configured to:

[0080] Receive a query request, obtain a query time period in the request, and determine whether the query time period is consistent with a storage time period set in the current cache;

[0081] If so, the statistical processing results in the cache are returned; if not, the database is queried and a cache corresponding to the query time period is constructed for statistical processing.

[0082] In some embodiments, after the processing module 502 performs statistical processing at a preset minimum time granularity, it further includes:

[0083] By comparing the statistical processing result at the current time point with the statistical processing result at the same time point on a preset day, if the comparison result meets the preset threshold, the alarm program is activated.

[0084] In some embodiments, after the processing module 502 starts the alarm procedure, it includes:

[0085] Alert the target alarm group through the preset notification method.

[0086] In some embodiments, after the processing module 502 performs statistical processing at a preset minimum time granularity and stores the statistics in a database, it includes:

[0087] Obtain corresponding statistical processing results based on business requests and display them on the front-end page.

[0088] It should be noted that the order data processing method and the order data processing device described in the present invention have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.

[0089] Figure 6 An exemplary system architecture 600 is shown to which the order data processing method or order data processing device according to the embodiment of the present invention can be applied.

[0090] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0091] Users can use terminal devices 601, 602, and 603 to interact with server 605 through network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0092] The terminal devices 601 , 602 , and 603 may be various electronic devices having an order data processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0093] The server 605 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 601, 602, and 603. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0094] It should be noted that the order data processing method provided in the embodiment of the present invention is generally executed by the server 605 , and accordingly, the computing device is generally arranged in the server 605 .

[0095] It should be understood that Figure 6 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.

[0096] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present invention. Figure 7 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.

[0097] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0098] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal order data processor (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0099] 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 includes a 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 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0100] 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.

[0101] 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.

[0102] 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, it may be described as: a processor includes an acquisition module and a processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0103] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes storing real-time message information of consumption orders in a cache, and placing the identifier generated according to the real-time message information of the order into a queue in the cache; writing the real-time message information data of the order in the memory into the database in batches according to the preset time interval set by the cache; querying the queue in the cache through a scheduled task, looping through the earliest preset number of identifiers entering the queue, and then performing statistical processing at a preset minimum time granularity and storing them in the database.

[0104] The technical solution according to the embodiment of the present invention can solve the problems of poor timeliness and low efficiency in existing order data processing.

[0105] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for processing order data, characterized in that: include: The real-time message information of the consumption order is stored in the cache, and the identifier generated by the preset dimension combination according to the dimension data and time in the real-time message information of the order is put into the queue in the cache; Write the order real-time message information data in memory into the database in batches according to the preset time interval set by the cache; The queues in the cache are queried through a scheduled task, and the earliest preset number of identifiers entering the queue are looped through, and then statistical processing is performed with a preset minimum time granularity and stored in the database.

2. The method according to claim 1, characterized in that Generate an identifier based on the real-time order message information, including: Get the data and time of each dimension in the real-time order message information, combine them into second-level or minute-level identifiers according to the preset dimensions, and put them into the queue in the cache.

3. The method according to claim 1, characterized in that Also includes: Receive a query request, obtain a query time period in the request, and determine whether the query time period is consistent with a storage time period set in the current cache; If yes, the statistical processing results in the cache are returned; If not, the database is queried and a cache corresponding to the query time period is constructed for statistical processing.

4. The method according to claim 1, characterized in that: After statistical processing at the preset minimum time granularity, it also includes: By comparing the statistical processing result at the current time point with the statistical processing result at the same time point on a preset day, if the comparison result meets the preset threshold, the alarm program is activated.

5. The method according to claim 4, characterized in that After the alarm procedure is initiated, it includes: Alert the target alarm group through the preset notification method.

6. The method according to any one of claims 1 to 5, characterized in that: After statistical processing is performed at the preset minimum time granularity and stored in the database, it includes: Obtain corresponding statistical processing results based on business requests and display them on the front-end page.

7. An order data processing device, characterized in that: include: The acquisition module is used to store the real-time message information of the consumption order in the cache, and put the identifier generated by the preset dimension combination according to the dimension data and time in the real-time message information of the order into the queue in the cache; The processing module is used to write the real-time order message information data in the memory into the database in batches according to the preset time interval set by the cache; query the queue in the cache through the scheduled task, loop through the earliest preset number of identifiers entering the queue, and then perform statistical processing with the preset minimum time granularity and store them in the database.

8. The device according to claim 7, characterized in that The processing module is further used for: Receive a query request, obtain a query time period in the request, and determine whether the query time period is consistent with a storage time period set in the current cache; If yes, the statistical processing results in the cache are returned; If not, the database is queried and a cache corresponding to the query time period is constructed for statistical processing.

9. 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.

10. 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.

Citation Information

Patent Citations

  • Method and device for asynchronous processing of messages

    CN107786623A

  • Message processing method and device and server

    CN109783258A