Data processing method, device, electronic device and storage medium
By adding and managing target tasks in the target time round, and automatically deleting tasks using the loop cycle of the loop pointer, the problems of low efficiency and poor timeliness are solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202111071335.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-13
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2041-09-13
AI Technical Summary
In the case of large amount of data, the processing efficiency of timed polling is low and the timeliness is poor.
Add the target task to the target task queue of the target time round by obtaining the attribute information of the target task, including inventory occupancy information, trigger time, and execution cycle. Determine the cycle of the cyclic pointer according to the execution cycle. When the cyclic pointer reaches the corresponding task slot point, delete the target task and release the inventory occupancy.
It improves the processing efficiency and timeliness of target tasks, saves system operation resources, and solves the problems of low processing efficiency and poor timeliness.
Smart Images

Figure CN113723892B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically to a data processing method, apparatus, device, medium and program product. Background Art
[0002] When inventory nodes such as stores or warehouses need to be replenished, the purchasing and sales staff will prepare a corresponding purchase plan, and the goods and purchase quantities in the purchase plan will occupy the inventory. If the purchase plan is not processed in time, the inventory cannot be released in time. At present, the purchase plan that is not processed in time is generally processed by regular polling.
[0003] In the process of implementing the inventive concept of the present disclosure, the inventors found that there are at least the following problems in the related art: when the amount of data is large, the processing efficiency of the timed polling method is low and the timeliness is poor. Summary of the invention
[0004] In view of the above problems, the present disclosure provides improved data processing methods, devices, equipment, media and program products.
[0005] According to a first aspect of the present disclosure, there is provided a data processing method, comprising:
[0006] Acquire attribute information of the target task, wherein the attribute information includes inventory occupancy information, trigger time, and execution cycle corresponding to the target task;
[0007] Adding the target task to a target task queue of a target time wheel according to the attribute information, wherein the target task queue corresponds to the trigger time, and each task slot in the target time wheel corresponds to a task queue;
[0008] Determine the cycle period of the loop pointer in the target time wheel according to the execution cycle;
[0009] When the loop pointer reaches the task slot corresponding to the loop period, the target task is deleted from the target task queue, and the inventory occupancy associated with the inventory occupancy information is released.
[0010] According to an embodiment of the present disclosure, the method for constructing the target time wheel includes:
[0011] Obtaining a time wheel construction request, wherein the time wheel construction request includes a ring queue template and a preset cycle period;
[0012] In response to the time wheel construction request, generating an initial time wheel according to the ring queue template and the preset cycle period;
[0013] Obtaining the loop pointer generation request, wherein the loop pointer generation request includes preset interval time information, wherein the preset interval time information includes the interval time for the loop pointer to move each task slot in the initial time wheel;
[0014] In response to the circular pointer generation request, the target time wheel is generated according to the preset interval time information and the initial time wheel.
[0015] According to an embodiment of the present disclosure, in response to the time wheel construction request, generating an initial time wheel according to the ring queue template and the preset cycle period includes:
[0016] Determine N of the task slots according to the preset cycle period, where N≥1;
[0017] Add N of the task slots to the ring queue template to generate the initial time wheel.
[0018] According to an embodiment of the present disclosure, in response to the loop pointer generation request, generating the target time wheel according to the preset interval time information and the initial time wheel includes:
[0019] Determine the movement interval of the circular pointer according to the preset interval information;
[0020] Generate the loop pointer according to the moving interval time;
[0021] The loop pointer is added to the initial time wheel to generate the target time wheel.
[0022] According to an embodiment of the present disclosure, adding the target task to a target task queue of a target time wheel according to the attribute information includes:
[0023] Determine the target task slot corresponding to the target task according to the trigger time;
[0024] Determine the target task queue according to the target task slot;
[0025] Add the target task to the target task queue.
[0026] According to an embodiment of the present disclosure, determining the cycle period of the loop pointer in the target time wheel according to the execution cycle includes:
[0027] Determine, according to the execution cycle, a target number of the task slots on the target time wheel corresponding to the execution cycle;
[0028] The cycle period of the cycle pointer is determined according to the target number.
[0029] A second aspect of the present disclosure provides a data processing device, including:
[0030] A first acquisition module is used to acquire attribute information of a target task, wherein the attribute information includes inventory occupancy information, a trigger time, and an execution period corresponding to the target task;
[0031] An adding module, used for adding the target task to a target task queue of a target time wheel according to the attribute information, wherein the target task queue corresponds to the trigger time, and each task slot in the target time wheel corresponds to a task queue;
[0032] A determination module, used for determining a cycle period of a cycle pointer in the target time wheel according to the execution period;
[0033] The deleting module is used to delete the target task in the target task queue and release the inventory occupancy associated with the inventory occupancy information when the loop pointer reaches the task slot corresponding to the loop period.
[0034] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned data processing method.
[0035] The fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned data processing method.
[0036] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned data processing method when executed by a processor.
[0037] According to an embodiment of the present disclosure, the target task is added to the target task queue of the time wheel according to the trigger time of the target task, the cycle period of the loop pointer in the time wheel is determined according to the execution period of the target task, and when the cycle period is reached, the target task is deleted from the target task queue, and the inventory occupancy of the target task is released. Since the target task is deleted according to the delayed task corresponding to the execution period in the time wheel, the processing efficiency and timeliness of the target task can be improved, and the purpose of saving system operation resources is achieved. Thereby, the problem of low processing efficiency and poor timeliness in the related art is at least partially solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0039] Figure 1 The application scenario diagram of the data processing method according to the embodiment of the present disclosure is schematically shown.
[0040] Figure 2 The flowchart of the data processing method according to the embodiment of the present disclosure is schematically shown.
[0041] Figure 3 The flowchart of the method for constructing the target time wheel according to the embodiment of the present disclosure is schematically shown.
[0042] Figure 4 The diagram schematically shows a timing wheel according to an embodiment of the present disclosure.
[0043] Figure 5 The structure block diagram of a data processing device according to an embodiment of the present disclosure is schematically shown.
[0044] Figure 6 A block diagram of an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0045] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0046] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0047] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0048] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0049] When a store or warehouse (hereinafter referred to as inventory nodes) needs to be replenished, the purchasing and sales personnel enter the goods, quantities and inventory nodes that need to be replenished through the front-end purchasing system and submit a purchase plan, and at the same time reserve the total inventory based on the goods and purchase quantity. In order to ensure the validity of the purchasing data, the purchase plan often requires the intervention of the BPM (business process management) approval system. The purchase order is reviewed by the purchase and sales personnel's superior or administrator. When the approval is successful, the purchase plan will generate a purchase order and enter the subsequent process flow. When the review fails or the approval times out (for example, if it is not reviewed for 24 hours, it will be considered a timeout), the purchase plan status will be updated to canceled, and the reserved inventory of the goods will be released.
[0050] Currently, purchase plans that are not processed in time are generally processed by scheduled polling. Start a scheduled task and run it every certain period of time (for example, 5 minutes). When the task obtains a purchase plan that has timed out, update the status of the purchase plan to canceled in batches and release the inventory of the goods respectively.
[0051] However, in the process of implementing the inventive concept of the present disclosure, the inventors found that there are at least the following problems in the related art: when the amount of data is large, the processing efficiency of the timed polling method is low and the timeliness is poor.
[0052] An embodiment of the present disclosure provides a data processing method, including obtaining attribute information of a target task, wherein the attribute information includes inventory occupancy information, a trigger time, and an execution cycle corresponding to the target task; adding the target task to a target task queue of a target time wheel according to the attribute information, wherein the target task queue corresponds to the trigger time, and each task slot in the target time wheel corresponds to a task queue; determining a cycle period of a loop pointer in the target time wheel according to the execution cycle; and deleting the target task from the target task queue when the loop pointer reaches the task slot corresponding to the cycle period, and releasing the inventory occupancy associated with the inventory occupancy information.
[0053] Figure 1 The application scenario diagram of the data processing method according to the embodiment of the present disclosure is schematically shown.
[0054] like Figure 1As shown, the application scenario 100 according to this embodiment may include a network, a terminal device and a server. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0055] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0056] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0057] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0058] It should be noted that the data processing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data processing device provided in the embodiment of the present disclosure can generally be set in the server 105. The data processing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the data processing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0059] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0060] The following will be based on Figure 1 The scene described by Figure 2 to Figure 4 The data processing method of the disclosed embodiment is described in detail.
[0061] Figure 2The flowchart of the data processing method according to the embodiment of the present disclosure is schematically shown.
[0062] like Figure 2 As shown, the data processing method of this embodiment includes operations S201 to S204, and the data processing method can be executed by a terminal device and a server.
[0063] In operation S201, attribute information of a target task is acquired, wherein the attribute information includes inventory occupancy information, triggering time, and execution cycle corresponding to the target task.
[0064] According to an embodiment of the present disclosure, the target task may include, for example, a task for processing a purchase plan. The inventory occupancy information may include, for example, the commodity, quantity, and inventory nodes that need to be replenished corresponding to the target task, and the inventory nodes may include, for example, stores and warehouses. The execution cycle may include, for example, a processing time limit for the purchase plan corresponding to the target task, and the processing time limit may include, for example, 12 hours, 24 hours, 48 hours, or any other time limit. The trigger time may include, for example, the generation time of the purchase plan.
[0065] In operation S202, the target task is added to a target task queue of a target time wheel according to the attribute information, wherein the target task queue corresponds to the trigger time, and each task slot in the target time wheel corresponds to a task queue.
[0066] According to an embodiment of the present disclosure, a task slot may include, for example, a Slot (peripheral component expansion slot) slot. Each Slot slot may correspond to, for example, a task queue, or a Slot slot may be, for example, an empty slot. The content of a Slot slot may be set as required for a specific implementation.
[0067] According to an embodiment of the present disclosure, the number of task slots can be determined, for example, based on the average processing time limit and the finest time granularity of the purchase plan, and the finest time granularity can include, for example, the interval time between two adjacent task slots. For example, the average processing time limit of the purchase plan is 12 hours, and 1 second is the finest time granularity. Then, according to the finest time granularity of the average processing time limit, 60×60 task slots can be set on the time wheel. Since the interval time of each slot is 1 second, and the time wheel has 3600 task slots, the time for each cycle of the time wheel is 1 hour. When the time wheel cycles 12 times, the processing time limit of the target task with a processing time limit of 12 hours is reached.
[0068] It should be noted that the above embodiments are only illustrative embodiments. According to specific implementation requirements, the number of task slots can also be determined according to other factors. The present disclosure does not specifically limit the method for determining the number of task slots.
[0069] In operation S203, a cycle period of a cycle pointer in the target time wheel is determined according to the execution cycle.
[0070] According to an embodiment of the present disclosure, the cycle period of the loop pointer may include, for example, the number of times the loop pointer circles the time wheel. For example, if the execution period of a target task is 15 hours, and the time for the loop pointer to circle the time wheel is 1 hour, then the cycle period of the loop pointer for the target task is 15 circles.
[0071] In operation S204, when the loop pointer reaches the task slot corresponding to the loop period, the target task is deleted from the target task queue, and the inventory occupancy amount associated with the inventory occupancy information is released.
[0072] According to an embodiment of the present disclosure, the target task is added to the target task queue of the time wheel according to the trigger time of the target task, the cycle period of the loop pointer in the time wheel is determined according to the execution period of the target task, and when the cycle period is reached, the target task is deleted from the target task queue, and the inventory occupation of the target task is released. Since the target task is deleted according to the delayed task corresponding to the execution period in the time wheel, the processing efficiency and timeliness of the target task can be improved, and the purpose of saving system operation resources is achieved. Thereby, the problem of low processing efficiency and poor timeliness in the related art is at least partially solved.
[0073] Figure 3 The flowchart of the method for constructing the target time wheel according to the embodiment of the present disclosure is schematically shown.
[0074] like Figure 3 As shown, the method includes operations S301 to S304.
[0075] In operation S301, a time wheel construction request is obtained, wherein the time wheel construction request includes a ring queue template and a preset cycle period.
[0076] According to an embodiment of the present disclosure, the preset cycle period can be determined by the finest time granularity and the number of task slots. For example, if the finest time granularity of a time wheel is 1 second and the number of task slots is 60, the preset cycle period of the time wheel is 1 minute.
[0077] In operation S302, in response to a time wheel construction request, an initial time wheel is generated according to a ring queue template and a preset cycle period.
[0078] According to an embodiment of the present disclosure, each task slot is filled into the circular queue template at a fixed angle to generate an initial time wheel. It should be noted that the angle between adjacent task slots can be determined by, for example, the finest time granularity and the number of task slots. For example, the finest time granularity of a certain time wheel is 1 second, and the number of task slots is 60. It can be known by calculation that the preset cycle period of the time wheel is 1 minute, and the angle between adjacent task slots in the time wheel is 10 degrees.
[0079] In operation S303, a request for generating a cyclic pointer is obtained, wherein the request for generating the cyclic pointer includes preset interval time information, wherein the preset interval time information includes the interval time for each movement of the cyclic pointer by one task slot in the initial time wheel.
[0080] According to an embodiment of the present disclosure, the loop pointer may include, for example, a marking frame or an indicator needle, or may also include displaying in a highlighted manner. The preset interval time information may be, for example, the same as the finest time granularity.
[0081] In operation S304, in response to the loop pointer generation request, a target time wheel is generated according to the preset interval time information and the initial time wheel.
[0082] Figure 4 The diagram schematically shows a timing wheel according to an embodiment of the present disclosure.
[0083] like Figure 4 As shown, the time wheel 400 includes a circular queue 401 , a task slot 402 , a loop pointer 403 and a task queue 404 .
[0084] According to an embodiment of the present disclosure, the time wheel 400 has a minimum time granularity of 1S and a cycle period of 1 hour, and the time wheel 400 includes a total of 3600 task slots 402. The cycle pointer 403 is identified in the form of an identification box. Each task slot 402 corresponds to a task queue 404.
[0085] According to an embodiment of the present disclosure, in response to a time wheel construction request, generating an initial time wheel according to a ring queue template and a preset cycle period includes:
[0086] Determine N task slots according to a preset cycle, where N ≥ 1. Add the N task slots to the ring queue template to generate an initial time wheel.
[0087] According to an embodiment of the present disclosure, the number of task slots can also be determined according to a preset cycle and the finest time granularity. For example, if the finest time granularity of a time wheel is 1 second and the preset cycle is 1 minute, the number of task slots of the time wheel is 60.
[0088] According to an embodiment of the present disclosure, each task slot is filled into the circular queue template at a fixed angle to generate an initial time wheel.
[0089] According to an embodiment of the present disclosure, in response to a request for generating a circular pointer, generating a target time wheel according to preset interval time information and an initial time wheel includes:
[0090] Determine the movement interval of the circular pointer according to the preset interval information. Generate the circular pointer according to the movement interval. Add the circular pointer to the initial time wheel to generate the target time wheel.
[0091] According to an embodiment of the present disclosure, the preset interval time information includes the interval time for each movement of the loop pointer by one task slot in the initial time wheel. Specifically, the preset interval time information may be the same as the finest time granularity, for example.
[0092] According to an embodiment of the present disclosure, adding a target task to a target task queue of a target time wheel according to attribute information includes:
[0093] Determine the target task slot corresponding to the target task according to the trigger time. Determine the target task queue according to the target task slot. Add the target task to the target task queue.
[0094] According to an embodiment of the present disclosure, the trigger time may include, for example, the trigger time of the target task. Each target task may determine the target task slot corresponding to it on the time wheel according to the trigger time. Thus, the target task queue is determined according to the task slot. For example, the target time wheel includes 3600 task slots in total, and the minimum time granularity is 1 second. Then the cycle of the target time wheel is 1 hour, and the trigger time of a certain target task is 12:05:05. If the task slot at the 12 o'clock direction of the time wheel is the first task slot, then the task slot corresponding to the target task is the 305th task slot, and the target task queue corresponding to the target task is the task queue corresponding to the 305th task slot. Finally, the target task is added to the task queue corresponding to the 305th task slot on the target time wheel.
[0095] According to an embodiment of the present disclosure, determining the cycle period of the cycle pointer in the target time wheel according to the execution cycle includes:
[0096] The target number of task slots corresponding to the execution cycle on the target time wheel is determined according to the execution cycle, and the cycle period of the loop pointer is determined according to the target number.
[0097] According to the embodiment of the present disclosure, since the interval time between adjacent task slots on the time wheel is determined by the minimum time granularity, the target number of task slots corresponding to the target task can be determined according to the execution cycle and the minimum time granularity. And since the number of task slots on the time wheel is fixed, the cycle period of the loop pointer can be determined according to the target number of task slots.
[0098] For example, if the minimum time granularity of the target time wheel is 1 minute and the number of task slots is 60, the cycle of the target time wheel is 1 hour. If the execution cycle of a target task is two hours and fifteen minutes, then by calculation, the number of target task slots corresponding to the target task is 135, and the cycle of the loop pointer is 2.25 circles around the target time wheel.
[0099] Based on the above data processing method, the present disclosure also provides a data processing device. Figure 5 The device is described in detail.
[0100] Figure 5 The structure block diagram of a data processing device according to an embodiment of the present disclosure is schematically shown.
[0101] like Figure 5 As shown, the data processing device 500 of this embodiment includes a first acquisition module 501 , an adding module 502 , a determining module 503 and a deleting module 504 .
[0102] The first acquisition module 501 is used to acquire the attribute information of the target task, wherein the attribute information includes the inventory occupancy information, trigger time and execution cycle corresponding to the target task. In one embodiment, the first acquisition module 501 can be used to perform the operation S201 described above, which will not be described in detail here.
[0103] Adding module 502 is used for adding the target task to the target task queue of the target time wheel according to the attribute information, wherein the target task queue corresponds to the trigger time, and each task slot in the target time wheel corresponds to a task queue. In one embodiment, adding module 502 can be used to perform the operation S202 described above, which will not be repeated here.
[0104] The determination module 503 is used to determine the cycle period of the cycle pointer in the target time wheel according to the execution cycle. In one embodiment, the determination module 503 can be used to perform the operation S203 described above, which will not be described in detail here.
[0105] The deletion module 504 is used to delete the target task in the target task queue and release the inventory occupancy associated with the inventory occupancy information when the loop pointer reaches the task slot corresponding to the loop period. In one embodiment, the deletion module 504 can be used to perform the operation S204 described above, which will not be repeated here.
[0106] According to an embodiment of the present disclosure, the target task is added to the target task queue of the time wheel according to the trigger time of the target task, the cycle period of the loop pointer in the time wheel is determined according to the execution period of the target task, and when the cycle period is reached, the target task is deleted from the target task queue, and the inventory occupation of the target task is released. Since the target task is deleted according to the delayed task corresponding to the execution period in the time wheel, the processing efficiency and timeliness of the target task can be improved, and the purpose of saving system operation resources is achieved. Thereby, the problem of low processing efficiency and poor timeliness in the related art is at least partially solved.
[0107] According to an embodiment of the present disclosure, the data processing device 500 further includes a second acquisition module, a first generation module, a third acquisition module and a second generation module.
[0108] The second acquisition module is used to acquire a time wheel construction request, wherein the time wheel construction request includes a ring queue template and a preset cycle period.
[0109] The first generating module is used to generate an initial time wheel according to a ring queue template and a preset cycle period in response to a time wheel construction request.
[0110] The third acquisition module is used to acquire a loop pointer generation request, wherein the loop pointer generation request includes preset interval time information, wherein the preset interval time information includes the interval time for the loop pointer to move one task slot in the initial time wheel.
[0111] The second generating module is used to generate a target time wheel according to preset interval time information and an initial time wheel in response to a request for generating a circular pointer.
[0112] According to an embodiment of the present disclosure, the first generating module includes a first determining unit and a first adding unit.
[0113] The first determining unit is used to determine N task slots according to a preset cycle period, wherein N≥1.
[0114] The first adding unit is used to add N task slots to the ring queue template to generate an initial time wheel.
[0115] According to an embodiment of the present disclosure, the second generating module includes a second determining unit, a first generating unit and a second generating unit.
[0116] The second determining unit is used to determine the movement interval time of the circular pointer according to the preset interval time information.
[0117] The first generating unit is used to generate a cyclic pointer according to the moving interval time.
[0118] The second generating unit is used to add the loop pointer to the initial time wheel to generate the target time wheel.
[0119] According to an embodiment of the present disclosure, the adding module 502 includes a third determining unit, a fourth determining unit, and a second adding unit.
[0120] The third determining unit is used to determine a target task slot corresponding to the target task according to the trigger time.
[0121] The fourth determining unit is used to determine the target task queue according to the target task slot.
[0122] The second adding unit is used to add the target task to the target task queue.
[0123] According to an embodiment of the present disclosure, the determination module 503 includes a fifth determination unit and a sixth determination unit.
[0124] The fifth determining unit is used to determine the target number of task slots corresponding to the execution cycle on the target time wheel according to the execution cycle.
[0125] The sixth determining unit is used to determine the cycle period of the cycle pointer according to the target quantity.
[0126] According to an embodiment of the present disclosure, any multiple modules of the first acquisition module 501, the adding module 502, the determining module 503 and the deleting module 504 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first acquisition module 501, the adding module 502, the determining module 503 and the deleting module 504 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the first acquisition module 501, the adding module 502, the determining module 503 and the deleting module 504 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.
[0127] Figure 6 A block diagram of an electronic device suitable for implementing a data processing method according to an embodiment of the present disclosure is schematically shown.
[0128] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0129] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0130] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0131] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0132] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.
[0133] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the item recommendation method provided by the embodiment of the present disclosure.
[0134] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 601. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0135] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0136] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, apparatus, module, unit, etc. described above can be implemented by a computer program module.
[0137] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can 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 can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0138] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0139] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0140] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data processing method, include: Acquire attribute information of the target task, wherein the attribute information includes inventory occupancy information, trigger time, and execution cycle corresponding to the target task; According to the trigger time, the target task is added to the target task queue of the target time wheel, so that the delayed task passing through the target time wheel triggers the target task at the trigger time; wherein the target task queue corresponds to the trigger time, and each task slot in the target time wheel corresponds to a task queue; the target time wheel includes a plurality of task slots in a ring shape, and the number of the task slots is determined according to the average processing time limit and the finest time granularity of the purchase plan, and the interval time of each moving task slot is the same as the finest time granularity; Determine, according to the execution cycle, a target number of the task slots on the target time wheel corresponding to the execution cycle; Determine a cycle period of a circular pointer according to the target number, the cycle period of the circular pointer includes the number of circles around the target time wheel, the circular pointer includes an identification frame or an indicator needle, or displays the circular pointer in a highlighted manner; When the loop pointer reaches the task slot corresponding to the loop period, the target task is deleted from the target task queue, and the inventory occupancy associated with the inventory occupancy information is released.
2. The method according to claim 1, in, The method for constructing the target time wheel includes: Obtaining a time wheel construction request, wherein the time wheel construction request includes a ring queue template and a preset cycle period; In response to the time wheel construction request, generating an initial time wheel according to the ring queue template and the preset cycle period; Obtaining the loop pointer generation request, wherein the loop pointer generation request includes preset interval time information, wherein the preset interval time information includes the interval time for the loop pointer to move each task slot in the initial time wheel; In response to the circular pointer generation request, the target time wheel is generated according to the preset interval time information and the initial time wheel.
3. The method according to claim 2, in, In response to the time wheel construction request, generating an initial time wheel according to the ring queue template and the preset cycle period includes: Determine N of the task slots according to the preset cycle period, where N≥1; Add N of the task slots to the ring queue template to generate the initial time wheel.
4. The method according to claim 2, in, In response to the circular pointer generation request, generating the target time wheel according to the preset interval time information and the initial time wheel includes: Determine the movement interval of the circular pointer according to the preset interval information; Generate the loop pointer according to the moving interval time; The loop pointer is added to the initial time wheel to generate the target time wheel.
5. The method according to claim 1, in, Adding the target task to the target task queue of the target time wheel according to the trigger time includes: Determine the target task slot corresponding to the target task according to the trigger time; Determine the target task queue according to the target task slot; Add the target task to the target task queue.
6. A data processing device, include: A first acquisition module is used to acquire attribute information of a target task, wherein the attribute information includes inventory occupancy information, a trigger time, and an execution period corresponding to the target task; An adding module is used to add the target task to the target task queue of the target time wheel according to the trigger time, so that the delayed task passing through the target time wheel triggers the target task at the trigger time; wherein the target task queue corresponds to the trigger time, and each task slot in the target time wheel corresponds to a task queue; the target time wheel includes a plurality of task slots in a ring shape, and the number of the task slots is determined according to the average processing time limit and the finest time granularity of the purchase plan, and the interval time of each moving task slot is the same as the finest time granularity; a determination module, configured to determine a target number of the task slots on the target time wheel corresponding to the execution cycle according to the execution cycle; determine a cycle period of a loop pointer according to the target number, wherein the cycle period of the loop pointer includes the number of circles around the target time wheel, and the loop pointer includes an identification frame or an indicator needle, or displays the loop pointer in a highlighted manner; The deleting module is used to delete the target task in the target task queue and release the inventory occupancy associated with the inventory occupancy information when the loop pointer reaches the task slot corresponding to the loop period.
7. An electronic device, 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 execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method for steel production contract plan and multi-level inventory matching optimization under MTO-MTS management mode
CN104123587A
Inventory pre-occupation and management system
CN110516990A