WO2022142008A1 - Data processing method and apparatus, electronic device, and storage medium - Google Patents

Data processing method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2022142008A1
WO2022142008A1 PCT/CN2021/090293 CN2021090293W WO2022142008A1 WO 2022142008 A1 WO2022142008 A1 WO 2022142008A1 CN 2021090293 W CN2021090293 W CN 2021090293W WO 2022142008 A1 WO2022142008 A1 WO 2022142008A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
work queue
processed
idle
pool
Prior art date
Application number
PCT/CN2021/090293
Other languages
French (fr)
Chinese (zh)
Inventor
张俊克
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022142008A1 publication Critical patent/WO2022142008A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Definitions

  • the present application relates to data processing, and in particular, to a data processing method, apparatus, electronic device and storage medium.
  • the input and output of data and the calculation are in the same process or thread, and the input and output operations, computing operations and the acquisition of data to be calculated are all processed in the same process or thread.
  • a data processing method comprising:
  • Creating step divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
  • Receiving step receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed.
  • the data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
  • Processing steps determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
  • Feedback step determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  • a data processing device comprising:
  • Creation module Divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
  • Receiving module receives the data processing request sent by the client, obtains the data to be processed in the request, and judges whether the data to be processed is complete based on the preconfigured data protocol.
  • the data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
  • Processing module determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue;
  • Feedback module determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  • the present application also provides an electronic device, the electronic device comprising:
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the steps of:
  • Creating step divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
  • Receiving step receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed.
  • the data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
  • Processing steps determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
  • Feedback step determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  • the present application also provides a computer-readable storage medium, the computer-readable storage medium includes a data processing program, and when the data processing program is executed by a processor, the following steps are implemented:
  • Creating step divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
  • Receiving step receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed.
  • the data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
  • Processing steps determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
  • Feedback step determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  • the present application can reduce the consumption of system resources caused by the contention of locks.
  • FIG. 1 is a schematic diagram of a preferred embodiment of an electronic device for implementing a data processing method in the present application
  • FIG. 2 is a schematic block diagram of a preferred embodiment of the data processing device of the present application.
  • FIG. 3 is a flowchart of a preferred embodiment of the data processing method of the present application.
  • FIG. 1 it is a schematic diagram of a preferred embodiment of an electronic device 1 of the present application.
  • the electronic device 1 includes but is not limited to: a memory 11 , a processor 12 , a display 13 and a network interface 14 .
  • the electronic device 1 is connected to the network through the network interface 14 to obtain original data.
  • the network may be an intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth (Bluetooth), Wi-Fi, call network and other wireless or wired networks.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 , such as a hard disk or a memory of the electronic device 1 .
  • the memory 11 may also be an external storage device of the electronic device 1, for example, a plug-in hard disk equipped with the electronic device 1, a smart memory card (Smart Media Card, SMC), Secure Digital (SD) card, Flash Card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device thereof.
  • the memory 11 is generally used to store the operating system and various types of application software installed in the electronic device 1 , such as program codes of the data processing program 10 and the like.
  • the memory 11 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 12 may be a central processing unit (Central Processing Unit) in some embodiments. Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip.
  • the processor 12 is generally used to control the overall operation of the electronic device 1, such as performing data interaction or communication-related control and processing.
  • the processor 12 is configured to run the program code or process data stored in the memory 11 , for example, run the program code of the data processing program 10 and the like.
  • the display 13 may be referred to as a display screen or a display unit.
  • the display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an organic light emitting diode (Organic Light Emitting Diode). Light-Emitting Diode, OLED) touch device, etc.
  • the display 13 is used for displaying information processed in the electronic device 1 and for displaying a visual working interface, for example, displaying the results of data statistics.
  • the network interface 14 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and the network interface 14 is usually used to establish a communication connection between the electronic device 1 and other electronic devices.
  • FIG 1 only shows the electronic device 1 with components 11-14 and the data processing program 10, but it should be understood that implementation of all of the shown components is not required and that more or less components may be implemented instead.
  • the electronic device 1 may further include a user interface, and the user interface may include a display (Display), an input unit such as a keyboard (Keyboard), and an optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (Organic Light-Emitting Diode, OLED) touch device, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the electronic device 1 may also include a radio frequency (Radio Frequency, RF) circuits, sensors and audio circuits, etc., and will not be repeated here.
  • RF Radio Frequency
  • Creating step divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
  • Receiving step receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed.
  • the data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
  • Processing steps determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
  • Feedback step determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  • the storage device may be the memory 11 of the electronic device 1 , or may be other storage devices communicatively connected to the electronic device 1 .
  • FIG. 2 it is a functional block diagram of the data processing apparatus 100 of the present application.
  • the data processing apparatus 100 described in this application may be installed in an electronic device. According to the implemented functions, the data processing apparatus may include a creation module 110 , a reception module 120 , a processing module 130 and a feedback module 140 .
  • the modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the creating module 110 is configured to divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and respectively create a first work queue corresponding to the first process pool, and a second process pool for the first process pool. The second work queue corresponding to the second process pool.
  • the process pool preconfigured by the electronic device is divided into a process pool for input and output operations and a process pool for computing operations, and a first work queue corresponding to the process pool for input and output operations is created, and a process pool corresponding to the process pool for computing operations is created.
  • the input and output (IO) operations and computing operations are separated and processed separately, which can improve parallel processing capabilities and make full use of the multi-core parallel processing capabilities of modern processors.
  • the divided process pool includes multiple processes. It is a running activity of a program in a computer on a data set, the basic unit of resource allocation and scheduling in the system, and the basis of the operating system structure.
  • a process is a container for threads.
  • the receiving module 120 is configured to receive a data processing request sent by the client, obtain the data to be processed in the request, and judge whether the data to be processed is complete based on a preconfigured data protocol. When the data to be processed is complete, The to-be-processed data is encapsulated into a computing task, and the computing task is stored in the second work queue.
  • the data processing request sent by the client is received, the data to be processed in the request is obtained, and whether the data to be processed is complete is judged based on the pre-configured data protocol, and when the data to be processed is complete, the data to be processed is encapsulated
  • the data to be processed is incomplete
  • the incomplete data will be stored in the first work queue.
  • the complete data to be processed will be stored in the second work queue. Encapsulated into computational tasks. Wherein, judging whether the data to be processed is complete is judged according to a pre-configured data protocol. If there is no idle process in the process pool of the computing operation, the computing task may be stored in the second work queue corresponding to the process pool of the computing operation, thereby avoiding the consumption of locks.
  • the receiving module is further configured to:
  • the data to be processed is incomplete, it is judged whether there is an idle process in the first process pool, and when it is judged that there is no idle process in the first process pool, the data to be processed is stored in the first process pool.
  • a work queue when it is determined that there is an idle process in the first process pool, the idle process is used to receive incomplete data corresponding to the data to be processed.
  • the data to be processed is incomplete, and when there is no idle process in the process pool of the input and output operation, the data to be processed is stored in the first work queue, and the idle process in the process pool of input and output is actively and lock-free.
  • the acquisition reduces the lock contention of process resources in the process pool of input and output processing to a lock-free state, avoiding the problem of low resource utilization caused by lock contention.
  • the data processing apparatus 100 is further configured to:
  • the idle process is set to the default state.
  • the preset state includes a sleep state.
  • the processing module 130 is configured to determine whether there is an idle process in the second process pool, and when it is determined that there is an idle process in the second process pool, use the idle process to read the calculation from the second work queue A task, performing calculation processing on the calculation task based on a preset processing rule to obtain a calculation result, and storing the calculation result in the first work queue.
  • the idle process is used to read the computing task from the second work queue, and based on the pre-
  • the set processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the obtained calculation results in the first work queue.
  • a separate process can enable continuous processing of the computing pipeline without interruption, avoiding idle processes caused by the suspension or interruption of the computing pipeline.
  • system resources include: CPU resources, memory resources, network resources, etc.
  • calculation result obtained by performing calculation processing on the calculation task based on the preset processing rule includes:
  • the identifier of the computing task is acquired, the computing processing rule corresponding to the computing task is searched from a pre-configured mapping table based on the identifier, and a computing result is obtained by performing computing processing on the computing task based on the computing processing rule.
  • the data processing apparatus 100 is further configured to:
  • the computing tasks to be processed are read from the second work queue based on idle processes in the second process pool, and the computing tasks are stored in the second work queue. Execute calculation processing.
  • the preset state includes a sleep state.
  • the feedback module 140 is configured to judge whether there is an idle process in the first process pool, and when it is judged that there is an idle process in the first process pool, use the idle process to read the calculation from the first work queue result, and the calculation result is fed back to the client.
  • the idle process is used to read the calculation result from the first work queue, and the calculation result is fed back to the client, which can eliminate the
  • the process pool acquires the locks that need to be introduced due to concurrency when processing tasks, reducing resource consumption caused by lock contention.
  • the divided input and output operation process pool can be based on the asynchronous callback processing operation implemented by the asynchronous input and output supported by the asynchronous IO mechanism supported by the bottom layer of the operating system.
  • the consumption of threads reduces the consumption of system resources caused by the frequent creation, destruction or scheduling of processes or threads under large concurrency, and improves the utilization rate of system resources by users in the system resources. It should be noted that non-asynchronous IO will wait indefinitely or put the process to sleep when the data transmission is not completed, and continue to perform subsequent operations when the data is received, which makes the process resources used by the current IO occupied.
  • Asynchronous IO uses process or thread resources only after data is received.
  • the feedback module is further used to:
  • the calculation result is encapsulated into a transmission task, and the transmission task is stored in the first work queue until there is an idle process in the first process pool When the transfer operation is performed on the transfer task.
  • FIG. 3 it is a schematic flowchart of a method according to an embodiment of the data processing method of the present application.
  • the processor 12 of the electronic device 1 executes the data processing program 10 stored in the memory 11, the following steps of the data processing method are implemented:
  • Step S10 Divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. The corresponding second work queue.
  • the process pool preconfigured by the electronic device is divided into a process pool for input and output operations and a process pool for computing operations, and a first work queue corresponding to the process pool for input and output operations is created, and a process pool corresponding to the process pool for computing operations is created.
  • the input and output (IO) operations and computing operations are separated and processed separately, which can improve parallel processing capabilities and make full use of the multi-core parallel processing capabilities of modern processors.
  • the divided process pool includes multiple processes. It is a running activity of a program in a computer on a data set, the basic unit of resource allocation and scheduling in the system, and the basis of the operating system structure.
  • a process is a container for threads.
  • Step S20 Receive the data processing request sent by the client, obtain the data to be processed in the request, and judge whether the data to be processed is complete based on a preconfigured data protocol.
  • the data to be processed is encapsulated into computing tasks, and the computing tasks are stored in the second work queue.
  • the data processing request sent by the client is received, the data to be processed in the request is obtained, and whether the data to be processed is complete is judged based on the pre-configured data protocol, and when the data to be processed is complete, the data to be processed is encapsulated
  • the data to be processed is incomplete
  • the incomplete data will be stored in the first work queue.
  • the complete data to be processed will be stored in the second work queue. Encapsulated into computational tasks. Wherein, judging whether the data to be processed is complete is judged according to a pre-configured data protocol. If there is no idle process in the process pool of the computing operation, the computing task may be stored in the second work queue corresponding to the process pool of the computing operation, thereby avoiding the consumption of locks.
  • step S20 further includes:
  • the data to be processed is incomplete, it is judged whether there is an idle process in the first process pool, and when it is judged that there is no idle process in the first process pool, the data to be processed is stored in the first process pool.
  • a work queue when it is determined that there is an idle process in the first process pool, the idle process is used to receive incomplete data corresponding to the data to be processed.
  • the data to be processed is incomplete, and when there is no idle process in the process pool of the input and output operation, the data to be processed is stored in the first work queue, and the idle process in the process pool of input and output is actively and lock-free.
  • the acquisition reduces the lock contention of process resources in the process pool of input and output processing to a lock-free state, avoiding the problem of low resource utilization caused by lock contention.
  • the method further includes:
  • the data in the first process pool is stored.
  • the idle process is set to the default state.
  • the preset state includes a sleep state.
  • Step S30 judging whether there is an idle process in the second process pool, and when judging that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue.
  • the idle process is used to read the computing task from the second work queue, and based on the pre-
  • the set processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the obtained calculation results in the first work queue.
  • a separate process can enable continuous processing of the computing pipeline without interruption, avoiding idle processes caused by the suspension or interruption of the computing pipeline.
  • system resources include: CPU resources, memory resources, network resources, etc.
  • calculation result obtained by performing calculation processing on the calculation task based on the preset processing rule includes:
  • the identifier of the computing task is acquired, the computing processing rule corresponding to the computing task is searched from a pre-configured mapping table based on the identifier, and a computing result is obtained by performing computing processing on the computing task based on the computing processing rule.
  • step S30 the method further includes:
  • the computing tasks to be processed are read from the second work queue based on idle processes in the second process pool, and the computing tasks are stored in the second work queue. Execute calculation processing.
  • the preset state includes a sleep state.
  • Step S40 Determine whether there is an idle process in the first process pool, and when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  • the idle process is used to read the calculation result from the first work queue, and the calculation result is fed back to the client, which can eliminate the
  • the process pool acquires the locks that need to be introduced due to concurrency when processing tasks, reducing resource consumption caused by lock contention.
  • the divided input and output operation process pool can be based on the asynchronous callback processing operation implemented by the asynchronous input and output supported by the asynchronous IO mechanism supported by the bottom layer of the operating system.
  • the consumption of threads reduces the consumption of system resources caused by the frequent creation, destruction or scheduling of processes or threads under large concurrency, and improves the utilization rate of system resources by users in the system resources. It should be noted that non-asynchronous IO will wait indefinitely or put the process to sleep when the data transmission is not completed, and continue to perform subsequent operations when the data is received, which makes the process resources used by the current IO occupied.
  • Asynchronous IO uses process or thread resources only after data is received.
  • step S40 further includes:
  • the calculation result is encapsulated into a transmission task, and the transmission task is stored in the first work queue until there is an idle process in the first process pool When the transfer operation is performed on the transfer task.
  • an embodiment of the present application also proposes a computer-readable storage medium, which may be volatile or non-volatile, and the computer-readable storage medium may be a hard disk, a multimedia card, a Any of SD Card, Flash Card, SMC, Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM), Portable Compact Disc Read Only Memory (CD-ROM), USB memory, etc. or any combination of several.
  • the computer-readable storage medium includes a data processing program 10, and the data processing program 10 implements the following operations when executed by the processor:
  • Creating step divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
  • Receiving step receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed.
  • the data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
  • Processing steps determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
  • Feedback step determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  • the data to be processed and the computing tasks can also be stored in a node of a blockchain.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation.
  • the technical solutions of the present application can be embodied in the form of software products in essence or the parts that make contributions to the prior art.
  • the computer software products are stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disk), including several instructions to make a terminal device (which may be a mobile phone, a computer, an electronic device, or a network device, etc.) to execute the methods described in the various embodiments of the present application.

Abstract

A data processing method and apparatus, an electronic device, and a storage medium. The method comprises: dividing a preset process pool into a first process pool of an input/output operation and a second process pool of a computation operation, and respectively creating a corresponding first work queue and a corresponding second work queue; when a data processing request is received, determining whether data to be processed is complete, and if yes, encapsulating the data to be processed as a computing task and storing same in the second work queue; determining whether an idle process is present in the second process pool, and if an idle process is present in the second process pool, using the idle process to read the computing task from the second work queue and then performing computation processing to obtain a computation result, and then storing the computation result in the first work queue; and determining whether an idle process is present in the first process pool, and if an idle process is present in the first process pool, using the idle process to read the computation result from the first work queue. According to the method, an adequate parallel processing capability can be provided, and the resource consumption of a system is reduced.

Description

数据处理方法、装置、电子设备及存储介质Data processing method, device, electronic device and storage medium
本申请要求于2020年12月30日提交中国专利局、申请号为CN202011622579.7,发明名称为“数据处理方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number CN202011622579.7 and the invention titled "Data Processing Method, Device, Electronic Device and Storage Medium", which was submitted to the China Patent Office on December 30, 2020, the entire content of which is approved by Reference is incorporated in this application.
技术领域technical field
本申请涉及数据处理,尤其涉及一种数据处理方法、装置、电子设备及存储介质。The present application relates to data processing, and in particular, to a data processing method, apparatus, electronic device and storage medium.
背景技术Background technique
目前的计算服务中间件系统,其数据的输入输出与计算处于同一个进程或者线程当中,输入输出操作、计算操作以及待计算数据的获取都在同一个进程或者线程中处理。In the current computing service middleware system, the input and output of data and the calculation are in the same process or thread, and the input and output operations, computing operations and the acquisition of data to be calculated are all processed in the same process or thread.
技术问题technical problem
发明人意识到由于输入输出与计算所使用的资源是共享,当输入输出端的性能不对称时,将导致输入输出处理消耗大量的计算资源,降低了系统的处理能力,且由于输入输出与计算的共享,当有大量的输入输出在单位时间内需要处理时,输入输出使用的资源占比将远大于计算所使用的资源,在大并发时,会导致系统分配更多的资源来协调进程或者线程的切换。The inventor realized that since the resources used for input and output and computing are shared, when the performance of the input and output terminals is asymmetrical, the input and output processing will consume a large amount of computing resources, reducing the processing capacity of the system, and due to the difference between input and output and computing. Sharing, when a large amount of input and output needs to be processed in a unit time, the proportion of resources used by input and output will be much larger than the resources used by computing, and in the case of large concurrency, the system will allocate more resources to coordinate processes or threads. switch.
技术解决方案technical solutions
一种数据处理方法,该方法包括:A data processing method comprising:
创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
一种数据处理装置,所述装置包括:A data processing device comprising:
创建模块:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creation module: Divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
接收模块:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving module: receives the data processing request sent by the client, obtains the data to be processed in the request, and judges whether the data to be processed is complete based on the preconfigured data protocol. The data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
处理模块:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing module: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
反馈模块:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback module: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
为实现上述目的,本申请还提供一种电子设备,所述电子设备包括:To achieve the above purpose, the present application also provides an electronic device, the electronic device comprising:
至少一个处理器;以及,at least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器执行如下步骤:The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the steps of:
创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中包括数据处理程序,所述数据处理程序被处理器执行时,实现如下步骤:To achieve the above purpose, the present application also provides a computer-readable storage medium, the computer-readable storage medium includes a data processing program, and when the data processing program is executed by a processor, the following steps are implemented:
创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
本申请可以减少由于锁的争抢引起的系统资源的消耗。The present application can reduce the consumption of system resources caused by the contention of locks.
附图说明Description of drawings
图1为本申请实现数据处理方法的电子设备较佳实施例的示意图;1 is a schematic diagram of a preferred embodiment of an electronic device for implementing a data processing method in the present application;
图2为本申请数据处理装置较佳实施例的模块示意图;FIG. 2 is a schematic block diagram of a preferred embodiment of the data processing device of the present application;
图3为本申请数据处理方法较佳实施例的流程图;3 is a flowchart of a preferred embodiment of the data processing method of the present application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
本发明的实施方式Embodiments of the present invention
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
参照图1所示,为本申请电子设备1较佳实施例的示意图。Referring to FIG. 1 , it is a schematic diagram of a preferred embodiment of an electronic device 1 of the present application.
该电子设备1包括但不限于:存储器11、处理器12、显示器13及网络接口14。所述电子设备1通过网络接口14连接网络,获取原始数据。其中,所述网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi、通话网络等无线或有线网络。The electronic device 1 includes but is not limited to: a memory 11 , a processor 12 , a display 13 and a network interface 14 . The electronic device 1 is connected to the network through the network interface 14 to obtain original data. The network may be an intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth (Bluetooth), Wi-Fi, call network and other wireless or wired networks.
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器11可以是所述电子设备1的内部存储单元,例如该电子设备1的硬盘或内存。在另一些实施例中,所述存储器11也可以是所述电子设备1的外部存储设备,例如该电子设备1配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。当然,所述存储器11还可以既包括所述电子设备1的内部存储单元也包括其外部存储设备。本实施例中,存储器11通常用于存储安装于所述电子设备1的操作系统和各类应用软件,例如数据处理程序10的程序代码等。此外,存储器11还可以用于暂时地存储已经输出或者将要输出的各类数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1 , such as a hard disk or a memory of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, for example, a plug-in hard disk equipped with the electronic device 1, a smart memory card (Smart Media Card, SMC), Secure Digital (SD) card, Flash Card (Flash Card), etc. Of course, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device thereof. In this embodiment, the memory 11 is generally used to store the operating system and various types of application software installed in the electronic device 1 , such as program codes of the data processing program 10 and the like. In addition, the memory 11 can also be used to temporarily store various types of data that have been output or will be output.
处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器12通常用于控制所述电子设备1的总体操作,例如执行数据交互或者通信相关的控制和处理等。本实施例中,所述处理器12用于运行所述存储器11中存储的程序代码或者处理数据,例如运行数据处理程序10的程序代码等。The processor 12 may be a central processing unit (Central Processing Unit) in some embodiments. Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 12 is generally used to control the overall operation of the electronic device 1, such as performing data interaction or communication-related control and processing. In this embodiment, the processor 12 is configured to run the program code or process data stored in the memory 11 , for example, run the program code of the data processing program 10 and the like.
显示器13可以称为显示屏或显示单元。在一些实施例中显示器13可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)触摸器等。显示器13用于显示在电子设备1中处理的信息以及用于显示可视化的工作界面,例如显示数据统计的结果。The display 13 may be referred to as a display screen or a display unit. In some embodiments, the display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an organic light emitting diode (Organic Light Emitting Diode). Light-Emitting Diode, OLED) touch device, etc. The display 13 is used for displaying information processed in the electronic device 1 and for displaying a visual working interface, for example, displaying the results of data statistics.
网络接口14可选地可以包括标准的有线接口、无线接口(如WI-FI接口),该网络接口14通常用于在所述电子设备1与其它电子设备之间建立通信连接。The network interface 14 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and the network interface 14 is usually used to establish a communication connection between the electronic device 1 and other electronic devices.
图1仅示出了具有组件11-14以及数据处理程序10的电子设备1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。Figure 1 only shows the electronic device 1 with components 11-14 and the data processing program 10, but it should be understood that implementation of all of the shown components is not required and that more or less components may be implemented instead.
可选地,所述电子设备1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a user interface, and the user interface may include a display (Display), an input unit such as a keyboard (Keyboard), and an optional user interface may further include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (Organic Light-Emitting Diode, OLED) touch device, and the like. The display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
该电子设备1还可以包括射频(Radio Frequency,RF)电路、传感器和音频电路等等,在此不再赘述。The electronic device 1 may also include a radio frequency (Radio Frequency, RF) circuits, sensors and audio circuits, etc., and will not be repeated here.
在上述实施例中,处理器12执行存储器11中存储的数据处理程序10时可以实现如下步骤:In the above embodiment, when the processor 12 executes the data processing program 10 stored in the memory 11, the following steps may be implemented:
创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
所述存储设备可以为电子设备1的存储器11,也可以为与电子设备1通讯连接的其它存储设备。The storage device may be the memory 11 of the electronic device 1 , or may be other storage devices communicatively connected to the electronic device 1 .
关于上述步骤的详细介绍,请参照下述图2关于数据处理装置100实施例的功能模块图以及图3关于数据处理方法实施例的流程图的说明。For a detailed introduction of the above steps, please refer to the following description of the functional block diagram of the embodiment of the data processing apparatus 100 in FIG. 2 and the flowchart of the embodiment of the data processing method in FIG. 3 .
参照图2所示,为本申请数据处理装置100的功能模块图。Referring to FIG. 2 , it is a functional block diagram of the data processing apparatus 100 of the present application.
本申请所述数据处理装置100可以安装于电子设备中。根据实现的功能,所述数据处理装置可以包括创建模块110、接收模块120、处理模块130及反馈模块140。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The data processing apparatus 100 described in this application may be installed in an electronic device. According to the implemented functions, the data processing apparatus may include a creation module 110 , a reception module 120 , a processing module 130 and a feedback module 140 . The modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
创建模块110,用于将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列。The creating module 110 is configured to divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and respectively create a first work queue corresponding to the first process pool, and a second process pool for the first process pool. The second work queue corresponding to the second process pool.
在本实施例中,将电子设备预先配置的进程池划分为输入输出操作的进程池及计算操作的进程池,创建输入输出操作进程池对应的第一工作队列,及计算操作的进程池对应的第二工作队列。将输入输出(Input Output,IO)操作和计算操作,进行分离拆分后分别处理,可以提高并行处理能力,充分利用现代处理器的多核并行处理能力,划分的进程池中包括多个进程,进程是计算机中的程序关于数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。在面向线程设计的计算机结构中,进程是线程的容器。In this embodiment, the process pool preconfigured by the electronic device is divided into a process pool for input and output operations and a process pool for computing operations, and a first work queue corresponding to the process pool for input and output operations is created, and a process pool corresponding to the process pool for computing operations is created. Second work queue. The input and output (IO) operations and computing operations are separated and processed separately, which can improve parallel processing capabilities and make full use of the multi-core parallel processing capabilities of modern processors. The divided process pool includes multiple processes. It is a running activity of a program in a computer on a data set, the basic unit of resource allocation and scheduling in the system, and the basis of the operating system structure. In a thread-oriented computer architecture, a process is a container for threads.
接收模块120,用于接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列。The receiving module 120 is configured to receive a data processing request sent by the client, obtain the data to be processed in the request, and judge whether the data to be processed is complete based on a preconfigured data protocol. When the data to be processed is complete, The to-be-processed data is encapsulated into a computing task, and the computing task is stored in the second work queue.
在本实施例中,接收客户端发出的数据处理请求,获取请求中待处理的数据,基于预先配置的数据协议判断待处理数据是否完整,当待处理的数据完整时,将待处理的数据封装成计算任务,并将计算任务存储至第二工作队列,当待处理的数据不完整时,则将不完整的数据存储至第一工作队列,等数据接收完整后,再将完整的待处理数据封装成计算任务。其中,判断待处理的数据是否完整是根据预先配置的数据协议判断的。若计算操作的进程池中没有空闲的进程,则可以将计算任务存储至计算操作的进程池对应的第二工作队列中,可以避免锁的消耗。In this embodiment, the data processing request sent by the client is received, the data to be processed in the request is obtained, and whether the data to be processed is complete is judged based on the pre-configured data protocol, and when the data to be processed is complete, the data to be processed is encapsulated When the data to be processed is incomplete, the incomplete data will be stored in the first work queue. After the data is received completely, the complete data to be processed will be stored in the second work queue. Encapsulated into computational tasks. Wherein, judging whether the data to be processed is complete is judged according to a pre-configured data protocol. If there is no idle process in the process pool of the computing operation, the computing task may be stored in the second work queue corresponding to the process pool of the computing operation, thereby avoiding the consumption of locks.
在一个实施例中,所述接收模块还用于:In one embodiment, the receiving module is further configured to:
当判断所述待处理数据不完整时,判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中不存在空闲进程时,将所述待处理数据存储至所述第一工作队列,当判断所述第一进程池中存在空闲进程时,利用该空闲进程接收所述待处理数据对应的不完整数据。When it is judged that the data to be processed is incomplete, it is judged whether there is an idle process in the first process pool, and when it is judged that there is no idle process in the first process pool, the data to be processed is stored in the first process pool. A work queue, when it is determined that there is an idle process in the first process pool, the idle process is used to receive incomplete data corresponding to the data to be processed.
待处理数据未完整时,且当输入输出操作的进程池中不存在空闲进程时,将待处理数据存储至第一工作队列中,由输入输出的进程池中的空闲进程主动地,无锁地获取,使得输入输出处理的进程池中的进程资源的锁争抢减少至无锁状态,避免了由于锁的争抢导致的资源利用率低下的问题。When the data to be processed is incomplete, and when there is no idle process in the process pool of the input and output operation, the data to be processed is stored in the first work queue, and the idle process in the process pool of input and output is actively and lock-free. The acquisition reduces the lock contention of process resources in the process pool of input and output processing to a lock-free state, avoiding the problem of low resource utilization caused by lock contention.
在一个实施例中,所述数据处理装置100还用于:In one embodiment, the data processing apparatus 100 is further configured to:
判断所述第一工作队列是否存储有待处理数据或待反馈的计算结果,当判断所述第一工作队列均未存储有待处理数据及待反馈的计算结果时,将所述第一进程池中的空闲进程设为预设状态。其中,预设状态包括休眠状态。Judging whether the first work queue stores data to be processed or calculation results to be fed back, when it is judged that the first work queue does not store data to be processed and calculation results to be fed back, the data in the first process pool is stored. The idle process is set to the default state. The preset state includes a sleep state.
处理模块130,用于判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列。The processing module 130 is configured to determine whether there is an idle process in the second process pool, and when it is determined that there is an idle process in the second process pool, use the idle process to read the calculation from the second work queue A task, performing calculation processing on the calculation task based on a preset processing rule to obtain a calculation result, and storing the calculation result in the first work queue.
在本实施例中,判断计算操作的进程池中是否存在空闲的进程,当计算操作的进程池中存在空闲的进程时,利用该空闲的进程从第二工作队列中读取计算任务,基于预设的处理规则对计算任务执行计算处理得到计算结果,并将得到的计算结果存储至第一工作队列中。In this embodiment, it is judged whether there is an idle process in the process pool of the computing operation, and when there is an idle process in the process pool of the computing operation, the idle process is used to read the computing task from the second work queue, and based on the pre- The set processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the obtained calculation results in the first work queue.
由于计算操作计算密集的特性,划分的计算操作的进程池在待计算数据完整的情况下,单独的进程可以使计算流水线不中断的连续处理,避免了由于计算流水线的暂停或者中断导致空闲的进程不能提供服务的情况,也避免了由于进程由于暂停或者中断引起的频繁的系统资源调度导致系统消耗的资源的问题,提高了系统资源的使用率,其中,系统资源包括:CPU资源、内存资源、网络资源等。Due to the computationally intensive nature of computing operations, when the process pool of divided computing operations has complete data to be computed, a separate process can enable continuous processing of the computing pipeline without interruption, avoiding idle processes caused by the suspension or interruption of the computing pipeline. In the case of inability to provide services, it also avoids the problem of system resource consumption caused by frequent system resource scheduling caused by process suspension or interruption, and improves the utilization rate of system resources, among which system resources include: CPU resources, memory resources, network resources, etc.
创建计算操作的进程对应的第二工作队列,将计算准备就绪的计算任务存储至第二工作队列中,由计算处理的进程主动地,无锁地获取计算任务,使得输入输出操作的进程池中的进程资源的锁争抢减少至无锁状态,减少由于锁的争抢导致的系统资源的非功能性消耗。需要说明的是,现有技术中多个工作进程在获取任务时,为防止重复处理,需要在任务获取的时候,对获取任务时进行一定的加锁处理,预防资源的不一致或者重复。Create a second work queue corresponding to the process of the calculation operation, store the calculation tasks that are ready for calculation in the second work queue, and the process of the calculation processing actively acquires the calculation tasks without locks, so that the process pool of the input and output operations is in the process pool. The lock contention of the process resources is reduced to a lock-free state, reducing the non-functional consumption of system resources due to lock contention. It should be noted that in the prior art, when multiple worker processes acquire tasks, in order to prevent repeated processing, certain locking processing needs to be performed when acquiring tasks to prevent inconsistency or duplication of resources.
进一步的,所述基于预设的处理规则对所述计算任务执行计算处理得到计算结果包括:Further, the calculation result obtained by performing calculation processing on the calculation task based on the preset processing rule includes:
获取所述计算任务的标识,基于所述标识从预先配置的映射关系表中查找所述计算任务对应的计算处理规则,基于所述计算处理规则对所述计算任务执行计算处理得到计算结果。The identifier of the computing task is acquired, the computing processing rule corresponding to the computing task is searched from a pre-configured mapping table based on the identifier, and a computing result is obtained by performing computing processing on the computing task based on the computing processing rule.
在一个实施例中,所述数据处理装置100还用于:In one embodiment, the data processing apparatus 100 is further configured to:
判断所述第二工作队列是否存储有待处理的计算任务,当判断所述第二工作队列未存储有待处理的计算任务时,将所述第二进程池中的空闲进程设为预设状态;Judging whether the second work queue stores computing tasks to be processed, and when judging that the second work queue does not store computing tasks to be processed, setting the idle processes in the second process pool to a preset state;
当判断所述第二工作队列存储有待处理的计算任务时,基于所述第二进程池中的空闲进程从所述第二工作队列中读取所述待处理的计算任务,并对该计算任务执行计算处理。其中,预设状态包括休眠状态。When judging that the second work queue stores computing tasks to be processed, the computing tasks to be processed are read from the second work queue based on idle processes in the second process pool, and the computing tasks are stored in the second work queue. Execute calculation processing. The preset state includes a sleep state.
反馈模块140,用于判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。The feedback module 140 is configured to judge whether there is an idle process in the first process pool, and when it is judged that there is an idle process in the first process pool, use the idle process to read the calculation from the first work queue result, and the calculation result is fed back to the client.
在本实施例中,判断输入输出操作的进程池中是否存在空闲的进程,若存在,利用该空闲进程从第一工作队列中读取计算结果,将计算结果反馈至所述客户端,可以消除进程池获取处理任务时由于并发需要引入的锁,减少由于锁的争抢导致的资源消耗。In this embodiment, it is judged whether there is an idle process in the process pool of input and output operations, and if so, the idle process is used to read the calculation result from the first work queue, and the calculation result is fed back to the client, which can eliminate the The process pool acquires the locks that need to be introduced due to concurrency when processing tasks, reducing resource consumption caused by lock contention.
由于输入输出操作具有的等待的特性,划分出的输入输出操作进程池可基于操作系统底层支持的异步IO机制支持的异步的输入输出实现的异步回调处理操作,解决由于输入输出等待导致的进程或者线程的消耗,减少大并发下由于进程或者线程的频繁创建、销毁或调度带来的系统资源的消耗,提高系统资源中用户对系统资源的使用率。需要说明的是,非异步IO在数据传送还未完成时,会无限等待或者使进程睡眠,等到数据接收完毕时,才继续进行后续的操作,这就使得当前IO使用的进程资源被占用。异步IO会在数据接收到后才使用进程或者线程资源。Due to the waiting characteristics of input and output operations, the divided input and output operation process pool can be based on the asynchronous callback processing operation implemented by the asynchronous input and output supported by the asynchronous IO mechanism supported by the bottom layer of the operating system. The consumption of threads reduces the consumption of system resources caused by the frequent creation, destruction or scheduling of processes or threads under large concurrency, and improves the utilization rate of system resources by users in the system resources. It should be noted that non-asynchronous IO will wait indefinitely or put the process to sleep when the data transmission is not completed, and continue to perform subsequent operations when the data is received, which makes the process resources used by the current IO occupied. Asynchronous IO uses process or thread resources only after data is received.
在划分出来的输入输出操作的进程池上,设置对应的第一工作队列,将输入输出就绪的计算结果存储至对应的第一工作队列中,由输入输出的处理进程主动地,无锁地取,使得输入输出处理的进程池中的进程或者线程资源的锁争抢减少到至无锁状态,大大减少由于锁的争抢导致的资源利用率低下。On the divided process pool of input and output operations, set the corresponding first work queue, and store the calculation result of the input and output ready in the corresponding first work queue, and the input and output processing process will take the initiative and lock-free, The lock contention of the process or thread resources in the process pool of input and output processing is reduced to a lock-free state, which greatly reduces the low resource utilization rate caused by the lock contention.
在一个实施例中,所述反馈模块还用于:In one embodiment, the feedback module is further used to:
当判断所述第一进程池中不存在空闲进程时,将所述计算结果封装成传输任务,将所述传输任务存储至所述第一工作队列,直至所述第一进程池中存在空闲进程时对所述传输任务执行传输操作。When it is determined that there is no idle process in the first process pool, the calculation result is encapsulated into a transmission task, and the transmission task is stored in the first work queue until there is an idle process in the first process pool When the transfer operation is performed on the transfer task.
此外,本申请还提供一种数据处理方法。参照图3所示,为本申请数据处理方法的实施例的方法流程示意图。电子设备1的处理器12执行存储器11中存储的数据处理程序10时实现数据处理方法的如下步骤:In addition, the present application also provides a data processing method. Referring to FIG. 3 , it is a schematic flowchart of a method according to an embodiment of the data processing method of the present application. When the processor 12 of the electronic device 1 executes the data processing program 10 stored in the memory 11, the following steps of the data processing method are implemented:
步骤S10:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列。Step S10: Divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. The corresponding second work queue.
在本实施例中,将电子设备预先配置的进程池划分为输入输出操作的进程池及计算操作的进程池,创建输入输出操作进程池对应的第一工作队列,及计算操作的进程池对应的第二工作队列。将输入输出(Input Output,IO)操作和计算操作,进行分离拆分后分别处理,可以提高并行处理能力,充分利用现代处理器的多核并行处理能力,划分的进程池中包括多个进程,进程是计算机中的程序关于数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。在面向线程设计的计算机结构中,进程是线程的容器。In this embodiment, the process pool preconfigured by the electronic device is divided into a process pool for input and output operations and a process pool for computing operations, and a first work queue corresponding to the process pool for input and output operations is created, and a process pool corresponding to the process pool for computing operations is created. Second work queue. The input and output (IO) operations and computing operations are separated and processed separately, which can improve parallel processing capabilities and make full use of the multi-core parallel processing capabilities of modern processors. The divided process pool includes multiple processes. It is a running activity of a program in a computer on a data set, the basic unit of resource allocation and scheduling in the system, and the basis of the operating system structure. In a thread-oriented computer architecture, a process is a container for threads.
步骤S20:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列。Step S20: Receive the data processing request sent by the client, obtain the data to be processed in the request, and judge whether the data to be processed is complete based on a preconfigured data protocol. The data to be processed is encapsulated into computing tasks, and the computing tasks are stored in the second work queue.
在本实施例中,接收客户端发出的数据处理请求,获取请求中待处理的数据,基于预先配置的数据协议判断待处理数据是否完整,当待处理的数据完整时,将待处理的数据封装成计算任务,并将计算任务存储至第二工作队列,当待处理的数据不完整时,则将不完整的数据存储至第一工作队列,等数据接收完整后,再将完整的待处理数据封装成计算任务。其中,判断待处理的数据是否完整是根据预先配置的数据协议判断的。若计算操作的进程池中没有空闲的进程,则可以将计算任务存储至计算操作的进程池对应的第二工作队列中,可以避免锁的消耗。In this embodiment, the data processing request sent by the client is received, the data to be processed in the request is obtained, and whether the data to be processed is complete is judged based on the pre-configured data protocol, and when the data to be processed is complete, the data to be processed is encapsulated When the data to be processed is incomplete, the incomplete data will be stored in the first work queue. After the data is received completely, the complete data to be processed will be stored in the second work queue. Encapsulated into computational tasks. Wherein, judging whether the data to be processed is complete is judged according to a pre-configured data protocol. If there is no idle process in the process pool of the computing operation, the computing task may be stored in the second work queue corresponding to the process pool of the computing operation, thereby avoiding the consumption of locks.
在一个实施例中,步骤S20还包括:In one embodiment, step S20 further includes:
当判断所述待处理数据不完整时,判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中不存在空闲进程时,将所述待处理数据存储至所述第一工作队列,当判断所述第一进程池中存在空闲进程时,利用该空闲进程接收所述待处理数据对应的不完整数据。When it is judged that the data to be processed is incomplete, it is judged whether there is an idle process in the first process pool, and when it is judged that there is no idle process in the first process pool, the data to be processed is stored in the first process pool. A work queue, when it is determined that there is an idle process in the first process pool, the idle process is used to receive incomplete data corresponding to the data to be processed.
待处理数据未完整时,且当输入输出操作的进程池中不存在空闲进程时,将待处理数据存储至第一工作队列中,由输入输出的进程池中的空闲进程主动地,无锁地获取,使得输入输出处理的进程池中的进程资源的锁争抢减少至无锁状态,避免了由于锁的争抢导致的资源利用率低下的问题。When the data to be processed is incomplete, and when there is no idle process in the process pool of the input and output operation, the data to be processed is stored in the first work queue, and the idle process in the process pool of input and output is actively and lock-free. The acquisition reduces the lock contention of process resources in the process pool of input and output processing to a lock-free state, avoiding the problem of low resource utilization caused by lock contention.
在一个实施例中,所述方法还包括:In one embodiment, the method further includes:
判断所述第一工作队列是否存储有待处理数据或待反馈的计算结果,当判断所述第一工作队列均未存储有待处理数据及待反馈的计算结果时,将所述第一进程池中的空闲进程设为预设状态。其中,所述预设状态包括休眠状态。Judging whether the first work queue stores data to be processed or calculation results to be fed back, when it is judged that the first work queue does not store data to be processed and calculation results to be fed back, the data in the first process pool is stored. The idle process is set to the default state. Wherein, the preset state includes a sleep state.
步骤S30:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列。Step S30: judging whether there is an idle process in the second process pool, and when judging that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue.
在本实施例中,判断计算操作的进程池中是否存在空闲的进程,当计算操作的进程池中存在空闲的进程时,利用该空闲的进程从第二工作队列中读取计算任务,基于预设的处理规则对计算任务执行计算处理得到计算结果,并将得到的计算结果存储至第一工作队列中。In this embodiment, it is judged whether there is an idle process in the process pool of the computing operation, and when there is an idle process in the process pool of the computing operation, the idle process is used to read the computing task from the second work queue, and based on the pre- The set processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the obtained calculation results in the first work queue.
由于计算操作计算密集的特性,划分的计算操作的进程池在待计算数据完整的情况下,单独的进程可以使计算流水线不中断的连续处理,避免了由于计算流水线的暂停或者中断导致空闲的进程不能提供服务的情况,也避免了由于进程由于暂停或者中断引起的频繁的系统资源调度导致系统消耗的资源的问题,提高了系统资源的使用率,其中,系统资源包括:CPU资源、内存资源、网络资源等。Due to the computationally intensive nature of computing operations, when the process pool of divided computing operations has complete data to be computed, a separate process can enable continuous processing of the computing pipeline without interruption, avoiding idle processes caused by the suspension or interruption of the computing pipeline. In the case of inability to provide services, it also avoids the problem of system resource consumption caused by frequent system resource scheduling caused by process suspension or interruption, and improves the utilization rate of system resources, among which system resources include: CPU resources, memory resources, network resources, etc.
创建计算操作的进程对应的第二工作队列,将计算准备就绪的计算任务存储至第二工作队列中,由计算处理的进程主动地,无锁地获取计算任务,使得输入输出操作的进程池中的进程资源的锁争抢减少至无锁状态,减少由于锁的争抢导致的系统资源的非功能性消耗。需要说明的是,现有技术中多个工作进程在获取任务时,为防止重复处理,需要在任务获取的时候,对获取任务时进行一定的加锁处理,预防资源的不一致或者重复。Create a second work queue corresponding to the process of the calculation operation, store the calculation tasks that are ready for calculation in the second work queue, and the process of the calculation processing actively acquires the calculation tasks without locks, so that the process pool of the input and output operations is in the process pool. The lock contention of the process resources is reduced to a lock-free state, reducing the non-functional consumption of system resources due to lock contention. It should be noted that in the prior art, when multiple worker processes acquire tasks, in order to prevent repeated processing, certain locking processing needs to be performed when acquiring tasks to prevent inconsistency or duplication of resources.
进一步的,所述基于预设的处理规则对所述计算任务执行计算处理得到计算结果包括:Further, the calculation result obtained by performing calculation processing on the calculation task based on the preset processing rule includes:
获取所述计算任务的标识,基于所述标识从预先配置的映射关系表中查找所述计算任务对应的计算处理规则,基于所述计算处理规则对所述计算任务执行计算处理得到计算结果。The identifier of the computing task is acquired, the computing processing rule corresponding to the computing task is searched from a pre-configured mapping table based on the identifier, and a computing result is obtained by performing computing processing on the computing task based on the computing processing rule.
在一个实施例中,在步骤S30之后,该方法还包括:In one embodiment, after step S30, the method further includes:
判断所述第二工作队列是否存储有待处理的计算任务,当判断所述第二工作队列未存储有待处理的计算任务时,将所述第二进程池中的空闲进程设为预设状态;Judging whether the second work queue stores computing tasks to be processed, and when judging that the second work queue does not store computing tasks to be processed, setting the idle processes in the second process pool to a preset state;
当判断所述第二工作队列存储有待处理的计算任务时,基于所述第二进程池中的空闲进程从所述第二工作队列中读取所述待处理的计算任务,并对该计算任务执行计算处理。其中,预设状态包括休眠状态。When judging that the second work queue stores computing tasks to be processed, the computing tasks to be processed are read from the second work queue based on idle processes in the second process pool, and the computing tasks are stored in the second work queue. Execute calculation processing. The preset state includes a sleep state.
步骤S40:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Step S40: Determine whether there is an idle process in the first process pool, and when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
在本实施例中,判断输入输出操作的进程池中是否存在空闲的进程,若存在,利用该空闲进程从第一工作队列中读取计算结果,将计算结果反馈至所述客户端,可以消除进程池获取处理任务时由于并发需要引入的锁,减少由于锁的争抢导致的资源消耗。In this embodiment, it is judged whether there is an idle process in the process pool of input and output operations, and if so, the idle process is used to read the calculation result from the first work queue, and the calculation result is fed back to the client, which can eliminate the The process pool acquires the locks that need to be introduced due to concurrency when processing tasks, reducing resource consumption caused by lock contention.
由于输入输出操作具有的等待的特性,划分出的输入输出操作进程池可基于操作系统底层支持的异步IO机制支持的异步的输入输出实现的异步回调处理操作,解决由于输入输出等待导致的进程或者线程的消耗,减少大并发下由于进程或者线程的频繁创建、销毁或调度带来的系统资源的消耗,提高系统资源中用户对系统资源的使用率。需要说明的是,非异步IO在数据传送还未完成时,会无限等待或者使进程睡眠,等到数据接收完毕时,才继续进行后续的操作,这就使得当前IO使用的进程资源被占用。异步IO会在数据接收到后才使用进程或者线程资源。Due to the waiting characteristics of input and output operations, the divided input and output operation process pool can be based on the asynchronous callback processing operation implemented by the asynchronous input and output supported by the asynchronous IO mechanism supported by the bottom layer of the operating system. The consumption of threads reduces the consumption of system resources caused by the frequent creation, destruction or scheduling of processes or threads under large concurrency, and improves the utilization rate of system resources by users in the system resources. It should be noted that non-asynchronous IO will wait indefinitely or put the process to sleep when the data transmission is not completed, and continue to perform subsequent operations when the data is received, which makes the process resources used by the current IO occupied. Asynchronous IO uses process or thread resources only after data is received.
在划分出来的输入输出操作的进程池上,设置对应的第一工作队列,将输入输出就绪的计算结果存储至对应的第一工作队列中,由输入输出的处理进程主动地,无锁地取,使得输入输出处理的进程池中的进程或者线程资源的锁争抢减少到至无锁状态,大大减少由于锁的争抢导致的资源利用率低下。On the divided process pool of input and output operations, set the corresponding first work queue, and store the calculation result of the input and output ready in the corresponding first work queue, and the input and output processing process will take the initiative and lock-free, The lock contention of the process or thread resources in the process pool of input and output processing is reduced to a lock-free state, which greatly reduces the low resource utilization rate caused by the lock contention.
在一个实施例中,步骤S40还包括:In one embodiment, step S40 further includes:
当判断所述第一进程池中不存在空闲进程时,将所述计算结果封装成传输任务,将所述传输任务存储至所述第一工作队列,直至所述第一进程池中存在空闲进程时对所述传输任务执行传输操作。When it is determined that there is no idle process in the first process pool, the calculation result is encapsulated into a transmission task, and the transmission task is stored in the first work queue until there is an idle process in the first process pool When the transfer operation is performed on the transfer task.
此外,本申请实施例还提出一种计算机可读存储介质,该计算机可读存储介质可以是易失性的,也可以是非易失性的,该计算机可读存储介质可以是硬盘、多媒体卡、SD卡、闪存卡、SMC、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器等等中的任意一种或者几种的任意组合。所述计算机可读存储介质中包括数据处理程序10,所述数据处理程序10被处理器执行时实现如下操作:In addition, an embodiment of the present application also proposes a computer-readable storage medium, which may be volatile or non-volatile, and the computer-readable storage medium may be a hard disk, a multimedia card, a Any of SD Card, Flash Card, SMC, Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM), Portable Compact Disc Read Only Memory (CD-ROM), USB memory, etc. or any combination of several. The computer-readable storage medium includes a data processing program 10, and the data processing program 10 implements the following operations when executed by the processor:
创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
本申请之计算机可读存储介质的具体实施方式与上述数据处理方法的具体实施方式大致相同,在此不再赘述。The specific implementation of the computer-readable storage medium of the present application is substantially the same as the specific implementation of the above-mentioned data processing method, and will not be repeated here.
在另一个实施例中,为进一步保证上述待处理数据及计算任务等数据的私密性和安全性,上述待处理数据及计算任务等数据还可以存储于一区块链的节点中。In another embodiment, in order to further ensure the privacy and security of the data to be processed and the computing tasks, the data to be processed and the computing tasks can also be stored in a node of a blockchain.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that the above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprising", "comprising" or any other variation thereof herein are intended to encompass a non-exclusive inclusion such that a process, device, article or method comprising a list of elements includes not only those elements, but also includes no explicit Other elements listed, or those inherent to such a process, apparatus, article, or method are also included. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, apparatus, article, or method that includes the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,电子设备,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence or the parts that make contributions to the prior art. The computer software products are stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disk), including several instructions to make a terminal device (which may be a mobile phone, a computer, an electronic device, or a network device, etc.) to execute the methods described in the various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present application, or directly or indirectly applied in other related technical fields , are similarly included within the scope of patent protection of this application.

Claims (20)

  1. 一种数据处理方法,应用于电子设备,其中,所述方法包括:A data processing method, applied to electronic equipment, wherein the method comprises:
    创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
    接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into a computing task, and the computing task is stored in the second work queue;
    处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
    反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  2. 如权利要求1所述的数据处理方法,其中,所述接收步骤还包括:The data processing method of claim 1, wherein the receiving step further comprises:
    当判断所述待处理数据不完整时,判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中不存在空闲进程时,将所述待处理数据存储至所述第一工作队列,当判断所述第一进程池中存在空闲进程时,利用该空闲进程接收所述待处理数据对应的不完整数据。When it is judged that the data to be processed is incomplete, it is judged whether there is an idle process in the first process pool, and when it is judged that there is no idle process in the first process pool, the data to be processed is stored in the first process pool. A work queue, when it is determined that there is an idle process in the first process pool, the idle process is used to receive incomplete data corresponding to the data to be processed.
  3. 如权利要求2所述的数据处理方法,其中,在所述反馈步骤之后,所述方法还包括:The data processing method of claim 2, wherein, after the feedback step, the method further comprises:
    判断所述第一工作队列是否存储有待处理数据或待反馈的计算结果,当判断所述第一工作队列均未存储有待处理数据及待反馈的计算结果时,将所述第一进程池中的空闲进程设为预设状态。Judging whether the first work queue stores data to be processed or calculation results to be fed back, when it is judged that the first work queue does not store data to be processed and calculation results to be fed back, the data in the first process pool is stored. The idle process is set to the default state.
  4. 如权利要求1所述的数据处理方法,其中,在所述处理步骤之后,所述方法还包括:The data processing method of claim 1, wherein, after the processing step, the method further comprises:
    判断所述第二工作队列是否存储有待处理的计算任务,当判断所述第二工作队列未存储有待处理的计算任务时,将所述第二进程池中的空闲进程设为预设状态;Judging whether the second work queue stores computing tasks to be processed, and when judging that the second work queue does not store computing tasks to be processed, setting the idle processes in the second process pool to a preset state;
    当判断所述第二工作队列存储有待处理的计算任务时,基于所述第二进程池中的空闲进程从所述第二工作队列中读取所述待处理的计算任务,并对该计算任务执行计算处理。When judging that the second work queue stores computing tasks to be processed, the computing tasks to be processed are read from the second work queue based on idle processes in the second process pool, and the computing tasks are stored in the second work queue. Execute calculation processing.
  5. 如权利要求1所述的数据处理方法,其中,所述反馈步骤还包括:The data processing method of claim 1, wherein the feedback step further comprises:
    当判断所述第一进程池中不存在空闲进程时,将所述计算结果封装成传输任务,将所述传输任务存储至所述第一工作队列,直至所述第一进程池中存在空闲进程时对所述传输任务执行传输操作。When it is determined that there is no idle process in the first process pool, the calculation result is encapsulated into a transmission task, and the transmission task is stored in the first work queue until there is an idle process in the first process pool When the transfer operation is performed on the transfer task.
  6. 如权利要求1至5任意一项所述的数据处理方法,其中,所述基于预设的处理规则对所述计算任务执行计算处理得到计算结果包括:The data processing method according to any one of claims 1 to 5, wherein the calculation result obtained by performing calculation processing on the calculation task based on a preset processing rule comprises:
    获取所述计算任务的标识,基于所述标识从预先配置的映射关系表中查找所述计算任务对应的计算处理规则,基于所述计算处理规则对所述计算任务执行计算处理得到计算结果。The identifier of the computing task is acquired, the computing processing rule corresponding to the computing task is searched from a pre-configured mapping table based on the identifier, and a computing result is obtained by performing computing processing on the computing task based on the computing processing rule.
  7. 如权利要求4所述的数据处理方法,其中,所述预设状态包括休眠状态。The data processing method of claim 4, wherein the preset state includes a sleep state.
  8. 一种数据处理装置,其中,所述装置包括:A data processing device, wherein the device comprises:
    创建模块:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creation module: Divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
    接收模块:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving module: receives the data processing request sent by the client, obtains the data to be processed in the request, and judges whether the data to be processed is complete based on the preconfigured data protocol. The data to be processed is encapsulated into computing tasks, and the computing tasks are stored in the second work queue;
    处理模块:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing module: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
    反馈模块:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback module: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device comprises:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of:
    创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
    接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into computing tasks, and the computing tasks are stored in the second work queue;
    处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
    反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  10. 如权利要求9所述的电子设备,其中,所述接收步骤还包括:The electronic device of claim 9, wherein the receiving step further comprises:
    当判断所述待处理数据不完整时,判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中不存在空闲进程时,将所述待处理数据存储至所述第一工作队列,当判断所述第一进程池中存在空闲进程时,利用该空闲进程接收所述待处理数据对应的不完整数据。When it is judged that the data to be processed is incomplete, it is judged whether there is an idle process in the first process pool, and when it is judged that there is no idle process in the first process pool, the data to be processed is stored in the first process pool. A work queue, when it is determined that there is an idle process in the first process pool, the idle process is used to receive incomplete data corresponding to the data to be processed.
  11. 如权利要求10所述的电子设备,其中,在所述反馈步骤之后,所述至少一个处理器还执行如下步骤:11. The electronic device of claim 10, wherein, after the feedback step, the at least one processor further performs the steps of:
    判断所述第一工作队列是否存储有待处理数据或待反馈的计算结果,当判断所述第一工作队列均未存储有待处理数据及待反馈的计算结果时,将所述第一进程池中的空闲进程设为预设状态。Judging whether the first work queue stores data to be processed or calculation results to be fed back, when it is judged that the first work queue does not store data to be processed and calculation results to be fed back, the data in the first process pool is stored. The idle process is set to the default state.
  12. 如权利要求9所述的电子设备,其中,在所述处理步骤之后,所述至少一个处理器还执行如下步骤:The electronic device of claim 9, wherein, after the processing step, the at least one processor further performs the following steps:
    判断所述第二工作队列是否存储有待处理的计算任务,当判断所述第二工作队列未存储有待处理的计算任务时,将所述第二进程池中的空闲进程设为预设状态;Judging whether the second work queue stores computing tasks to be processed, and when judging that the second work queue does not store computing tasks to be processed, setting the idle processes in the second process pool to a preset state;
    当判断所述第二工作队列存储有待处理的计算任务时,基于所述第二进程池中的空闲进程从所述第二工作队列中读取所述待处理的计算任务,并对该计算任务执行计算处理。When judging that the second work queue stores computing tasks to be processed, the computing tasks to be processed are read from the second work queue based on idle processes in the second process pool, and the computing tasks are stored in the second work queue. Execute calculation processing.
  13. 如权利要求9所述的电子设备,其中,所述反馈步骤还包括:The electronic device of claim 9, wherein the feedback step further comprises:
    当判断所述第一进程池中不存在空闲进程时,将所述计算结果封装成传输任务,将所述传输任务存储至所述第一工作队列,直至所述第一进程池中存在空闲进程时对所述传输任务执行传输操作。When it is determined that there is no idle process in the first process pool, the calculation result is encapsulated into a transmission task, and the transmission task is stored in the first work queue until there is an idle process in the first process pool When the transfer operation is performed on the transfer task.
  14. 如权利要求9至13任意一项所述的电子设备,其中,所述基于预设的处理规则对所述计算任务执行计算处理得到计算结果包括:The electronic device according to any one of claims 9 to 13, wherein the calculation result obtained by performing calculation processing on the calculation task based on a preset processing rule comprises:
    获取所述计算任务的标识,基于所述标识从预先配置的映射关系表中查找所述计算任务对应的计算处理规则,基于所述计算处理规则对所述计算任务执行计算处理得到计算结果。The identifier of the computing task is acquired, the computing processing rule corresponding to the computing task is searched from a pre-configured mapping table based on the identifier, and a computing result is obtained by performing computing processing on the computing task based on the computing processing rule.
  15. 如权利要求12所述的电子设备,其中,所述预设状态包括休眠状态。The electronic device of claim 12, wherein the preset state comprises a sleep state.
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质中包括数据处理程序,所述数据处理程序被处理器执行时实现如下步骤:A computer-readable storage medium, wherein the computer-readable storage medium includes a data processing program, and when the data processing program is executed by a processor, the following steps are implemented:
    创建步骤:将预设的进程池划分为输入输出操作的第一进程池及计算操作的第二进程池,分别创建所述第一进程池对应的第一工作队列,及所述第二进程池对应的第二工作队列;Creating step: divide the preset process pool into a first process pool for input and output operations and a second process pool for computing operations, and create a first work queue corresponding to the first process pool and the second process pool respectively. the corresponding second work queue;
    接收步骤:接收客户端发出的数据处理的请求,获取所述请求中的待处理数据,基于预先配置的数据协议判断所述待处理数据是否完整,当所述待处理数据完整时,将所述待处理数据封装为计算任务,并将所述计算任务存储至所述第二工作队列;Receiving step: receiving a data processing request sent by the client, obtaining the data to be processed in the request, and judging whether the data to be processed is complete based on a pre-configured data protocol, and when the data to be processed is complete, send the data to be processed. The data to be processed is encapsulated into computing tasks, and the computing tasks are stored in the second work queue;
    处理步骤:判断所述第二进程池中是否存在空闲进程,当判断所述第二进程池中存在空闲进程时,利用该空闲进程从所述第二工作队列中读取所述计算任务,基于预设的处理规则对所述计算任务执行计算处理得到计算结果,并将所述计算结果存储至所述第一工作队列;及Processing steps: determine whether there is an idle process in the second process pool, when it is determined that there is an idle process in the second process pool, use the idle process to read the computing task from the second work queue, based on The preset processing rule performs calculation processing on the calculation task to obtain calculation results, and stores the calculation results in the first work queue; and
    反馈步骤:判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中存在空闲进程时,利用该空闲进程从所述第一工作队列中读取所述计算结果,并将所述计算结果反馈至所述客户端。Feedback step: determine whether there is an idle process in the first process pool, when it is determined that there is an idle process in the first process pool, use the idle process to read the calculation result from the first work queue, and The calculation result is fed back to the client.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述接收步骤还包括:The computer-readable storage medium of claim 16, wherein the receiving step further comprises:
    当判断所述待处理数据不完整时,判断所述第一进程池中是否存在空闲进程,当判断所述第一进程池中不存在空闲进程时,将所述待处理数据存储至所述第一工作队列,当判断所述第一进程池中存在空闲进程时,利用该空闲进程接收所述待处理数据对应的不完整数据。When it is judged that the data to be processed is incomplete, it is judged whether there is an idle process in the first process pool, and when it is judged that there is no idle process in the first process pool, the data to be processed is stored in the first process pool. A work queue, when it is determined that there is an idle process in the first process pool, the idle process is used to receive incomplete data corresponding to the data to be processed.
  18. 如权利要求17所述的计算机可读存储介质,其中,在所述反馈步骤之后,所述数据处理程序被处理器执行时还实现如下步骤:The computer-readable storage medium of claim 17, wherein, after the feedback step, the data processing program further implements the following steps when executed by the processor:
    判断所述第一工作队列是否存储有待处理数据或待反馈的计算结果,当判断所述第一工作队列均未存储有待处理数据及待反馈的计算结果时,将所述第一进程池中的空闲进程设为预设状态。Judging whether the first work queue stores data to be processed or calculation results to be fed back, when it is judged that the first work queue does not store data to be processed and calculation results to be fed back, the data in the first process pool is stored. The idle process is set to the default state.
  19. 如权利要求16所述的计算机可读存储介质,其中,在所述处理步骤之后,所述数据处理程序被处理器执行时还实现如下步骤:The computer-readable storage medium of claim 16, wherein, after the processing step, the data processing program further implements the following steps when executed by the processor:
    判断所述第二工作队列是否存储有待处理的计算任务,当判断所述第二工作队列未存储有待处理的计算任务时,将所述第二进程池中的空闲进程设为预设状态;Judging whether the second work queue stores computing tasks to be processed, and when judging that the second work queue does not store computing tasks to be processed, setting the idle processes in the second process pool to a preset state;
    当判断所述第二工作队列存储有待处理的计算任务时,基于所述第二进程池中的空闲进程从所述第二工作队列中读取所述待处理的计算任务,并对该计算任务执行计算处理。When judging that the second work queue stores computing tasks to be processed, the computing tasks to be processed are read from the second work queue based on idle processes in the second process pool, and the computing tasks are stored in the second work queue. Execute calculation processing.
  20. 如权利要求16所述的计算机可读存储介质,其中,所述反馈步骤还包括:The computer-readable storage medium of claim 16, wherein the feedback step further comprises:
    当判断所述第一进程池中不存在空闲进程时,将所述计算结果封装成传输任务,将所述传输任务存储至所述第一工作队列,直至所述第一进程池中存在空闲进程时对所述传输任务执行传输操作。When it is determined that there is no idle process in the first process pool, the calculation result is encapsulated into a transmission task, and the transmission task is stored in the first work queue until there is an idle process in the first process pool When the transfer operation is performed on the transfer task.
PCT/CN2021/090293 2020-12-30 2021-04-27 Data processing method and apparatus, electronic device, and storage medium WO2022142008A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011622579.7 2020-12-30
CN202011622579.7A CN112698962A (en) 2020-12-30 2020-12-30 Data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022142008A1 true WO2022142008A1 (en) 2022-07-07

Family

ID=75511193

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/090293 WO2022142008A1 (en) 2020-12-30 2021-04-27 Data processing method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN112698962A (en)
WO (1) WO2022142008A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116011027A (en) * 2023-03-28 2023-04-25 翌飞锐特电子商务(北京)有限公司 Data forwarding sharing method, system, equipment and storage medium for service data flow

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698962A (en) * 2020-12-30 2021-04-23 平安科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030056073A1 (en) * 2001-09-18 2003-03-20 Terachip, Inc. Queue management method and system for a shared memory switch
US20100061233A1 (en) * 2008-09-11 2010-03-11 International Business Machines Corporation Flow control in a distributed environment
CN108923963A (en) * 2018-06-25 2018-11-30 哈尔滨工业大学 A method of automation topology measurement is realized using Looking Glass measurement point
CN112698962A (en) * 2020-12-30 2021-04-23 平安科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030056073A1 (en) * 2001-09-18 2003-03-20 Terachip, Inc. Queue management method and system for a shared memory switch
US20100061233A1 (en) * 2008-09-11 2010-03-11 International Business Machines Corporation Flow control in a distributed environment
CN108923963A (en) * 2018-06-25 2018-11-30 哈尔滨工业大学 A method of automation topology measurement is realized using Looking Glass measurement point
CN112698962A (en) * 2020-12-30 2021-04-23 平安科技(深圳)有限公司 Data processing method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHAO, LEI ET AL.: "Parallel Transmission of Data from a Mesoscale Numerical Prediction Model: An Application Study", ADVANCES IN METEOROLOGICAL SCIENCE AND TECHNOLOGY, vol. 9, no. 6, 31 December 2019 (2019-12-31), pages 20 - 25, XP055947719, ISSN: 2095-1973 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116011027A (en) * 2023-03-28 2023-04-25 翌飞锐特电子商务(北京)有限公司 Data forwarding sharing method, system, equipment and storage medium for service data flow

Also Published As

Publication number Publication date
CN112698962A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
CN110413386B (en) Multi-process processing method, device, terminal equipment and computer readable storage medium
WO2019179026A1 (en) Electronic device, method for automatically generating cluster access domain name, and storage medium
WO2019205371A1 (en) Server, message allocation method, and storage medium
US11614967B2 (en) Distributed scheduling in a virtual machine environment
WO2020140614A1 (en) Offline message distribution method, server and storage medium
WO2022142008A1 (en) Data processing method and apparatus, electronic device, and storage medium
US9063918B2 (en) Determining a virtual interrupt source number from a physical interrupt source number
WO2020119029A1 (en) Distributed task scheduling method and system, and storage medium
CN107682391B (en) Electronic device, server allocation control method, and computer-readable storage medium
WO2020015170A1 (en) Interface invoking method and apparatus, and computer-readable storage medium
US7539995B2 (en) Method and apparatus for managing an event processing system
WO2021121041A1 (en) Data transmission optimization method and device, and readable storage medium
WO2020015192A1 (en) Webpage data crawling method and apparatus, and storage medium
WO2019136813A1 (en) Api file management method, server, and storage medium
US20120124339A1 (en) Processor core selection based at least in part upon at least one inter-dependency
CN112003930A (en) Task allocation method, device, equipment and storage medium
CN110704187A (en) Method and device for adjusting system resources and readable storage medium
CN115567594A (en) Microservice request processing method, microservice request processing device, computer equipment and storage medium
WO2020211358A1 (en) Database scheduling method and apparatus, and computer device and storage medium
CN114003238A (en) Transcoding card-based container deployment method, device, equipment and storage medium
CN111984424A (en) Task processing method, device, equipment and computer readable storage medium
CN112130936A (en) Polling-based data calling method, device, equipment and storage medium
CN111382351B (en) Soft telephone resource sharing method, electronic device and computer readable storage medium
CN115391042B (en) Resource allocation method and device, electronic equipment and storage medium
CN114282133A (en) Data access request processing method and device, computer equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21912770

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21912770

Country of ref document: EP

Kind code of ref document: A1