Data processing method, device, electronic device and computer readable medium

By adaptively determining the number of cache targets and obtaining target caches, the problem of slow data processing speed and large delay in real-time data refresh is solved, and the rapid processing and real-time data are achieved.

CN113672834BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010412422.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-15
Publication Date
2025-02-21
Estimated Expiration
2040-05-15

AI Technical Summary

Technical Problem

In the data refresh scenario of real-time rankings, due to the single backend cache structure, the data processing speed is slow, and the data displayed by the front-end refresh is delayed, which cannot guarantee the real-timeness of the data.

Method used

By obtaining the pending data and tasks to be executed, the target number of caches is adaptively determined based on the preset mapping table, data order and task number, the target cache has the target number of caches, and the data processing operations are performed in the target cache. .

Benefits of technology

When facing data processing tasks at different levels of magnitude, it can ensure rapid data processing, solve the problems of time-consuming and high delay caused by changes in the scale of data processing tasks, and improve the real-timeness of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672834B_ABST
    Figure CN113672834B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a data processing method, device, electronic device and computer-readable medium, the method comprising: obtaining data to be processed and tasks to be executed; determining the target number of caches according to a preset mapping table, the data level of the data to be processed and the number of tasks to be executed; obtaining a target cache with a target number of caches according to the target number of caches; performing processing operations of the tasks to be executed on the data to be processed, obtaining data processing results and writing the data processing results into the target cache. The technical solution provided by the embodiments of the present disclosure can adaptively determine the target number of caches according to the preset mapping table, the data level and the number of tasks, obtain a target cache with a target number of caches, and perform data processing operations based on the target cache. It can ensure rapid data processing when facing data processing tasks at different levels, and solve the problems of long time consumption and high delay caused by changes in the scale of data processing tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, device, electronic device, and computer-readable medium. Background Art

[0002] During the operation of a website, various data will be generated. For example, in the application scenario of an e-commerce website, sales data and sales revenue data will be generated in real time. The process of ranking these real-time data according to preset dimensions and preset rules is called the real-time ranking. To ensure the authenticity of the data, it is necessary to refresh the data of the real-time ranking. The data refresh of the real-time ranking is achieved by the front end reading the data processed in real time by the back end.

[0003] However, due to the single backend cache structure, the backend cannot guarantee a fast response when faced with a constantly changing amount of data to be processed. Therefore, in the data refresh scenario of the real-time ranking list, there is a problem of slow data processing speed, delay in refreshing the displayed data on the front end, and inability to guarantee the real-time display of the displayed data.

[0004] Therefore, a new data processing method, device, electronic device and computer-readable medium are needed.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] In view of this, the embodiments of the present disclosure provide a data processing method, device, electronic device and computer-readable medium, thereby at least to a certain extent avoiding the defects of slow data processing speed and large delay caused by a single cache structure in the related art.

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

[0008] According to the first aspect of an embodiment of the present disclosure, a data processing method is proposed, which includes: obtaining data to be processed and tasks to be executed; determining a target number of caches according to a preset mapping table, the data level of the data to be processed and the number of tasks to be executed; obtaining a target cache with a target number of caches according to the target number of caches; performing a processing operation of the task to be executed on the data to be processed, obtaining a data processing result and writing the data processing result into the target cache.

[0009] In an exemplary embodiment of the present disclosure, obtaining data to be processed and tasks to be executed includes: receiving a data processing request of a target object; obtaining the data to be processed corresponding to the data request in a database; and obtaining the tasks to be executed corresponding to the data processing request.

[0010] In an exemplary embodiment of the present disclosure, the method further includes: sending the data processing result to the target object in response to the data processing request.

[0011] In an exemplary embodiment of the present disclosure, the method further includes: obtaining the preset cache quantity corresponding to different numbers of tasks at each data level; and generating the preset mapping table with data level, task number and cache number as fields according to the preset cache quantity corresponding to different numbers of tasks at each data level.

[0012] In an exemplary embodiment of the present disclosure, a target number of caches is determined based on a preset mapping table, the data level of the data to be processed, and the number of tasks of the tasks to be executed, including: performing a field match of the data level in the preset mapping table based on the data level of the data to be processed to obtain a first matching result; performing a field match of the number of tasks in the preset mapping table based on the number of tasks of the tasks to be executed to obtain a second matching result; and determining the target number of caches based on the second matching result.

[0013] In an exemplary embodiment of the present disclosure, before determining the target number of caches according to a preset mapping table, the data level of the data to be processed and the number of tasks to be executed, the method further includes: determining the data level of the data to be processed according to the data volume of the data to be processed.

[0014] In an exemplary embodiment of the present disclosure, determining the data level of the data to be processed based on the data volume of the data to be processed includes: if the data volume of the data to be processed is less than or equal to a first data volume threshold, determining the data level of the data to be processed to be a first level; if the data volume of the data to be processed is greater than the first data volume threshold and less than or equal to a second data volume threshold, determining the data level of the data to be processed to be a second level; if the data volume of the data to be processed is greater than the second data volume, determining the data level of the data to be processed to be a third level.

[0015] According to the second aspect of an embodiment of the present disclosure, a data processing device is proposed, which includes: a data acquisition module, configured to acquire data to be processed and tasks to be executed; a cache matching module, configured to determine a target number of caches based on a preset mapping table, the data level of the data to be processed and the number of tasks of the tasks to be executed; a cache determination module, configured to obtain a target cache with a target number of caches based on the target number of caches; and a data processing module, configured to perform the processing operation of the task to be executed on the data to be processed, obtain a data processing result and write the data processing result into the target cache.

[0016] According to the third aspect of an embodiment of the present disclosure, an electronic device is proposed, which includes: 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 any of the data processing methods described above.

[0017] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the data processing method as described in any one of the above items is implemented.

[0018] According to the data processing method, device, electronic device and computer-readable medium provided by certain embodiments of the present disclosure, the target number of caches can be adaptively determined according to the preset mapping table, the data level of the data to be processed and the number of tasks, a target cache with a target number of caches can be obtained, and data processing operations can be performed based on the target cache. It can ensure fast data processing when facing data processing tasks at different levels, and solve the problems of long time consumption and high delay caused by changes in the scale of data processing tasks.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. The drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can also be obtained based on these drawings without creative work.

[0021] Figure 1 is a system block diagram of a data processing method and device according to an exemplary embodiment;

[0022] Figure 2 is a flow chart of a data processing method according to an exemplary embodiment;

[0023] Figure 3 is a flow chart of a data processing method according to an exemplary embodiment;

[0024] Figure 4 is a flow chart of a data processing method according to an exemplary embodiment;

[0025] Figure 5 is a flow chart of a data processing method according to an exemplary embodiment;

[0026] Figure 6 is an architecture diagram of a data processing method and system according to another exemplary embodiment;

[0027] Figure 7 is a graph showing the relationship between the number of caches and the response time according to an exemplary embodiment;

[0028] Figure 8 is a block diagram of a data processing device according to an exemplary embodiment;

[0029] Fig. 9 is a block diagram of an electronic device according to an exemplary embodiment;

[0030] Fig.10 The present invention is a schematic diagram showing a computer-readable storage medium according to an exemplary embodiment. DETAILED DESCRIPTION

[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0032] 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 invention. However, those skilled in the art will appreciate that the technical solution of the present invention may be practiced while omitting 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 various aspects of the present invention.

[0033] The accompanying drawings are only schematic illustrations of the present invention, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can 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.

[0034] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0035] Exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0036] Figure 1 The present invention is a system block diagram showing a data processing method and device according to an exemplary embodiment.

[0037] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for the data processing system operated by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as the data processing request, and feed back the data processing results (such as the data refresh results of the real-time ranking list - only an example) to the terminal device.

[0038] The server 105 may, for example, obtain the data to be processed and the tasks to be executed; the server 105 may, for example, determine the target number of caches according to a preset mapping table, the data level of the data to be processed and the number of tasks to be executed; the server 105 may, for example, obtain a target cache with a target number of caches according to the target number of caches. The server 105 may, for example, perform the processing operation of the tasks to be executed on the data to be processed, obtain the data processing result and write the data processing result into the target cache.

[0039] The server 105 may be a physical server, or may be composed of a plurality of servers, a part of the server 105 may be used as a data processing task submission system in the present disclosure, for obtaining tasks to execute data processing commands; and a part of the server 105 may be used as a data processing system in the present disclosure, for obtaining data to be processed and tasks to be executed; determining a target number of caches according to a preset mapping table, the data level of the data to be processed, and the number of tasks of the tasks to be executed; obtaining a target cache having a target number of caches according to the target number of caches; executing the processing operation of the tasks to be executed on the data to be processed, obtaining a data processing result, and writing the data processing result into the target cache.

[0040] According to the data processing method and device provided by the embodiment of the present disclosure, the target number of caches can be adaptively determined according to the preset mapping table, the data level of the data to be processed and the number of tasks, a target cache with the target number of caches can be obtained, and data processing operations can be performed based on the target cache. It can ensure fast data processing when facing data processing tasks of different levels, and solve the problems of long time consumption and high delay caused by changes in the scale of data processing tasks.

[0041] Figure 2 1 is a flowchart of a data processing method according to an exemplary embodiment. The data processing method provided in the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities, such as terminal devices 101, 102, 103 and / or server 105. In the following embodiments, the method is illustrated by taking the server executing the method as an example, but the present disclosure is not limited to this.

[0042] like Figure 2 As shown, the data processing method 20 provided in the embodiment of the present disclosure may include the following steps.

[0043] In step S202, data to be processed and tasks to be executed are obtained.

[0044] In step S204, the target number of caches is determined according to the preset mapping table, the data level of the data to be processed and the number of tasks to be executed.

[0045] In step S206, a target cache having a target number of caches is obtained according to the target number of caches.

[0046] In step S208, the processing operation of the task to be executed is performed on the data to be processed, the data processing result is obtained and the data processing result is written into the target cache.

[0047] In the disclosed embodiment, in step S202, the data to be processed may be, for example but not limited to, obtained from a big data platform, a database, etc. In the data refresh scenario of the real-time ranking list, the task to be executed may be, for example, a computing task required to be executed for computing the real-time ranking list.

[0048] In step S204, the data level of the data to be processed may be determined according to the data volume of the data to be processed. For example, when the data volume of the data to be processed is within a preset threshold range, the data level of the data to be processed may be determined to be the data level corresponding to the preset threshold range.

[0049] The preset mapping table can describe the correspondence between the data level of the data to be processed, the number of tasks to be executed and the preset cache quantity. The preset mapping table can be matched according to the data level of the data to be processed and the number of tasks to be executed, and the target cache quantity is determined according to the matching result.

[0050] In step S206, the cache may be divided into a target number of caches to obtain a target cache. For example, when the target number is 3, the cache may be divided into 3 caches to obtain a target cache. The cache may be divided evenly or unevenly, and the technical solution of the present disclosure does not specifically limit this.

[0051] In an exemplary embodiment, in step S206, multiple standby caches may be acquired, and a target number of standby caches may be determined as target caches.

[0052] In an exemplary embodiment, the partitioning mode of the cache may be determined according to a preset mapping table, and the partitioning modes include uniform partitioning and non-uniform partitioning.

[0053] According to the data processing method provided by the embodiment of the present disclosure, the target number of caches can be adaptively determined according to the preset mapping table, the data level of the data to be processed and the number of tasks, a target cache with the target number of caches can be obtained, and data processing operations can be performed based on the target cache. It can ensure fast data processing when facing data processing tasks of different levels, and solve the problems of long time consumption and high delay caused by changes in the scale of data processing tasks.

[0054] Figure 3 The invention is a flowchart of a data processing method according to an exemplary embodiment.

[0055] like Figure 3 As shown, the data processing method 30 provided in the embodiment of the present disclosure may include the following steps.

[0056] In step S302, a data processing request of a target object is received.

[0057] In step S304, the to-be-processed data corresponding to the data request is obtained from the database.

[0058] In step S306, a task to be executed corresponding to the data processing request is obtained.

[0059] In step S308, the target number of caches is determined according to the preset mapping table, the data level of the data to be processed and the number of tasks to be executed.

[0060] In step S310, a target cache having a target number of caches is obtained according to the target number of caches.

[0061] In step S312, the processing operation of the task to be executed is performed on the data to be processed, the data processing result is obtained and the data processing result is written into the target cache.

[0062] In step S314, in response to the data processing request, the data processing result is sent to the target object.

[0063] In the embodiment of the present disclosure, in step S302, the target object may be, for example, a front-end device (eg Figure 1 In a data refresh scenario of a real-time ranking list, the data processing request may be, for example, a data calculation request for the real-time ranking list.

[0064] In step S304, the database may be, for example, a backend database or a big data platform, and the technical solution of the present disclosure does not specifically limit this.

[0065] According to the data processing method provided by the embodiment of the present disclosure, after receiving the data processing request of the target object, the target number of caches is adaptively determined according to the preset mapping table, the data level of the data to be processed and the number of tasks, a target cache with the target number of caches is obtained, data processing operations are performed based on the target cache, and the data processing results are sent to the target object in response to the data processing request. It is possible to ensure rapid data processing and achieve rapid response to the data processing request of the target object when facing data processing tasks of different levels. It solves the problem of long time consumption and high delay caused by changes in the scale of data processing tasks.

[0066] Figure 4 The invention is a flowchart of a data processing method according to an exemplary embodiment.

[0067] like Figure 4 As shown, the data processing method 40 provided in the embodiment of the present disclosure may include the following steps.

[0068] In step S402, the preset cache quantity corresponding to different task quantities at each data level is obtained.

[0069] In step S404, a preset mapping table with data level, task number and cache number as fields is generated according to the preset cache numbers corresponding to different task numbers at each data level.

[0070] In step S406, data to be processed and tasks to be executed are obtained.

[0071] In step S408, a field match of data level is performed in a preset mapping table according to the data level of the data to be processed to obtain a first matching result.

[0072] In step S410, a field match of the task quantity is performed in the first matching result according to the task quantity of the task to be executed, so as to obtain a second matching result.

[0073] In step S412, the target quantity of the cache is determined according to the second matching result.

[0074] In step S414, a target cache having a target number of caches is obtained according to the target number of caches.

[0075] In step S416, the processing operation of the task to be executed is performed on the data to be processed, the data processing result is obtained and the data processing result is written into the target cache.

[0076] In the embodiment of the present disclosure, in step S402, at each data level, the preset cache number corresponding to different numbers of tasks may be the cache number with minimum response time corresponding to different numbers of tasks at each data level, and the cache number with minimum response time may be obtained through experimental data. Figure 7 FIG. 1 is a diagram showing the relationship between the number of caches and the response time according to an exemplary embodiment. Figure 7 As shown in the figure, when the data level and the number of tasks are determined, the response time of data processing under different cache numbers can be determined. Figure 7 In the relationship diagram shown, the data magnitude is 1, the number of tasks is 4, wherein the upper limit of the number of caches is 3, and the upper limit of the number of tasks is 4. It can be determined that the minimum response time is achieved when the number of caches is 3. It is determined that the preset number of caches corresponding to the magnitude of 1 and the number of tasks is 4 is 3.

[0077] In step S404, Table 1 is a preset mapping table according to an exemplary embodiment. As shown in Table 1, taking x=1, y=4, z=3 as an example, when the field value of the data level is 1 and the field value of the task quantity is 4, the corresponding field value of the cache quantity is 3.

[0078] Table 1

[0079] Data level (x) Number of tasks (y) Cache quantity (z) 1 1 1 1 2 2 1 3 3 1 4 3 2 1 2 2 2 2 2 3 3 2 4 3 3 1 1 3 2 2 3 3 2 3 4 3

[0080] For example, the data level of the data to be processed is 1 and the number of tasks to be executed is 4. In step S408, the data level (1) of the data to be processed can be matched with the data level field in the preset mapping table (Table 1). The first matching result includes:

[0081] x=1, y=1, z=1;

[0082] x=1, y=2, z=2;

[0083] x=1, y=3, z=3;

[0084] x=1, y=4, z=3;

[0085] In step S410, the task quantity (4) of the task to be executed may be matched with the task quantity field in the first matching result to obtain a second matching result. The second matching result includes:

[0086] x=1, y=4, z=3

[0087] In step S412, it can be determined according to the second matching result (x=1, y=4, z=3) that the target number of caches is 3 (z=3).

[0088] According to the data processing method provided by the embodiment of the present disclosure, a preset mapping table is generated according to the preset cache number corresponding to different task numbers at each data level, and the data level of the data to be processed and the task number of the task to be executed can be matched with the preset mapping table, and the target number of caches can be adaptively determined to obtain a target cache with a target number of caches, and data processing operations can be performed based on the target cache. In the face of data processing tasks at different levels, it is possible to ensure rapid data processing and solve the problems of long time consumption and high delay caused by changes in the scale of data processing tasks.

[0089] Figure 5 The invention is a flowchart of a data processing method according to an exemplary embodiment.

[0090] like Figure 5 As shown, the data processing method 50 provided in the embodiment of the present disclosure may include the following steps.

[0091] In step S502, data to be processed and tasks to be executed are obtained.

[0092] In step S504, the data level of the data to be processed is determined according to the data volume of the data to be processed.

[0093] In an exemplary embodiment, step S504 may include the following steps S5041 to S5043.

[0094] In step S5041, if the data volume of the data to be processed is less than or equal to the first data volume threshold, it is determined that the data volume level of the data to be processed is the first volume level.

[0095] In step S5042, if the data volume of the data to be processed is greater than the first data volume threshold and less than or equal to the second data volume threshold, it is determined that the data volume level of the data to be processed is the second volume level.

[0096] In step S5043, if the data amount of the data to be processed is greater than the second data amount, it is determined that the data magnitude of the data to be processed is a third magnitude.

[0097] In the embodiment of the present disclosure, taking the data refresh scenario of the real-time ranking list as an example, the first data volume threshold may be, for example, 10M. The second data volume threshold may be, for example, 100M. However, this is only an example, and the technical solution of the present disclosure does not specifically limit this. It should be understood that the embodiment of the present disclosure divides the data magnitude of the data to be processed into three levels: the first magnitude, the second magnitude, and the third magnitude, but this is only an example, and the technical solution of the present disclosure does not specifically limit the specific number of data magnitudes.

[0098] As shown in Table 1, the first level may correspond to the data level of 1 in Table 1, the second level may correspond to the data level of 2 in Table 1, and the third level may correspond to the data level of 3 in Table 1.

[0099] In step S506, the target number of caches is determined according to the preset mapping table, the data level of the data to be processed and the number of tasks to be executed.

[0100] In step S508, a target cache having a target number of caches is obtained according to the target number of caches.

[0101] In step S510, the processing operation of the task to be executed is performed on the data to be processed, the data processing result is obtained and the data processing result is written into the target cache.

[0102] According to the data processing method provided by the embodiment of the present disclosure, the data magnitude of the data to be processed can be determined by comparing the data magnitude of the data to be processed with the first quantity threshold and the second data magnitude threshold. Based on the data magnitude of the data to be processed and in combination with the number of tasks to be executed, it is possible to match with a preset mapping table, adaptively determine the target number of caches, obtain a target cache with a target number of caches, and perform data processing operations based on the target cache. It is possible to ensure rapid data processing when facing data processing tasks of different magnitudes, and solve the problems of long time consumption and high delay caused by changes in the scale of data processing tasks.

[0103] Figure 6 is an architecture diagram of a data processing method and system according to another exemplary embodiment.

[0104] like Figure 6 As shown, the data processing method 60 provided in the embodiment of the present disclosure can be executed in a data processing system, and the data processing system includes: a big data platform 61, a load console 62, a task management module 63, and a cache management module 64. Among them, taking the data refresh scenario of the real-time ranking list as an example, the big data platform 61 is responsible for real-time calculation and storage of various original data. Taking the big data platform of the data refresh scenario of the real-time ranking list as an example, the various original data can be, for example, but not limited to, the sales volume and sales data of the order. The load console 62 may include a traffic monitor 621, a scheduler 622, and a mapping relationship library 623. The load console 62 has the function of monitoring traffic, scheduling the matching relationship between tasks and caches. The task management module 63 is responsible for managing the tasks to be executed for data processing (taking the data refresh scenario of the real-time ranking list as an example, the tasks to be executed can be, for example, but not limited to, the calculation processing of data cleaning, the calculation processing of the actual value of sales, etc.). The cache management module 64 manages multiple caches and supports the storage of information data processed by the task module. The front-end page 65 is the operation page of the target object. In the data refresh scenario of the real-time ranking list, the front-end page 65 is the ranking list webpage that the target object's operating user can see, which processes and displays the data results in the cache in real time. The data processing task provided by the embodiment of the present disclosure may include the following steps.

[0105] In step S602 , a data processing request from the front page 65 is received.

[0106] In step S604, the data to be processed corresponding to the data processing request is obtained in the big data platform 61.

[0107] In step S606 , the data level of the data to be processed is determined by the traffic monitor 621 and sent to the scheduler 622 , and the data to be processed is transparently transmitted to the scheduler 622 .

[0108] In step S608 , the number of tasks to be executed that are being enabled in the task management module 63 is synchronously obtained through the scheduler 621 .

[0109] In step S610, the scheduler 621 uses the data level of the data to be processed and the number of tasks to be executed as query conditions, searches from the mapping relationship library 623, determines the target number of caches and sends it to the task management module 63, and at the same time transmits the data to be processed to the task management module 63.

[0110] Among them, the mapping relationship library records the preset mapping table.

[0111] In step S612, the task management module 63 processes the received data to be processed according to the tasks to be executed to obtain data processing results, and determines the target cache according to the target number of caches received from the scheduler 621, and writes the data processing results into the target cache.

[0112] In step S614, the front-end page 65 obtains the data processing results in the target cache in real time and displays the data processing results.

[0113] The data processing method provided by the embodiment of the present disclosure can find the target number of caches in the mapping relationship table according to the data level of the data to be processed and the number of tasks to be executed, and determine the number of caches with the best response speed in real time. By dynamically allocating the cache, it is possible to achieve the technical effect that the display data of the front-end page can be refreshed in seconds under different data levels and different numbers of tasks, which can improve the real-time performance of the data and improve the user experience.

[0114] It should be clearly understood that the present disclosure describes how to form and use specific examples, but the principles of the present disclosure are not limited to any details of these examples. On the contrary, based on the teachings of the contents disclosed in the present disclosure, these principles can be applied to many other embodiments.

[0115] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a central processing unit (CPU). When the computer program is executed by the central processing unit (CPU), the above functions defined by the above method provided by the present disclosure are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk or an optical disk, etc.

[0116] In addition, it should be noted that the above 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 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.

[0117] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0118] Figure 8 is a block diagram of a data processing device according to an exemplary embodiment. Figure 8 The data processing device 80 provided in the embodiment of the present disclosure may include: a data acquisition module 802 , a cache matching module 804 , a cache determination module 806 and a data processing module 808 .

[0119] In the data processing device 80 , the data acquisition module 802 may be configured to acquire data to be processed and tasks to be performed.

[0120] The cache matching module 804 may be configured to determine the target number of caches according to a preset mapping table, the data level of the data to be processed, and the number of tasks to be executed.

[0121] The cache determination module 806 may be configured to obtain a target cache having a target number of caches according to the target number of caches.

[0122] The data processing module 808 may be configured to perform processing operations of the tasks to be performed on the data to be processed, obtain data processing results, and write the data processing results into a target cache.

[0123] In an exemplary embodiment, the data acquisition module 802 may include a data request receiving unit, a data acquisition unit, and a task acquisition unit. The data request receiving unit may be configured to receive a data processing request of a target object. The data acquisition unit may be configured to acquire the to-be-processed data corresponding to the data request in a database. The task acquisition unit may be configured to acquire the to-be-executed task corresponding to the data processing request.

[0124] In an exemplary embodiment, the data processing device 80 may further include a data request response module, and the data request response module may be configured to send a data processing result to the target object in response to a data processing request.

[0125] In an exemplary embodiment, the data processing device 80 may further include a preset cache quantity receiving module and a mapping table generating module. The preset cache quantity receiving module may be configured to obtain the preset cache quantity corresponding to different task quantities at each data level. The mapping table generating module may be configured to generate a preset mapping table with data level, task quantity and cache quantity as fields according to the preset cache quantity corresponding to different task quantities at each data level.

[0126] In an exemplary embodiment, the cache matching module 804 may include a first matching unit, a second matching unit, and a target quantity determination unit. The first matching unit may be configured to perform a field match of the data magnitude in a preset mapping table according to the data magnitude of the data to be processed, and obtain a first matching result. The second matching unit may be configured to perform a field match of the task quantity in the first matching result according to the task quantity of the task to be executed, and obtain a second matching result. The target quantity determination unit may be configured to determine the target quantity of the cache according to the second matching result.

[0127] In an exemplary embodiment, the data processing device 80 may further include a data level determination module, wherein the data level determination module may be configured to determine the data level of the data to be processed according to the data volume of the data to be processed.

[0128] In an exemplary embodiment, the data level determination module may include a first level determination unit, a second level determination unit, and a third level determination unit. The first level determination unit may be configured to determine that the data level of the data to be processed is a first level if the data amount of the data to be processed is less than or equal to the first data amount threshold. The second level determination unit may be configured to determine that the data level of the data to be processed is a second level if the data amount of the data to be processed is greater than the first data amount threshold and less than or equal to the second data amount threshold. The third level determination unit may be configured to determine that the data level of the data to be processed is a third level if the data amount of the data to be processed is greater than the second data amount.

[0129] According to the data processing device provided by the embodiment of the present disclosure, the target number of caches can be adaptively determined according to the preset mapping table, the data level of the data to be processed and the number of tasks, a target cache with the target number of caches can be obtained, and data processing operations can be performed based on the target cache. It can ensure fast data processing when facing data processing tasks of different levels, and solve the problems of long time consumption and high delay caused by changes in the scale of data processing tasks.

[0130] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.

[0131] Refer to the following Fig. 9 The electronic device 200 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0132] like Fig. 9 As shown, the electronic device 200 is in the form of a general computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.

[0133] The storage unit stores a program code, which can be executed by the processing unit 210, so that the processing unit 210 executes the steps according to various exemplary embodiments of the present disclosure described in the electronic prescription circulation processing method section of this specification. For example, the processing unit 210 can execute the following steps: Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 Follow the steps shown in .

[0134] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .

[0135] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 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 the implementation of a network environment.

[0136] Bus 230 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.

[0137] The electronic device 200 may also communicate with one or more external devices 300 (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 200, and / or communicate with any device that enables the electronic device 200 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 250. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. 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 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0138] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation 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, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.

[0139] Fig.10 A schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure is schematically shown.

[0140] refer to Fig.10 As shown, a program product 400 for implementing the above 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. 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.

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

[0142] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0143] 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).

[0144] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium realizes the following functions: obtaining data to be processed and tasks to be executed; determining the target number of caches according to a preset mapping table, the data level of the data to be processed and the number of tasks to be executed; obtaining a target cache with a target number of caches according to the target number of caches; performing the processing operation of the task to be executed on the data to be processed, obtaining a data processing result and writing the data processing result into the target cache.

[0145] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0146] 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 mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.

[0147] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A data processing method, characterized in that: include: Get the data to be processed and the tasks to be executed; Determine the target number of caches according to a preset mapping table, the data level of the data to be processed and the number of tasks to be executed; The preset mapping table describes the corresponding relationship between the data level of the data to be processed, the number of tasks to be executed and the preset cache quantity; Obtaining a target cache having a target number of caches according to the target number of caches; Execute the processing operation of the task to be executed on the data to be processed, obtain the data processing result and write the data processing result into the target cache; The step of determining the target number of caches according to the preset mapping table, the data level of the data to be processed, and the number of tasks to be executed includes: According to the data level of the data to be processed, a field matching of the data level is performed in the preset mapping table to obtain a first matching result; According to the task quantity of the task to be executed, a field match of the task quantity is performed in the first matching result to obtain a second matching result; The target quantity of the cache is determined according to the second matching result.

2. The method according to claim 1, characterized in that Obtaining data to be processed and tasks to be performed includes: Receive a data processing request from a target object; Acquire the to-be-processed data corresponding to the data processing request in a database; Obtain the task to be executed corresponding to the data processing request.

3. The method according to claim 2, characterized in that Also includes: In response to the data processing request, the data processing result is sent to the target object.

4. The method according to claim 1, characterized in that Also includes: Get the preset cache quantity corresponding to different task quantities at each data level; The preset mapping table with data level, task number and cache number as fields is generated according to the preset cache number corresponding to different task numbers under each data level.

5. The method according to claim 1, characterized in that Before determining the target number of caches according to the preset mapping table, the data level of the data to be processed and the number of tasks to be executed, the method further includes: The data magnitude of the data to be processed is determined according to the data volume of the data to be processed.

6. The method according to claim 5, characterized in that Determining the data magnitude of the data to be processed according to the data volume of the data to be processed includes: If the data volume of the to-be-processed data is less than or equal to a first data volume threshold, determining that the data volume level of the to-be-processed data is a first volume level; If the data volume of the to-be-processed data is greater than the first data volume threshold and less than or equal to the second data volume threshold, determining that the data volume level of the to-be-processed data is the second volume level; If the data amount of the data to be processed is greater than the second data amount, the data magnitude of the data to be processed is determined to be a third magnitude.

7. A data processing device, characterized in that: include: A data acquisition module, configured to acquire data to be processed and tasks to be executed; A cache matching module, configured to determine a target number of caches according to a preset mapping table, the data level of the to-be-processed data and the number of tasks to be executed; The preset mapping table describes the corresponding relationship between the data level of the data to be processed, the number of tasks to be executed and the preset cache quantity; A cache determination module, configured to obtain a target cache having a target number of caches according to the target number of caches; A data processing module, configured to perform a processing operation of the task to be executed on the data to be processed, obtain a data processing result and write the data processing result into the target cache; The cache matching module is configured to perform field matching of data magnitude in the preset mapping table according to the data magnitude of the data to be processed, and obtain a first matching result; According to the task quantity of the task to be executed, a field match of the task quantity is performed in the first matching result to obtain a second matching result; The target quantity of the cache is determined according to the second matching result.

8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Thread allocation method and device, computer equipment and storage medium

    CN110569123A

  • Data processing method and system, electronic equipment and storage medium

    CN110688066A