Data processing method and device, electronic device, and storage medium
Through sharding processing and asynchronous processing technology, the problem of low data processing efficiency of the intelligent offline item trading system information system is solved, and more efficient data statistics and queries are achieved.
Patent Information
- Application Number
- CN202010924220.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-04
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-09-04
AI Technical Summary
The information system of the intelligent offline item trading system is inefficient in data statistics and processing, resulting in a long data processing cycle and affecting system performance.
By sharding the data to be statistically generated to generate task shard data, and using preset event broadcasters to distribute it to event listeners, asynchronous processing and the assembly and query of multi-level category data are achieved, reducing data complexity and computing cycles.
It improves the data processing efficiency of the information system, reduces the data calculation cycle, and improves the efficiency of user query and statistical data.
Smart Images

Figure CN113778976B_ABST
Abstract
Description
Background Art
[0002] With the development of science and technology, unmanned intelligent offline commodity trading systems (such as intelligent physical stores, intelligent vending machines, etc.) are becoming more and more popular. Therefore, the statistics of complex data of intelligent replenishment on the procurement side of the supply chain to which the intelligent offline commodity trading system belongs are becoming more and more important.
[0003] At present, in the relevant schemes, when the complex data of intelligent replenishment on the purchasing side corresponding to the intelligent offline item trading system is counted, due to the complex data structure and large data, it is easy for the information system to spend a long time for data statistics and a long data processing cycle, resulting in low data processing efficiency of the information system.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the embodiments of the present disclosure is to provide a data processing method, a data processing device, an electronic device, and a computer-readable storage medium, thereby solving the problem of low data processing efficiency of the information system corresponding to the intelligent offline item trading system in the relevant scheme at least to a certain extent.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to a first aspect of an embodiment of the present disclosure, there is provided a data processing method, including:
[0008] Obtaining the data to be counted, and performing slice processing on the data to be counted to generate task slice data;
[0009] Distribute the task slice data to the event listener through a preset event broadcaster;
[0010] Based on the event listener, the data is queried and assembled according to the task slice data to generate multi-level category data corresponding to the statistical data to be counted.
[0011] In some example embodiments of the present disclosure, based on the above solution, the slicing of the to-be-stated data to generate task slicing data includes:
[0012] Obtain identification data corresponding to the statistical data to be counted;
[0013] The data to be counted is processed in slices according to the identification data to generate task slice data corresponding to the data to be counted.
[0014] In some example embodiments of the present disclosure, based on the foregoing solution, before distributing the task slice data to the event listener through the preset event broadcaster, the method further includes:
[0015] Based on the preset event broadcaster, determining the target identification data corresponding to the task slice data according to the task slice data;
[0016] A data query is performed based on the target identification data to determine the primary category data corresponding to the target identification data.
[0017] In some example embodiments of the present disclosure, based on the above solution, distributing the task slice data to the event listener through a preset event broadcaster includes:
[0018] Based on the preset event broadcaster, construct a data capture event according to the task slice data and the target identification data and the primary category data corresponding to the task slice data;
[0019] The data grab event is distributed to an event listener to perform asynchronous processing on the data grab event.
[0020] In some example embodiments of the present disclosure, based on the above solution, querying and assembling data based on the task slice data to generate multi-level category data corresponding to the to-be-stated data based on the event listener includes:
[0021] Based on the event listener, query and capture sub-category data in a target database according to the target identification data and the primary category data corresponding to the task slice data in the data capture event;
[0022] The target identification data, the primary category data and the subcategory data are assembled to generate multi-level category data corresponding to the statistical data to be counted.
[0023] In some example embodiments of the present disclosure, based on the aforementioned solution, querying and grabbing sub-category data in a target database according to the target identification data and the primary category data corresponding to the task slice data in the data grabbing event includes:
[0024] According to the target identification data and the first-level category data corresponding to the task slice data in the data capture event, query and obtain order data and product data of the lowest-level category data corresponding to the first-level category data under the target identification data in the target database;
[0025] Sub-category data is generated by performing statistical processing on the bottom-level category data step by step; wherein the sub-category data includes category data of multiple levels, and the category data of different levels are marked.
[0026] In some example embodiments of the present disclosure, based on the above solution, after querying and assembling data according to the task slice data to generate multi-level category data corresponding to the to-be-counted data, the method further includes:
[0027] The multi-level category data after flattening is stored in the target database.
[0028] According to a second aspect of an embodiment of the present disclosure, there is provided a data processing device, including:
[0029] A task slicing module is used to obtain the data to be counted, and to slice the data to be counted to generate task slicing data;
[0030] A data distribution module, used to distribute the task slice data to the event listener through a preset event broadcaster;
[0031] A data assembly module is used to query and assemble data based on the task slice data based on the event listener to generate multi-level category data corresponding to the statistical data to be counted.
[0032] In an exemplary embodiment of the present disclosure, based on the above solution, the task slicing module is further configured as follows:
[0033] Obtain identification data corresponding to the statistical data to be counted;
[0034] The data to be counted is processed in slices according to the identification data to generate task slice data corresponding to the data to be counted.
[0035] In an exemplary embodiment of the present disclosure, based on the above solution, the data processing device further includes a primary category data determination unit, and the primary category data determination unit is configured to:
[0036] Based on the preset event broadcaster, determining the target identification data corresponding to the task slice data according to the task slice data;
[0037] A data query is performed based on the target identification data to determine the primary category data corresponding to the target identification data.
[0038] In an exemplary embodiment of the present disclosure, based on the above solution, the data distribution module is further configured as follows:
[0039] Based on the preset event broadcaster, construct a data capture event according to the task slice data and the target identification data and the primary category data corresponding to the task slice data;
[0040] The data grab event is distributed to an event listener to perform asynchronous processing on the data grab event.
[0041] In an exemplary embodiment of the present disclosure, based on the above solution, the data assembly module further includes:
[0042] A sub-category data capture unit, configured to query and capture sub-category data in a target database based on the event listener and according to the target identification data and the primary category data corresponding to the task slice data in the data capture event;
[0043] The multi-level category data generating unit is used to assemble the target identification data, the first-level category data and the sub-category data to generate the multi-level category data corresponding to the statistical data to be counted.
[0044] In an exemplary embodiment of the present disclosure, based on the above solution, the sub-category data capture unit is further configured as follows:
[0045] According to the target identification data and the first-level category data corresponding to the task slice data in the data capture event, query and obtain order data and product data of the lowest-level category data corresponding to the first-level category data under the target identification data in the target database;
[0046] Sub-category data is generated by performing statistical processing on the bottom-level category data step by step; wherein the sub-category data includes category data of multiple levels, and the category data of different levels are marked.
[0047] In an exemplary embodiment of the present disclosure, based on the above solution, the data processing device further includes a storage unit, and the storage unit is configured to:
[0048] The multi-level category data after flattening is stored in the target database.
[0049] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and wherein the computer-readable instructions, when executed by the processor, implement any one of the data processing methods described above.
[0050] According to a fourth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the data processing method according to any one of the above items is implemented.
[0051] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0052] The data processing method in the example embodiment of the present disclosure obtains the data to be counted, and performs slice processing on the data to be counted to generate task slice data; distributes the task slice data to the event listener through a preset event broadcaster; based on the event listener, queries and assembles data according to the task slice data to generate multi-level category data corresponding to the data to be counted. On the one hand, before querying and assembling the data to be counted, the data to be counted is first sliced to reduce the complexity of the data and improve the data processing efficiency of the information system; on the other hand, the task slice data is distributed to the event listener through the event broadcaster, and the data is queried and assembled through the event listener to realize asynchronous processing of the data to be counted, effectively reduce the data calculation cycle, and further improve the data processing efficiency of the information system.
[0053] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0055] Figure 1 The structure diagram of the tree structure data according to some embodiments of the present disclosure is schematically shown;
[0056] Figure 2 A schematic diagram schematically shows a flow chart of a data processing method according to some embodiments of the present disclosure;
[0057] Figure 3 The structure diagram of the data distribution mechanism according to some embodiments of the present disclosure is schematically shown;
[0058] Figure 4 A schematic diagram of a process of processing statistical data according to some embodiments of the present disclosure is schematically shown;
[0059] Figure 5 A schematic diagram schematically illustrates a data processing device according to some embodiments of the present disclosure;
[0060] Figure 6 A schematic diagram schematically shows a structure of a computer system of an electronic device according to some embodiments of the present disclosure;
[0061] Figure 7 A schematic diagram of a computer-readable storage medium according to some embodiments of the present disclosure is schematically shown.
[0062] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0063] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0064] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0065] Furthermore, the drawings are only schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0066] The inventor found that the automatic order data is tree structure data, referring to Figure 1 As shown, the tree structure data includes first-level category data 101 to first-level category data 102. The first-level category data 101 includes second-level category data 103 to second-level category data 104. Of course, the first-level category data 102 also includes the same second-level category data, which is not shown in the figure; the second-level category data 103 includes third-level category data 105 to third-level category data 106. Of course, the second-level category data 104 also includes the same third-level category data, which is not shown in the figure; the third-level category data 105 includes fourth-level category data 107 to fourth-level category data 108. Of course, the third-level category data 106 also includes the same fourth-level category data, which is not shown in the figure. It is easy to understand that Figure 1 The fourth-level category data in can also include fifth-level category data, which can be further divided into multiple sub-category data according to the actual situation. Figure 1 It is not shown in detail. Figure 1 It can be clearly concluded that the tree-structured automatic order data not only has a more complex data structure, but also has a relatively large amount of data.
[0067] In a related solution, when a user clicks on a page, the background will initiate a Mysql database query operation, insert each level, and then perform data statistics and final summary based on the data at each level. When the user initiates the query operation, the system queries the database for statistics. If a query for the fourth-level category data is triggered, it will be relatively easy to query the third-level category data 105 corresponding to all the data from the fourth-level category data 107 to the fourth-level category data 108. However, if the user queries the first-level category data 101, it is necessary to summarize and calculate the corresponding second-level category data, and then each second-level category needs to summarize its corresponding third-level category data, and each third-level category data needs to summarize all the corresponding fourth-level category data, and will be statistically calculated level by level. At this time, the data that needs to be counted will be very large, which will make the statistical calculation very time-consuming.
[0068] In another related solution, scheduled tasks and scheduled statistics are used. For example, for the current tree data, each node in a single thread needs to be statistically analyzed. Assuming there are four layers, the scheduled task needs to calculate the final statistics layer by layer and save them in the MySQL database. Data is calculated in advance through scheduling, but this solution also faces the problem of long calculation time. When the single thread calculation is large in data, the calculation cycle and server pressure are large.
[0069] There is another related solution, which is to use big data to statistically process such data, which is very convenient. However, if data statistics are performed using big data, for companies or users without big data computing platforms, this will bring great costs, including platform construction costs (such as spark, hbase, hadoop, kafka and other clusters), man-hours, machine resource investment, etc., and the cost is high.
[0070] Based on one or more of the above problems, in this example embodiment, a data processing method is first provided. The data processing method can be applied to terminal devices, such as mobile phones, computers and other electronic devices, and can also be applied to servers. This example embodiment does not specifically limit this. The following takes the server executing the method as an example for explanation. Figure 2 The following is a schematic diagram schematically showing the data processing method flow according to some embodiments of the present disclosure. Figure 1 As shown, the data processing method may include the following steps:
[0071] Step S210, obtaining the data to be counted, and performing slice processing on the data to be counted to generate task slice data;
[0072] Step S220, distributing the task slice data to the event listener through a preset event broadcaster;
[0073] Step S230: Based on the event listener, query and assemble data according to the task slice data to generate multi-level category data corresponding to the statistical data to be counted.
[0074] According to the data processing method in this example embodiment, on the one hand, before querying and assembling the data to be counted, the data to be counted is first sliced and processed to reduce the complexity of the data and improve the data processing efficiency of the information system; on the other hand, the task slice data is distributed to the event listener through the event broadcaster, and the data is queried and assembled through the event listener to realize asynchronous processing of the statistical data, effectively reduce the data calculation cycle, and further improve the data processing efficiency of the information system.
[0075] Next, the data processing method in this exemplary embodiment will be further described.
[0076] In step S210, the data to be counted is obtained, and the data to be counted is sliced to generate task slice data.
[0077] In an example embodiment of the present disclosure, the data to be counted may refer to data that needs to be counted and has a complex structure or a complex path. For example, the data to be counted may be tree structure data corresponding to the type of goods in the automatic order data, or it may be mesh structure data, or it may be other data to be counted with a complex structure or a complex path. This example embodiment does not make any special limitations on this.
[0078] Slicing processing may refer to the process of flattening and disassembling the statistical data according to specific data. For example, slicing processing may refer to the process of decomposing the tree structure of the statistical data corresponding to all the intelligent offline item trading systems according to different item trading system numbers, or may refer to the process of decomposing the mesh structure of the statistical data according to the path number. This example embodiment does not specifically limit this. Task slicing data may refer to the metadata generated after slicing the statistical data.
[0079] Specifically, identification data corresponding to the statistical data to be counted may be obtained, and then the statistical data to be counted may be sliced according to the identification data to generate task slice data corresponding to the statistical data to be counted.
[0080] The identification data may refer to the basis for slicing the statistical data. For example, when the statistical data may be tree structure data corresponding to the types of goods in the automatic order data, the identification data may be the StoreID of the item trading system corresponding to each automatic order data, or the path number of the mesh structure. Of course, the identification data may also be other data that can be used as the basis for slicing the statistical data, and this exemplary embodiment does not specifically limit this.
[0081] For example, when the statistical data to be counted is tree structure data corresponding to the type of goods of automatic order data, the identification data can be the item trading system number, and the first-level category data, second-level category data, third-level category data and fourth-level category data corresponding to the first item trading system number can be used as the first task slice data; the first-level category data, second-level category data, third-level category data and fourth-level category data corresponding to the second item trading system number can be used as the second task slice data, and so on, thereby slicing the statistical data with a more complex structure and containing more data to generate multiple task slice data.
[0082] In step S220, the task slice data is distributed to the event listener through a preset event broadcaster.
[0083] In an example embodiment of the present disclosure, the preset event broadcaster may refer to a program in the Spring event listening mechanism for distributing received events to data consumption nodes of the event listener, and the event listener may refer to a program of an event consumption node that receives events distributed by the event broadcaster and processes the events.
[0084] In an example embodiment of the present disclosure, before distributing the task slice data to the event listener through the preset event broadcaster, the target identification data corresponding to the task slice data can be determined based on the preset event broadcaster according to the task slice data; then a data query is performed based on the target identification data to determine the first-level category data corresponding to the target identification data.
[0085] Among them, the target identification data may refer to the identification data corresponding to the current task slice data, for example, the first item trading system number corresponds to the first task slice data; the second item trading system number corresponds to the second task slice data. When the current task slice data is the second task slice data, the target identification data may be the second item trading system number. Of course, this is only a schematic example, and this example embodiment does not make any special limitation on this.
[0086] When the preset event broadcaster obtains the task slice data after slice processing, the information contained in the current task slice data is the target identification data and the scattered data corresponding to the target identification data. Before event distribution, data query is performed based on the target identification data to determine the first-level category data corresponding to the target identification data, so as to facilitate the consumption and organization of data during subsequent data query and assembly, thereby improving the efficiency of data statistics.
[0087] Furthermore, based on a preset event broadcaster, a data capture event can be constructed according to the task slice data and the target identification data and primary category data corresponding to the task slice data; the data capture event is distributed to the event listener to perform asynchronous processing on the data capture event.
[0088] Among them, the data capture event can refer to the event instruction constructed according to the target identification data and the first-level category data corresponding to the task slice data. The Spring event monitoring mechanism is mainly composed of three parts: event, event broadcaster, and event listener. By constructing the data capture event with the target identification data and the first-level category data corresponding to the task slice data, it is convenient for the subsequent preset event broadcaster and event listener to consume the task slice data.
[0089] In step S230, based on the event listener, the data is queried and assembled according to the task slice data to generate multi-level category data corresponding to the statistical data to be counted.
[0090] In an example embodiment of the present disclosure, a data capture event consisting of multiple task slice data is distributed and broadcast to multiple event listeners through a preset event broadcaster. When receiving the corresponding data capture events, the multiple event listeners asynchronously execute the data capture events to realize asynchronous processing of the data capture events consisting of multiple task slice data. The event listener queries data according to the target identification data and the first-level category data corresponding to the task slice data, and assembles the queried data along the first-level category data to obtain the multi-level category data corresponding to the current task slice data, and finally assembles the multi-level category data corresponding to different task slice data to obtain the multi-level category data of the tree structure corresponding to the statistical data to be counted.
[0091] Specifically, based on the event listener, sub-category data can be queried and captured in the target database according to the target identification data and first-level category data corresponding to the task slice data in the data capture event; the target identification data, first-level category data and sub-category data can be assembled to generate multi-level category data corresponding to the statistical data to be counted.
[0092] Among them, the sub-category data may refer to a plurality of secondary category data corresponding to the primary category data under the current target identification data queried and captured by the event listener. For example, the sub-category data may be the secondary category data, the third category data, and the fourth category data corresponding to the primary category data of the first item transaction system number queried and captured by the event listener under the first item transaction system number. Of course, this is only an illustrative example, and this exemplary embodiment does not make any special limitation on this. The target database may refer to a database storing the statistics to be counted.
[0093] Furthermore, based on the target identification data and the first-level category data corresponding to the task slice data in the data capture event, the order data and product data of the bottom-level category data corresponding to the target identification data can be queried in the target database and obtained; then, the bottom-level category data can be statistically processed step by step to generate sub-category data; wherein, the sub-category data includes category data of multiple levels, and the category data of different levels are identified.
[0094] Among them, the bottom-level category data may refer to the category data at the lowest level in the sub-category data corresponding to the next level category data of the target identification data. For example, the bottom-level category data may be a leaf node of tree structure data or an edge node of mesh structure data. This example embodiment does not make any special limitation on this.
[0095] For example, if the hierarchy of the tree structure data includes four levels, the bottom-level category data may be fourth-level category data; the order data and product data corresponding to the fourth-level category data under the first-level category data are queried and captured through the event listener, and then the third-level category data is obtained based on the statistics of the order data and product data corresponding to the fourth-level category data, and then the second-level category data is obtained based on the statistics of the third-level category data, and finally the sub-category data corresponding to the first-level category data is obtained based on the second-level category data, the third-level category data and the fourth-level category data.
[0096] At the same time, when obtaining the second-level category data, the third-level category data and the fourth-level category data, the different metadata in the second-level category data, the third-level category data and the fourth-level category data can be identified and processed, and the efficiency of data storage can be improved by identifying different metadata, and the efficiency of data query can be improved when performing subsequent data query. For example, when a user queries the first-level category data, it does not need to be recursively obtained from the fourth-level category data level by level, but can be directly obtained according to the data identification, which effectively improves the efficiency of data query.
[0097] Optionally, after querying and assembling data according to the task shard data to generate multi-level category data corresponding to the statistical data to be counted, the flattened multi-level category data can be stored in the target database. When generating multi-level category data corresponding to the statistical data to be counted, the metadata in the multi-level category data all contain different level identifiers, and storing the multi-level category data and different level identifiers in the target database can effectively improve the query efficiency of the data when using it.
[0098] This example embodiment mainly shards the primary category data, performs shard calculations according to each path, and then executes them regularly. After the calculations are completed, they are saved to the database and then made available for user query.
[0099] The entire calculation can be completed through the following steps:
[0100] A scheduled task is created and executed once a day, with the execution date being the previous day. When the scheduled task is started, the data corresponding to all item trading systems is first obtained, and then the data of each item trading system is distributed as a shard data for consumption nodes to calculate and start consumption.
[0101] When the computing node consumes the shard data, it starts processing. The node first obtains the task shard data and the item trading system data. Through data query, it obtains the first-level category data corresponding to this item trading system. After obtaining the data, it distributes it. At this time, through the Spring event monitoring mechanism, events are created and distributed. At this time, all events will be processed asynchronously.
[0102] After the task distribution is completed, the data includes the first-level category data, sub-category data, and data of the item trading system. After the event listener listens to the event, the current event processor first grabs the query assembly data, first calculates the fourth-level category data, including the number of automatic replenishment orders, and then grabs the manual order data. Save the data in the database. At the same time, summarize the fourth-level category data into the third-level category data. Push up layer by layer, and finally generate node data at all levels (the data needs to be marked with the level), and send the calculation results through JMQ (message middleware) after each calculation is completed.
[0103] Finally, after listening to the JMQ message, the system consumes the message and obtains the calculated data and stores it in the Mysql data record.
[0104] By capturing data, asynchronously processing, and flattening the tree structure data corresponding to the statistical data based on the Spring event monitoring mechanism, flattening the data in advance and storing it in the Mysql database, the data processing efficiency of the information system can be effectively improved, and the efficiency of users querying data can be improved.
[0105] Figure 3The structural diagram of the data distribution mechanism according to some embodiments of the present disclosure is schematically shown.
[0106] refer to Figure 3 As shown, the Spring event listening mechanism is mainly composed of three parts: event source 301, event broadcaster 302, and event listener registry 303. Among them, the event source 301 includes multiple events 304, and multiple event listeners 305 are managed in the event listener registry 303. After the data to be counted is processed into multiple task slice data, a data capture event is constructed according to the target identification data and the first-level category data corresponding to the task slice data. At this time, the data capture event is stored in the event source 301, and then the multiple data capture events in the event source 301 are distributed and broadcasted to the multiple event listeners 305 in the event listener registry 303 through the event broadcaster 302. Each event listener 305 is responsible for a data capture event. At this time, the event listener 305 asynchronously processes and consumes the data capture event to obtain the multi-level category data of the data to be counted.
[0107] Figure 4 The following schematically shows a flow chart of data processing for statistical data according to some embodiments of the present disclosure.
[0108] refer to Figure 4 As shown, step S401, obtaining the statistical data to be counted, and performing slicing processing on the statistical data to be counted to obtain task slicing data;
[0109] Step S402, obtaining target identification data and primary category data corresponding to the task slice data according to the task slice data, and constructing a data capture event through the target identification data and the primary category data;
[0110] Step S403, consuming the data capture event through the computing node, that is, distributing and broadcasting the data capture event to the event listener through the event broadcaster in the Spring event listening mechanism;
[0111] Step S404, performing data statistics and capture processing according to the data capture event through the event listener;
[0112] Step S405, publishing a data capture event to capture order data and product data in the database; assembling the captured data to generate multi-level category data corresponding to different target identification data;
[0113] Step S406, calculating the matching rate based on the multi-level category data (it is necessary to count the correlation of the item trading system corresponding to the category dimension according to business needs, for example, counting the proportion of the automatic replenishment using the intelligent replenishment system for a certain date or a certain period of time of a certain item trading system number, i.e., the automatic order matching rate. The following content is mainly analyzed based on the statistics of the automatic order matching rate);
[0114] Step S407, sending the calculated multi-level category data and matching rate to the message queue;
[0115] Step S408, consume the message queue calculation result;
[0116] Step S409, storing the calculation results.
[0117] It should be noted that, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0118] In addition, in this exemplary embodiment, a data processing device is also provided. Figure 4 As shown, the data processing device 500 includes: a task segmentation module 510, a data distribution module 520 and a data assembly module 530. Among them:
[0119] The task slicing module 510 is used to obtain the data to be counted, and to slice the data to be counted to generate task slice data;
[0120] The data distribution module 520 is used to distribute the task slice data to the event listener through a preset event broadcaster;
[0121] The data assembly module 530 is used to query and assemble data according to the task slice data based on the event listener to generate multi-level category data corresponding to the statistical data to be counted.
[0122] In an exemplary embodiment of the present disclosure, based on the above solution, the task slicing module 510 is further configured as follows:
[0123] Obtain identification data corresponding to the statistical data to be counted;
[0124] The data to be counted is processed in slices according to the identification data to generate task slice data corresponding to the data to be counted.
[0125] In an exemplary embodiment of the present disclosure, based on the above solution, the data processing device 500 further includes a primary category data determination unit, and the primary category data determination unit is configured to:
[0126] Based on the preset event broadcaster, determining the target identification data corresponding to the task slice data according to the task slice data;
[0127] A data query is performed based on the target identification data to determine the primary category data corresponding to the target identification data.
[0128] In an exemplary embodiment of the present disclosure, based on the above solution, the data distribution module 520 is further configured as follows:
[0129] Based on the preset event broadcaster, construct a data capture event according to the task slice data and the target identification data and the primary category data corresponding to the task slice data;
[0130] The data grab event is distributed to an event listener to perform asynchronous processing on the data grab event.
[0131] In an exemplary embodiment of the present disclosure, based on the above solution, the data assembly module 530 further includes:
[0132] A sub-category data capture unit, configured to query and capture sub-category data in a target database based on the event listener and according to the target identification data and the primary category data corresponding to the task slice data in the data capture event;
[0133] The multi-level category data generating unit is used to assemble the target identification data, the first-level category data and the sub-category data to generate the multi-level category data corresponding to the statistical data to be counted.
[0134] In an exemplary embodiment of the present disclosure, based on the above solution, the sub-category data capture unit is further configured as follows:
[0135] According to the target identification data and the first-level category data corresponding to the task slice data in the data capture event, query and obtain order data and product data of the lowest-level category data corresponding to the first-level category data under the target identification data in the target database;
[0136] Sub-category data is generated by performing statistical processing on the bottom-level category data step by step; wherein the sub-category data includes category data of multiple levels, and the category data of different levels are marked.
[0137] In an exemplary embodiment of the present disclosure, based on the above solution, the data processing device 500 further includes a storage unit, and the storage unit is configured as follows:
[0138] The multi-level category data after flattening is stored in the target database.
[0139] The specific details of each module of the above-mentioned data processing device have been described in detail in the corresponding data processing method, so they will not be repeated here.
[0140] It should be noted that, although several modules or units of the data processing device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0141] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above data processing method is also provided.
[0142] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware embodiments, complete software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0143] Refer to the following Figure 6 hereinafter describes an electronic device 600 according to such an embodiment of the present disclosure. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0144] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), and a display unit 640.
[0145] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1In step S210, the data to be counted is obtained, and the data to be counted is sliced to generate task slice data; in step S220, the task slice data is distributed to the event listener through a preset event broadcaster; in step S230, based on the event listener, data is queried and assembled according to the task slice data to generate multi-level category data corresponding to the data to be counted.
[0146] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit 622 , and may further include a read-only memory unit (ROM) 623 .
[0147] The storage unit 620 may also include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0148] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0149] The electronic device 600 may also communicate with one or more external devices 670 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0150] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0151] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0152] refer to Figure 7 As shown, a program product 700 for implementing the above data processing method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0153] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The 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 (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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.
[0154] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0155] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0156] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0157] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0158] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0159] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0160] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that: include: Obtaining the data to be counted, and performing slice processing on the data to be counted to generate task slice data; Based on a preset event broadcaster, a data capture event is constructed according to the task slice data and the target identification data and the primary category data corresponding to the task slice data, and the data capture event is distributed to the event listener; Based on the event listener, query and grab sub-category data in the target database according to the target identification data and the first-level category data corresponding to the task slice data in the data grabbing event; wherein the sub-category data refers to a plurality of secondary category data corresponding to the first-level category data under the target identification data queried and grabbed by the event listener; The target identification data, the primary category data and the subcategory data are assembled to generate multi-level category data corresponding to the statistical data to be counted.
2. The data processing method according to claim 1, characterized in that: The step of performing slicing processing on the to-be-counted statistical data to generate task slicing data includes: Obtain identification data corresponding to the statistical data to be counted; The data to be counted is processed in slices according to the identification data to generate task slice data corresponding to the data to be counted.
3. The data processing method according to claim 2, characterized in that: Before distributing the task slice data to the event listener through the preset event broadcaster, the method further includes: Based on the preset event broadcaster, determining the target identification data corresponding to the task slice data according to the task slice data; A data query is performed based on the target identification data to determine the primary category data corresponding to the target identification data.
4. The data processing method according to claim 3, characterized in that: The step of distributing the task slice data to the event listener through a preset event broadcaster includes: The data grab event is distributed to an event listener to perform asynchronous processing on the data grab event.
5. The data processing method according to claim 1, characterized in that: Querying and grabbing sub-category data in a target database according to the target identification data and the primary category data corresponding to the task slice data in the data grabbing event, including: According to the target identification data and the first-level category data corresponding to the task slice data in the data capture event, query and obtain order data and product data of the lowest-level category data corresponding to the first-level category data under the target identification data in the target database; Sub-category data is generated by performing statistical processing on the bottom-level category data step by step; wherein the sub-category data includes category data of multiple levels, and the category data of different levels are marked.
6. The data processing method according to claim 1, characterized in that: After querying and assembling data according to the task slice data to generate multi-level category data corresponding to the to-be-counted data, the method further includes: The multi-level category data after flattening is stored in the target database.
7. A data processing device, characterized in that: include: A task slicing module is used to obtain the data to be counted, and to slice the data to be counted to generate task slicing data; A data distribution module, for constructing a data grabbing event based on a preset event broadcaster according to the task slice data and the target identification data and the primary category data corresponding to the task slice data, and distributing the data grabbing event to an event listener; A data assembly module, for querying and grabbing sub-category data in a target database based on the target identification data and the primary category data corresponding to the task slice data in the data grabbing event, based on the event listener; wherein the sub-category data refers to a plurality of secondary category data corresponding to the primary category data under the target identification data queried and grabbed by the event listener; The data assembly module is also used to assemble the target identification data, the first-level category data and the sub-category data to generate multi-level category data corresponding to the statistical data to be counted.
8. An electronic device, comprising: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the data processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Storage method and reading method for mass tile data
CN103412962A
Method and system for distributed storage and reading of machine data
CN107329983A
Data query method and device, storage medium and electronic equipment
CN110704453A
Method and system for processing queries over datasets stored using hierarchical data structures
US20150363465A1
