WO2017129022A1 - 一种终端数据库的并行执行方法和装置 - Google Patents

一种终端数据库的并行执行方法和装置 Download PDF

Info

Publication number
WO2017129022A1
WO2017129022A1 PCT/CN2017/071596 CN2017071596W WO2017129022A1 WO 2017129022 A1 WO2017129022 A1 WO 2017129022A1 CN 2017071596 W CN2017071596 W CN 2017071596W WO 2017129022 A1 WO2017129022 A1 WO 2017129022A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
terminal
thread
ratio
cpu
Prior art date
Application number
PCT/CN2017/071596
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP17743637.5A priority Critical patent/EP3333733B1/en
Publication of WO2017129022A1 publication Critical patent/WO2017129022A1/zh
Priority to US15/917,166 priority patent/US10884817B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • 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]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/278Data partitioning, e.g. horizontal or vertical partitioning
    • 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/3009Thread control instructions
    • 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3851Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution from multiple instruction streams, e.g. multistreaming
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Definitions

  • the present invention relates to the field of intelligent terminals, and in particular, to a parallel execution method and apparatus for a terminal database.
  • the database in the intelligent terminal basically adopts a lightweight open source database (for example, SQLite).
  • the traditional intelligent terminal database supports multiple connections concurrently accessing the database, but does not support the concurrent execution of a single Structured Query Language (SQL) statement. Therefore, if a SQL statement is complicated and consumes a large amount of CPU, the terminal database cannot take advantage of the multi-core in this case.
  • the CPU of many terminals is based on the ARM.com large-scale (big.LITTLE) architecture, which has a large core and a small core.
  • the terminal also adjusts the CPU's main frequency according to a specific strategy, which causes the execution time of each CPU to perform the same task to be very different. For the same amount of tasks, CPU small core execution time is often one and a half to two times the execution time of large core. At the same time, if the CPU is limited in frequency, the execution time of the same task amount will be greatly increased.
  • the intelligent terminal database is usually not particularly large, and the time requirements for database query and update are also strict. That is, the query and update time is often less than 1 second, and the query related to the interface display often needs to be less than 200 milliseconds to ensure that some interface operations are not perceived by the naked eye. Therefore, the intelligent terminal database needs to have relatively fast SQL statement parsing and execution time.
  • SQL statements are supported for parallel execution.
  • the basic idea is that the user sets the degree of parallelism in the SQL statement or the database itself automatically sets the degree of parallelism based on the number of CPU cores.
  • the database execution engine then analyzes the distribution of the data in the data table and then splits the data table into separate partitions for parallel execution.
  • the embodiments of the present invention provide a parallel execution method and device for a terminal database, so as to solve the problem that the terminal CPU cannot implement parallel execution of the terminal database by using multiple cores in the case of large core and small core differences.
  • an embodiment of the present invention provides a parallel execution method of a terminal database, including:
  • the terminal determines each thread CPU based on a preset degree of parallelism, where the degree of parallelism is a number of threads executed in parallel;
  • the terminal acquires the main frequency of each thread CPU, and calculates the main frequency ratio of each thread CPU;
  • the terminal divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the CPUs of the respective threads, and determines the data partition corresponding to each thread CPU;
  • the terminal queries the data in the corresponding data partition in parallel through each thread CPU.
  • the terminal divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the CPUs of the respective threads, which can be implemented as follows:
  • the terminal reads the number of the first layer of subpages connected to the index root page in the data table
  • the first layer subpage is divided into N data partitions according to the main frequency ratio of each thread CPU, and N is a preset parallelism.
  • the above mentioned terminal reads the number of first layer subpages connected to the index root page in the data table, and divides the first layer subpage according to the main frequency ratio of each thread CPU.
  • the ratio of the number of first layer subpages in the N data partitions is equal to or approximately equal to the main frequency ratio of the CPUs of the respective threads.
  • the terminal divides the first-level sub-page into N data partitions according to the ratio of the main frequency of each thread CPU, which can quickly realize dynamic partitioning of the terminal database, and further improve the terminal pair.
  • the terminal divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the CPUs of the respective threads, which can be implemented as follows:
  • the terminal reads the number of data recorded in each subpage of the first layer subpage connected to the index root page in the data table;
  • the data recorded in the first layer subpage is divided into N data partitions according to the main frequency ratio of the CPUs of the respective threads, where N is a preset parallelism.
  • the above mentioned terminal reads the number of data recorded in each subpage of the first layer subpage; based on the number of records of each subpage, according to the ratio of the main frequency of the CPU of each thread, the first The data recorded in the layer sub-page is divided into N data partitions.
  • the ratio of the number of data records of the first layer sub-pages in the N data partitions is equal to or approximately equal to the main frequency ratio of the CPUs of the respective threads.
  • the terminal continues to read the data of each sub-page record in the first sub-page of the data table, and the first-level sub-page is proportioned according to the main frequency ratio of each thread CPU.
  • the data recorded in the data is divided into N data partitions, so that the ratio of the number of data recorded in each data partition is closer to the ratio of the main frequency of each CPU, and the division efficiency of the data partition can be taken into consideration and is practical.
  • the data table mentioned above is a data table in a B-tree format or a data table in a heap format.
  • the data table to be queried in the terminal database can be dynamically partitioned based on the main frequency factor of the CPU of each thread of the terminal, so that the thread CPU with a larger frequency can query more data, and the CPU query with smaller frequency is more
  • the amount of data is small, and the parallel processing of the query instruction by the CPU of each thread is performed on the corresponding data partition, which can greatly improve the parallel query execution efficiency of the terminal to the database.
  • an embodiment of the present invention provides a parallel execution device of a terminal database, including:
  • a determining unit configured to determine, according to a preset degree of parallelism, each thread CPU, where the degree of parallelism is a number of threads executed in parallel;
  • a calculating unit configured to acquire a main frequency of each thread CPU, and calculate a main frequency ratio of each thread CPU
  • a dividing unit configured to divide a data partition into a data table to be queried in the terminal database based on a ratio of a frequency of the CPU of each thread, and determine a data partition corresponding to each thread CPU;
  • the query unit is configured to query the data in the corresponding data partition in parallel by each thread CPU.
  • the dividing unit divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the respective thread CPUs, specifically:
  • the first layer subpage is divided into N data partitions according to the main frequency ratio of each thread CPU, and N is a preset parallelism.
  • the dividing unit mentioned above reads the number of first layer subpages connected to the index root page in the data table, and the first frequency ratio of the CPU of each thread is first.
  • the layer subpage is divided into N data partitions.
  • the ratio of the number of the first layer subpages in the N data partitions is equal to or approximately equal to the main frequency ratio of the CPUs of the respective threads.
  • the dividing unit divides the first layer subpage into N data partitions according to the main frequency ratio of each thread CPU, which can quickly realize dynamic partitioning of the terminal database, and further improve the terminal pair. Data query efficiency in each data partition.
  • the dividing unit divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the respective thread CPUs, specifically:
  • the data recorded in the first layer subpage is divided into N data partitions according to the main frequency ratio of the CPUs of the respective threads, where N is a preset parallelism.
  • the dividing unit mentioned above reads the number of data recorded in each subpage of the first layer subpage connected to the index root page in the data table, based on each of the subpage records.
  • Number the data recorded in the first layer subpage is divided into N data partitions according to the main frequency ratio of each thread CPU, and at this time, the number of data recorded in the first layer subpage of the N data partitions
  • the ratio is equal to or approximately equal to the main frequency ratio of the CPUs of the respective threads.
  • the dividing unit continues to read the number of data recorded in each sub-page of the first-level sub-page in the data table, and is first according to the ratio of the main frequency of each thread CPU.
  • the data recorded in the layer sub-page is divided into N data partitions, so that the ratio of the number of data recorded in each data partition is closer to the ratio of the main frequency of each CPU, and the division efficiency of the data partition can be taken into consideration and is practical.
  • the data table mentioned above is a data table in a B-tree format or a data table in a heap format.
  • the data table to be queried in the terminal database can be dynamically partitioned based on the main frequency factor of the CPU of each thread of the terminal, so that the thread CPU with a larger frequency can query more data, and the CPU query with smaller frequency is more
  • the amount of data is small, and the parallel processing of the query instruction by the CPU of each thread is performed on the corresponding data partition, which can greatly improve the parallel query execution efficiency of the terminal to the database.
  • an embodiment of the present invention provides a terminal device, where the terminal device has a function of implementing the behavior of the terminal in the foregoing method design.
  • the functions may be implemented by hardware or by corresponding software implemented by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the modules can be software and/or hardware.
  • the structure of the terminal device includes a memory and a processor in which program instructions are stored.
  • the processor controls the terminal device to divide the data partition into the data table to be queried in the terminal database according to the main frequency ratio of each thread CPU in the terminal device according to the program instruction stored in the memory, and determine the data partition corresponding to each thread CPU; Each thread CPU queries the data in the corresponding data partition in parallel.
  • an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the terminal, including a program designed to perform the foregoing aspects.
  • the parallel execution scheme of the terminal database in the embodiment of the present invention dynamically partitions the data table to be queried in the terminal database based on the main frequency factor of the CPU of each thread of the terminal, and simultaneously performs parallel processing of the query instruction on the corresponding data partition by using the CPU of each thread. , can greatly improve the parallel query execution efficiency of the terminal to the database.
  • FIG. 1 is a schematic diagram of parallel execution logic of a virtual machine in an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an internal structure of a terminal device according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a parallel execution method of a terminal database in an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a data table implemented in a B-tree format in a terminal database
  • FIG. 5 is a schematic diagram of a data table implemented by using a Heap form in a terminal database
  • FIG. 6 is a schematic structural diagram of a parallel execution device of a terminal database according to an embodiment of the present invention.
  • the embodiments of the present invention provide a parallel execution method and device for a terminal database, which are used to solve the problem that the terminal CPU cannot implement parallel execution of the terminal database by using multiple cores in the case of large core and small core differences.
  • the method and the device are based on the same inventive concept. Since the principles of the method and the device for solving the problem are similar, the implementation of the device and the method can be referred to each other, and the repeated description is not repeated.
  • the parallel execution method of the terminal database in the embodiment of the present invention dynamically divides the data in the database according to the current terminal CPU frequency ratio during the dynamic partitioning process of the terminal database, because the terminal CPU has the main frequency difference factor of the large core and the small core. Table area to ensure that the execution time of different CPUs is not much different, thus greatly reducing the CPU wait time of the database result set.
  • the invention needs to implement the parallel execution function of the terminal data database in combination with the parallel execution engine of the terminal database.
  • the following uses the most commonly used SQLite database of the mobile terminal database as an example to illustrate the implementation method of the parallel execution engine of the terminal database.
  • the instruction list shown in Figure 1 shows the virtual machine parallel execution logic.
  • the auxiliary thread is first created according to the predetermined degree of parallelism.
  • two auxiliary threads are created by the instruction 2 and the instruction 3, and according to the main frequency of the main thread and the main frequency of the auxiliary thread.
  • the data table to be processed is dynamically partitioned (instruction 4 in the figure), wherein the degree of parallelism is the number of parallel executions of the thread.
  • the main thread and each auxiliary thread execute respective code segments according to the pre-generated virtual machine parallel execution logic. For example, in the case of FIG. 1 above, the main thread executes the instruction 5-20, and then sees the instruction 21 and jumps directly to the instruction 41, To the finger Let 41 jump to 61. Auxiliary thread 1 jumps to 21, executes 21-40, and then exits; auxiliary thread 2 jumps to 41, executes 41-60, and then exits.
  • the main thread executes the merge of the result set and returns the execution result.
  • the instruction 4 in FIG. 1 implements dynamic partitioning of the data table, and the execution of the data table is decomposed into multiple partitions that do not overlap, so as to ensure that data accessed by different threads does not cross.
  • partitioning methods due to the different implementation mechanisms of their data tables.
  • FIG. 2 shows an internal structure of a terminal device 200 according to an embodiment of the present invention.
  • the terminal device 200 may include a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a Point of Sales (POS), a car computer, a desktop computer, a notebook, a server, and the like.
  • PDA Personal Digital Assistant
  • POS Point of Sales
  • the terminal device 200 may include a processor 202, a memory 201 connected to the processor 202, and, optionally, an external device such as a sensor, a touch screen, a speaker, a microphone, and the like.
  • the terminal device 200 may further include a radio frequency (RF) circuit and a connected antenna, a wireless fidelity (WiFi) module, and a connected antenna.
  • RF radio frequency
  • WiFi wireless fidelity
  • the terminal device 200 further includes a power source for supplying power thereto.
  • the internal structure of the terminal device shown in FIG. 2 does not constitute a limitation on the terminal device, and may include more or less components than those illustrated, or combine some components or different components. Arrangement.
  • terminal device 200 The components of the terminal device 200 will be specifically described below with reference to FIG. 2:
  • the memory 201 can be used to store programs and data, and the processor 202 executes various function applications and data processing of the terminal device 200 by running a program stored in the memory 201.
  • the memory 201 may mainly include a storage program area and a storage data area, wherein the storage data area may store data (such as audio data, a phone book, etc.) created according to the use of the terminal device 200, and the storage data area is stored in the embodiment of the present invention.
  • data such as audio data, a phone book, etc.
  • the storage program area can store an operating system (for example, an Android operating system, referred to as “Android system” or iOS operating system, referred to as “iOS system”, wherein the operating system can also be simply referred to as "system”), At least one function required instruction (such as a sound playing function, an image playing function, etc.), etc., the instructions may cause the processor 202 to perform the following method, the specific method comprising: determining each thread CPU based on a preset degree of parallelism, The degree of parallelism is the number of threads executed in parallel; the main frequency of the CPU of each thread is obtained, and the ratio of the main frequency of the CPU of each thread is calculated; and the data table to be queried in the database of the terminal device 200 is based on the ratio of the main frequency of the CPU of each thread. Dividing the data partition to determine the data partition corresponding to each thread CPU; the terminal device queries the corresponding number in parallel through each thread CPU Data partition.
  • an Android operating system for example, an Android operating system, referred to as “And
  • the processor 202 calls the application program by running an operating system stored in the memory 201 to complete the functions provided by the application.
  • the operating system can also control touch screens and sensors.
  • the operating system in the terminal device 200 calls the program stored in the memory 201 to complete the parallel execution process of the terminal device database provided by the embodiment of the present invention.
  • the memory 201 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the touch screen may include a touch panel, a display unit, and the like.
  • a touch panel also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like, any suitable object or accessory on or near the touch panel).
  • the corresponding connecting device is driven according to a preset program.
  • the touch panel may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 202 is provided and can receive commands from the processor 202 and execute them.
  • touch panels can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the display unit can be used to display information input by the user or information provided to the user and various menus of the terminal device 200.
  • the display unit may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel may cover the display unit. When the touch panel detects a touch operation on or near the touch panel, the touch panel transmits to the processor 202 to determine the type of the touch event, and then the processor 202 displays according to the type of the touch event. A corresponding visual output is provided on the unit.
  • the touch panel can be integrated with the display unit as a touch screen for implementing the input and output functions of the terminal device 200, or the touch panel and the display unit can be implemented as two independent components to implement the terminal device respectively.
  • the input and output functions of the present invention are not limited in this embodiment of the present invention.
  • the touch detection device and the touch controller may be implemented in one chip, and the signal received by the touch controller is converted into related information of the input (eg, input position, type of input operation, duration of input, corresponding to the input)
  • the generated information about the input is sent to the processor 202;
  • the RF circuit can be used for transmitting and receiving information or receiving and transmitting signals during the call.
  • the downlink information is forwarded to the processor 202 for processing; in addition, the uplink data is sent. To the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • LNA Low Noise Amplifier
  • the RF circuit can communicate with the network and other devices through wireless communication.
  • the wireless communication can use any communication standard or protocol, including but not limited to:
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • SMS Short Messaging Service
  • an audio circuit, a speaker, and a microphone can provide an audio interface between the user and the terminal device 200.
  • the audio circuit can transmit the converted electrical signal of the received audio data to the speaker and convert it into a sound signal output by the speaker; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit and converted into audio.
  • the data is then output to an RF circuit for transmission to other electronic devices, such as a cell phone, or the audio data is output to memory 201 for further processing.
  • WiFi is a short-range wireless transmission technology
  • the terminal device 200 can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module, which provides wireless broadband Internet access for users.
  • FIG. 2 shows the WiFi module, it can be understood that it does not belong to the essential configuration of the terminal device 200, and may be omitted as needed within the scope of not changing the essence of the embodiment of the present invention.
  • the processor 202 is a control center of the terminal device 200, and connects various parts of the entire mobile phone by using various interfaces and lines, by running or executing a program (or "module") stored in the memory 201, and calling the memory stored in the memory 201.
  • the internal data performs various functions and processing data of the terminal device 200, thereby performing overall monitoring of the terminal device 200.
  • the processor 202 can include at least one processing unit; optionally, the processor 202 can integrate an application processor. And a modem processor, wherein the application processor primarily processes an operating system, a user interface, an application, etc., and the modem processor primarily processes wireless communications. It can be understood that the above modem processor may not be integrated into the processor 202.
  • the terminal device 200 also includes a power source (such as a battery) that supplies power to the various components.
  • a power source such as a battery
  • the power source can be logically coupled to the processor 202 through a power management system to manage functions such as charging, discharging, and power consumption through the power management system.
  • the terminal device 200 may further include a sensor (such as a photo sensor, a motion sensor, etc.).
  • a sensor such as a photo sensor, a motion sensor, etc.
  • the light sensor can include an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display unit according to the brightness of the ambient light, and the proximity sensor can turn off the display unit and/or the backlight when the terminal device 200 moves to the ear.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping).
  • sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like which are also configurable by the terminal device 200 are not described herein.
  • the terminal device 200 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the flow should be described by the terminal device 200 provided above as an example, but it should be understood that the processes can be applied to various electronic devices having a memory and a processor for implementing parallel query of the terminal device database. .
  • FIG. 3 is a parallel execution method of a terminal database according to an embodiment of the present invention, and the specific process is:
  • Step 300 The terminal determines each thread CPU based on a preset degree of parallelism, where the degree of parallelism is the number of threads executed in parallel.
  • Step 301 The terminal acquires the main frequency of each thread CPU, and calculates the main frequency ratio of each thread CPU.
  • the terminal is a 4-core mobile phone with 4 CPUs, and CPU1, CPU2, CPU3, and CPU4 respectively represent 4 CPUs of the terminal, and the preset parallelism N is 3. In this case, it is necessary to select from 4 CPUs.
  • the thread CPU it is assumed that CPU1, CPU2, and CPU3 are thread CPUs corresponding to three threads. Assume that the main frequency of the three threads of the mobile phone is 2016000, 1017600, and 1516800. At this time, the ratio of the main frequency of the CPU of the three threads is calculated to be 4:2:3.
  • Step 302 The terminal divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the CPUs of the respective threads, and determines the data partition corresponding to each thread CPU.
  • the terminal divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the CPUs of the respective threads, and is divided into the following two execution schemes:
  • the first solution is: the terminal reads the number of the first layer subpages connected to the index root page in the data table; and divides the first layer subpage into N data according to the main frequency ratio of each thread CPU The partition, at this time, the ratio of the number of the first layer subpages in the N data partitions is equal to or approximately equal to the ratio of the main frequency of the CPUs of the respective threads, and N is a preset degree of parallelism.
  • the data partition is divided for the data table to be queried in the terminal database, if the number of the first layer of the subpage is large.
  • the threshold is preset, the first scheme described above is adopted.
  • the nine first layer subpages are according to 4 : 2:3 is divided into 3 partitions.
  • partition 1 includes four first-level sub-pages, which can be four first-level pages numbered 1-4 in the first-level paging.
  • the partition 2 includes two first layer subpages, which may be two first layer paginations numbered 5-6 in the first layer pagination, and three first layer subpages in the partition 3, which may be the first layer Three first-level paginations numbered 7-9 in the pagination.
  • the ratio of the number of the first layer subpages in the N data partitions is equal to or approximately equal to the ratio of the main frequency of the CPUs of the respective threads, and does not limit each first layer in each data partition.
  • the method of dividing the data of the page is equal to or approximately equal to the ratio of the main frequency of the CPUs of the respective threads, and does not limit each first layer in each data partition.
  • the second solution is: the terminal reads the number of data recorded in each subpage of the first layer subpage connected to the index root page in the data table; and according to the number of records of each subpage, according to the CPU of each thread
  • the ratio of the frequency of the first layer is divided into N data partitions, and the ratio of the number of data recorded by the first layer of the N data partitions to the CPU of each thread is
  • the main frequency ratios are equal or approximately equal, and N is the preset parallelism.
  • the second solution is adopted.
  • the terminal reads 2 first layer subpages.
  • the number of recorded data assuming that the number of data recorded in the first subpage is 40, the number of data recorded in the second subpage is 40, and 90 data records are divided into 3 partitions according to 4:2:3. . Assume that the three data partitions are partition 1, partition 2, and partition 3.
  • partition 1 includes 40 data records, which can be the data recorded in the first layer of paging
  • partition 2 includes 20 data records, which can be The first 20 data records recorded in the second layer of the page
  • the partition 3 includes 30 data records, which can be the last 30 data records recorded in the second layer of the page.
  • the ratio of the number of data recorded by the first layer of the N data partitions is equal to or approximately equal to the ratio of the primary frequency of the CPUs of the respective threads, and is not limited to the first in each data partition.
  • Step 303 The terminal queries the data in the corresponding data partition in parallel through each thread CPU.
  • the data table to be queried is divided into three data partitions according to the main frequency ratio of the CPU of each terminal of the terminal: 4:2:3, and the three data partitions are respectively partitioned.
  • partition 2, partition 3 at this time, the terminal queries the data in the corresponding data partition in parallel through each thread CPU, that is, the data in the partition 1 performs the data query function through the CPU 1 of the terminal, and the data in the partition 2 is executed through the CPU 2 of the terminal.
  • the data query function, the data in the partition 3 performs the data query function through the CPU 3 of the terminal.
  • the mobile terminal database uses a data table implemented in the form of a B-tree.
  • the data of the data table is organized into a B-tree structure, and data records are stored in the lowest layer nodes of the B-Tree structure.
  • the values in the lowest layer node in Figure 4 represent the ID numbers recorded in the data table.
  • Such table structure record ID numbers are arranged in order from left to right.
  • the N data pages in the first layer subpage are represented by Page1, Page1, ... PageN, respectively.
  • the mobile phone terminal is a 4-core mobile phone terminal with 4 CPUs in the above example.
  • the record ID number in FIG. 3 is the primary key, so the record in the terminal database can be completed by reading the record of the root page and the first layer of the subpage. The data partition in the data table to be queried.
  • the data partition needs to be divided according to the ratio of the main frequency of the current thread CPU, for example, three thread CPUs, the main frequency respectively For 2016000, 1017600, 1516800, that is, the ratio of the main frequency of the three-threaded CPU is 4:2:3, the ratio of the three thread data partitions should be the same or close to 4:2:3. Therefore, the number of data pages Page1 - PageN of the first layer subpage recorded in FIG. 3 is read.
  • Page1-PageN can be divided according to the ratio of 4:2:3, and the last corresponding primary key value can be found to complete the data division. Assuming that the first level of subpages has 30 pages, the first level of subpages can be divided by 4:2:3, and the result is (14, 6, 10).
  • the data recorded in the first 14 data pages of the first layer subpage is executed by the thread CPU1
  • the data recorded in the middle 6 data pages in the first layer subpage is executed by the thread CPU2
  • the last 10 of the first layer subpages The data recorded in the data page is executed by the thread CPU 3.
  • the preset threshold is 8 for example, the first data page of the first layer subpage is only the first data page and the second data page respectively.
  • the number of data recorded in two data pages of the first layer subpage is read out, wherein the first data page records 40 data records, and the second data page records 50 data records, and the first layer subpage
  • the number of data recorded in the middle can be divided according to the ratio of 4:2:3, that is to say, the data recorded in the first data page is executed by the thread CPU1, and the first 20 records in the second data page.
  • the strip record is executed by the thread CPU 2, and the last 30 records recorded in the second data page are executed by the thread CPU 3.
  • Heap table Another common form of data table organization is the Heap table. Referring to FIG. 5, this form of data table is organized according to the data record insertion order. No primary key field or primary key field is a separate index, that is, data records in the data table are not sorted by primary key.
  • the dynamic partitioning method of the data table in this form is completely consistent with the dynamic partitioning method of the data table in the above B-tree form, and details are not described herein again.
  • the embodiment of the present invention provides a parallel execution device 600 for a terminal database, which can be used to execute the method described in FIG.
  • the figure shows a schematic structural diagram of an apparatus 600 according to an embodiment of the present invention.
  • the apparatus 600 includes a determining unit 601, a calculating unit 602, a dividing unit 603, and a query unit 604, where:
  • a determining unit 601 configured to determine, according to a preset degree of parallelism, each thread CPU, where the degree of parallelism is a number of threads executed in parallel;
  • the calculating unit 602 is configured to acquire a main frequency of each thread CPU, and calculate a main frequency ratio of each thread CPU;
  • the dividing unit 603 is configured to divide a data partition into a data table to be queried in the terminal database based on a frequency ratio of the respective threads of the respective threads, and determine a data partition corresponding to each thread CPU;
  • the query unit 604 is configured to query data in the corresponding data partition in parallel by each thread CPU.
  • the dividing unit 603 is configured to: when the data partition of the data table to be queried in the terminal database is divided into data partitions based on the ratio of the main frequency of the respective thread CPUs, specifically:
  • the first layer subpage is divided into N data partitions according to the main frequency ratio of each thread CPU, and N is a preset parallelism.
  • the ratio of the number of the first layer subpages in the N data partitions is equal to or approximately equal to the main frequency ratio of the CPUs of the respective threads.
  • the dividing unit divides the data partition into the data table to be queried in the terminal database based on the ratio of the main frequency of the respective thread CPUs, specifically:
  • the first-level sub-pages are recorded according to the main frequency ratio of the CPUs of the respective threads.
  • the data is divided into N data partitions, and N is a preset degree of parallelism.
  • the ratio of the number of data recorded by the first layer of the N data partitions is equal to or approximately equal to the ratio of the main frequency of the CPUs of the respective threads.
  • the data table is a data table in a B-tree format or a data table in a heap format.
  • the device 600 involved in the above embodiments may be a separate component or integrated into other components.
  • the terminal determines each thread CPU based on a preset degree of parallelism, the parallelism is the number of threads executed in parallel; the terminal acquires the main frequency of each thread CPU, and calculates the main CPU of each thread.
  • the terminal divides the data partition according to the ratio of the main frequency of the CPU of each thread to the data table to be queried in the terminal database, and determines the data partition corresponding to each thread CPU; the terminal queries the corresponding data partition in parallel through each thread CPU Data, so that the data table to be queried in the terminal database can be dynamically partitioned based on the main frequency factor of the CPU of each thread of the terminal, and the parallel processing of the query instruction by the CPU of each thread is performed on the corresponding data partition, which can greatly improve the terminal to the database. Parallel query execution efficiency.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种终端数据库的并行执行方法和装置,以解决终端CPU存在大核、小核差异情况下,无法利用多核实现终端数据库的并行执行问题。该方法为:终端基于预设的并行度确定各个线程CPU,所述并行度为并行执行的线程数(300);终端获取每个线程CPU的主频,计算各个线程CPU的主频比例(301);终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区(302);终端通过各个线程CPU并行查询对应的数据分区中的数据(303),这样能够同时利用各线程CPU对对应数据分区执行查询指令的并行化处理,极大提升终端对数据库的并行查询执行效率。

Description

一种终端数据库的并行执行方法和装置
本申请要求在2016年1月30日提交中国专利局、申请号为201610065053.0、发明名称为“一种终端数据库的并行执行方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及智能终端领域,尤其涉及一种终端数据库的并行执行方法和装置。
背景技术
随着智能终端功能越来越强大,存储空间越来越大,其内部存储的数据量越来越多,用户查询的数据量也在不断增大,这导致终端内部的应用响应时间也越来越长。另一方面,智能终端的中央处理器(Central Processing Unit,CPU)核数不断增大,处理能力越来越强。利用多核优势加速数据查询是智能终端数据库的一个优化方向。
目前智能终端中的数据库基本都是采用轻量的开源数据库(例如SQLite)。传统智能终端数据库支持多个连接并发访问数据库,但是不支持单一结构化查询语言(Structured Query Language,SQL)语句的并发执行。因此如果某一个SQL语句很复杂,需要消耗大量CPU,这种情况下终端数据库无法利用到多核优势。同时,当前很多终端的CPU都是基于ARM处理器的大小核(big.LITTLE)架构,这种CPU有大核和小核之分。同时,终端也会根据特定策略调整CPU的主频,这导致每个CPU在执行相同任务时的执行时间会有很大差异。对于同样的任务量,CPU小核执行时间往往是大核执行时间的一倍半到两倍。同时,如果对CPU进行限制频率的话,同样任务量的执行时间也会大大增加。
另外,智能终端数据库通常不会特别大,同时对数据库查询和更新的时间要求也比较严格。即查询和更新时间往往在1秒以下,和界面显示相关的查询往往需要在200毫秒以下,以保证一些界面操作肉眼无感知。因此,智能终端数据库需要有比较快速的SQL语句解析和执行时间。
在传统的服务端数据库中(例如Oracle、SQL Server),都支持SQL语句并行执行。基本思想是用户在SQL语句中设置并行度或数据库自身根据CPU核数自动设置并行度。然后数据库执行引擎分析数据表中的数据分布情况,然后将数据表拆分成独立分区并行执行。
传统服务端数据库的数据分析和数据表拆分往往很复杂,需要收集很多统计信息。所以这种并行执行前的准备工作往往相对比较耗时,而并行执行往往也针对很大的数据规模和执行时间很长的SQL语句才适用。而对耗时仅仅几秒钟的SQL语句则不适用。而终端数据库通常的SQL语句执行时间只有几毫秒或几十毫秒,超过200毫秒则容易被人眼感知到影响用户体验。因此终端数据库无法利用很多统计信息来进行数据表拆分。同时,由于智能终端的CPU有大核和小核之分,如果将执行任务平均分配给各CPU核,则会出现大核执行结束后不得不等待小核执行完成的情况,导致执行效率降低。
综上所述,当终端CPU存在大核、小核差异情况下,如何利用多核优势提高终端数据库的并行执行效率成为亟待解决的问题。
发明内容
本发明实施例提供一种终端数据库的并行执行方法和装置,以解决终端CPU存在大核、小核差异情况下,无法利用多核实现终端数据库的并行执行问题。
本发明实施例提供的具体技术方案如下:
第一方面,本发明实施例提供一种终端数据库的并行执行方法,包括:
终端基于预设的并行度确定各个线程CPU,所述并行度为并行执行的线程数;
终端获取每个线程CPU的主频,计算各个线程CPU的主频比例;
终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;
终端通过各个线程CPU并行查询对应的数据分区中的数据。
在一个可能的设计中,终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,可以通过如下方式实现:
终端读取所述数据表中与索引根页相连的第一层子页的个数;
按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,N为预设的并行度。
在一个可能的设计中,上述提到终端读取所述数据表中与索引根页相连的第一层子页的个数,按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,此时,所述N个数据分区中的第一层子页数目比例与所述各个线程CPU的主频比例相等或近似相等。例如,终端在第一层子页数目较多时,按照各个线程CPU的主频比例将第一层子页划分为N个数据分区,能够快速实现终端数据库的动态分区,进一步提高了终端对各个数据分区中的数据查询效率
在一个可能的设计中,终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,可以通过如下方式实现:
终端读取所述数据表中与索引根页相连的第一层子页中每个子页记录的数据个数;
基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,N为预设的并行度。
在一个可能的设计中,上述提到终端读取第一层子页中每个子页记录的数据个数;基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,此时,所述N个数据分区中的第一层子页记录的数据个数比例与所述各个线程CPU的主频比例相等或近似相等。例如,终端在第一层子页数目较少时,继续读取数据表中第一层子页中每个子页记录的数据个数,按照各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,这样使得各个数据分区中记录的数据个数比例与各个CPU主频比例更加接近,而且能够兼顾数据分区的划分效率,贴合实际。
在一个可能的设计中,上述提到的所述数据表为B-tree格式的数据表或为heap格式的数据表。
这样,能够基于终端各线程CPU的主频因素对终端数据库中待查询的数据表进行动态分区,能够使得主频较大的线程CPU查询较多的数据量,主频较小的线程CPU查询较少的数据量,同时利用各线程CPU对对应数据分区执行查询指令的并行化处理,能够极大提升终端对数据库的并行查询执行效率。
第二方面,本发明实施例提供一种终端数据库的并行执行装置,包括:
确定单元,用于基于预设的并行度确定各个线程CPU,所述并行度为并行执行的线程数;
计算单元,用于获取每个线程CPU的主频,计算各个线程CPU的主频比例;
划分单元,用于基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;
查询单元,用于通过各个线程CPU并行查询对应的数据分区中的数据。
在一个可能的设计中,所述划分单元基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区时,具体用于:
读取所述数据表中与索引根页相连的第一层子页的个数;
按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,N为预设的并行度。
在一个可能的设计中,上述提到的所述划分单元读取所述数据表中与索引根页相连的第一层子页的个数,按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,此时,所述N个数据分区中的第一层子页数目比例与所述各个线程CPU的主频比例相等或近似相等。所述划分单元在第一层子页数目较多时,按照各个线程CPU的主频比例将第一层子页划分为N个数据分区,能够快速实现终端数据库的动态分区,进一步提高了终端对各个数据分区中的数据查询效率。
在一个可能的设计中,所述划分单元基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区时,具体用于:
读取所述数据表中与索引根页相连的第一层子页中每个子页记录的数据个数;
基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,N为预设的并行度。
在一个可能的设计中,上述提到的所述划分单元读取所述数据表中与索引根页相连的第一层子页中每个子页记录的数据个数,基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,此时,所述N个数据分区中的第一层子页记录的数据个数比例与所述各个线程CPU的主频比例相等或近似相等。例如,所述划分单元在第一层子页数目较少时,继续读取数据表中第一层子页中每个子页记录的数据个数,按照各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,这样使得各个数据分区中记录的数据个数比例与各个CPU主频比例更加接近,而且能够兼顾数据分区的划分效率,贴合实际。
在一个可能的设计中,上述提到的所述数据表为B-tree格式的数据表或为heap格式的数据表。
这样,能够基于终端各线程CPU的主频因素对终端数据库中待查询的数据表进行动态分区,能够使得主频较大的线程CPU查询较多的数据量,主频较小的线程CPU查询较少的数据量,同时利用各线程CPU对对应数据分区执行查询指令的并行化处理,能够极大提升终端对数据库的并行查询执行效率。
第三方面,本发明实施例提供了一种终端设备,该终端设备具有实现上述方法设计中所述终端行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。所述模块可以是软件和/或硬件。
在一个可能的设计中,终端设备的结构中包括存储器和处理器,所述存储器中存储有程序指令。所述处理器控制终端设备根据存储器中存储的程序指令,基于终端设备中各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;通过各个线程CPU并行查询对应的数据分区中的数据。
第四方面,本发明实施例提供了一种计算机存储介质,用于储存为上述终端所用的计算机软件指令,其包含用于执行上述方面所设计的程序
本发明实施例中的终端数据库并行执行方案,基于终端各线程CPU的主频因素对终端数据库中待查询的数据表进行动态分区,同时利用各线程CPU对对应数据分区执行查询指令的并行化处理,能够极大提升终端对数据库的并行查询执行效率。
附图说明
图1为本发明实施例中虚拟机并行执行逻辑示意图;
图2为本发明实施例提供的终端设备的内部结构的示意图;
图3为本发明实施例中终端数据库的并行执行方法流程图;
图4为终端数据库中采用B-tree形式实现的数据表示意图;
图5为终端数据库中采用Heap形式实现的数据表示意图;
图6为本发明实施例中终端数据库的并行执行装置结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,并不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供了一种终端数据库的并行执行方法和装置,用以解决终端CPU存在大核、小核差异情况下,无法利用多核实现终端数据库的并行执行问题。其中,方法和装置是基于同一发明构思的,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。
下面结合附图对本发明的实施方式进行详细说明。
由于终端CPU存在大核、小核的主频差异因素,本发明实施例中的终端数据库的并行执行方法,在终端数据库动态分区过程中,按照当前终端CPU主频比例来动态划分数据库中的数据表区域,以确保不同CPU的执行时间差别不大,从而大大减少数据库结果集合并时的CPU等待时间。本发明需要结合终端数据库的并行执行引擎来实现终端数据数据库的并行执行功能。下面以手机终端数据库最常用的SQLite数据库为例来说明终端数据库并行执行引擎的实现方法。
图1所示的指令表给出了虚拟机并行执行逻辑。当执行引擎开始执行虚拟机指令时,会首先根据预先确定的并行度创建辅助线程,图中通过指令2和指令3创建了2个辅助线程,并根据主线程的主频和辅助线程的主频来对待查询的数据表进行动态分区(图中的指令4),其中,并行度为线程的并行执行个数。
主线程和各辅助线程根据预先生成的虚拟机并行执行逻辑执行各自代码段,例如对于上面图1中情况,主线程执行指令5-20,然后看到指令21则直接跳转到指令41,看到指 令41则跳转到61。辅助线程1则跳转到21,执行21-40,然后退出;辅助线程2则跳转到41,执行41-60,然后退出。
主线程在指令61等待所有线程退出后,执行结果集的合并,并返回执行结果。
图1中指令4实现对数据表的动态分区,执行将数据表分解成不重叠的多个分区,才能够确保不同线程访问的数据不会交叉。对于不同的数据库,由于其数据表实现机制的不同,有不同的分区方法。
图2示出了本发明实施例提供的终端设备200的内部结构。终端设备200可包括手机、平板电脑、个人数字助理(Personal Digital Assistant,PDA)、销售终端设备(Point of Sales,POS)、车载电脑、台式电脑、笔记本、服务器等。
如图2所示,终端设备200内部可包括:处理器202、与处理器202连接的存储器201,以及,可选地,还可包括传感器、触控屏幕、扬声器、麦克等外部设备。当终端设备200采用无线方式与外界通信时,还可包括射频(Radio Frequency,RF)电路和连接的天线,无线保真(Wireless Fidelity,WiFi)模块和连接的天线等。此外,终端设备200还包括为其供电的电源。
本领域技术人员可以理解,图2中示出的终端设备的内部结构并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图2对终端设备200的各个构成部件进行具体的介绍:
存储器201可用于存储程序和数据,处理器202通过运行存储在存储器201的程序从而执行终端设备200的各种功能应用以及数据处理。
存储器201可主要包括存储程序区和存储数据区,其中,存储数据区可存储根据终端设备200的使用所创建的数据(比如音频数据、电话本等)等,本发明实施例中存储数据区存储有终端设备200的数据库;存储程序区可存储操作系统(比如:安卓操作系统,简称“安卓系统”或iOS操作系统,简称“iOS系统”,其中,操作系统也可简称为“系统”)、至少一个功能所需的指令(比如:声音播放功能、图像播放功能等)等,所述指令可使处理器202执行以下方法,具体方法包括:基于预设的并行度确定各个线程CPU,所述并行度为并行执行的线程数;获取每个线程CPU的主频,计算各个线程CPU的主频比例;基于所述各个线程CPU的主频比例对终端设备200的数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;终端设备通过各个线程CPU并行查询对应的数据分区中的数据。
其中,处理器202通过运行存储器201中存储的操作系统,调用应用程序,完成应用程序所提供的功能。此外,操作系统还可以控制触控屏幕、传感器。
本发明实施例中,终端设备200中的操作系统调用存储器201中存储的程序,完成本发明实施例提供的终端设备数据库的并行执行流程。
此外,存储器201可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
触控屏幕可包括触控面板、显示单元等。
触控面板,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板上或在触控面板附近的操作),并根据预先设定的程式驱动相应的连接装置。
可选的,触控面板可包括触摸检测装置和触摸控制器两个部分。
其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器202,并能接收处理器202发来的命令并加以执行。
此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板。
显示单元可用于显示由用户输入的信息或提供给用户的信息以及终端设备200的各种菜单。可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示单元。进一步的,触控面板可覆盖显示单元,当触控面板检测到在其上或附近的触摸操作后,传送给处理器202以确定触摸事件的类型,随后处理器202根据触摸事件的类型在显示单元上提供相应的视觉输出。
如图2所示,触控面板可与显示单元集成为触控屏幕,用于实现终端设备200的输入和输出功能,或者触控面板与显示单元可以作为两个独立的部件来分别实现终端设备200的输入和输出功能,本发明实施例对此并不做限定。
进一步地,触摸检测装置和触摸控制器可在一块芯片中实现),触摸控制器接收的信号转换成该输入的相关信息(比如:输入位置、输入操作的类型、输入的持续时间、该输入对应的用户接触到触控屏幕的接触点的数量等),将生成的该输入的相关信息发给处理器202;
RF电路可用于收发信息或在通话过程中,完成信号的接收和发送,特别地,将收到基站发送的下行信息接收后,将下行信息交给处理器202处理;另外,将上行的数据发送给基站。
通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。
此外,RF电路还可以通过无线通信与网络和其他设备通信。
所述无线通信可以使用任一通信标准或协议,包括但不限于:
全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。
图2中,音频电路、扬声器,麦克风可提供用户与终端设备200之间的音频接口。
音频电路可将接收到的音频数据转换后的电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,麦克风将收集的声音信号转换为电信号,由音频电路接收后转换为音频数据,再将音频数据输出至RF电路以发送给其他电子设备,比如:手机,或者将音频数据输出至存储器201以便进一步处理。
WiFi属于短距离无线传输技术,终端设备200通过WiFi模块可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。
虽然图2示出了WiFi模块,但是可以理解的是,其并不属于终端设备200的必须构成,完全可以根据需要在不改变本发明实施例的本质的范围内而省略。
处理器202是终端设备200的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器201内的程序(或称为“模块”),以及调用存储在存储器201内的数据,执行终端设备200的各种功能和处理数据,从而对终端设备200进行整体监控。
可选的,处理器202可包括至少一个处理单元;可选地,处理器202可集成应用处理器 和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器202中。
终端设备200还包括给各个部件供电的电源(比如电池),可选地,电源可以通过电源管理系统与处理器202逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。
如图2所示,终端设备200还可包括传感器(比如:光传感器、运动传感器等)。
具体地,光传感器可包括环境光传感器及接近传感器。
其中,环境光传感器可根据环境光线的明暗来调节显示单元的亮度,接近传感器可在终端设备200移动到耳边时,关闭显示单元和/或背光。
作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等。
至于终端设备200还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
此外,终端设备200还可包括摄像头、蓝牙模块等,在此不再赘述。
下面介绍了本发明实施例提供的终端设备数据库的并行执行流程。
其中,以这些流程应由上述提供的终端设备200执行为例加以说明,但应该理解的是,这些流程可应用于各种具有存储器和处理器的电子设备,用以实现终端设备数据库的并行查询。
本发明的关键点是在数据表分区的时候考虑CPU主频因素,根据CPU主频来按比例划分分区,从而使不同主频的CPU的执行时间尽可能相同。具体的,参阅图3所示,图3为本发明实施例中终端数据库的并行执行方法,具体过程为:
步骤300:终端基于预设的并行度确定各个线程CPU,所述并行度为并行执行的线程数。
步骤301:终端获取每个线程CPU的主频,计算各个线程CPU的主频比例。
例如,终端为具有4个CPU的4核手机,分别用CPU1,CPU2,CPU3,CPU4来表示终端的4个CPU,预设的并行度N为3,此时,需要从4个CPU中选出3个作为线程CPU,假设确定出CPU1,CPU2,CPU3分别为3个线程对应的线程CPU。假设手机的3个线程CPU的主频分别为2016000,1017600,1516800,此时,计算3个线程CPU的主频比例为4:2:3。
步骤302:终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区。
具体的,终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,分为以下两种执行方案:
第一种方案为:终端读取所述数据表中与索引根页相连的第一层子页的个数;按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,此时,所述N个数据分区中的第一层子页数目比例与所述各个线程CPU的主频比例相等或近似相等,N为预设的并行度。
可选的,针对终端数据库中的待查询的数据表划分数据分区时,若第一层子页数目大 于预设阈值时,采用上述第一种方案。
例如,针对上述例子中的同一个终端,假设终端待查询的数据表中所述第一层子页个数为9,大于预设阈值8,此时,将9个第一层子页按照4:2:3划分为3个分区。假设3个数据分区分别为分区1,分区2,分区3,此时,分区1中包括4个第一层子页,可以为第一层分页中编号为1-4的4个第一层分页,分区2中包括2个第一层子页,可以为第一层分页中编号为5-6的2个第一层分页,分区3中包括3个第一层子页,可以为第一层分页中编号为7-9的3个第一层分页。需要说明的是,所述N个数据分区中的第一层子页数目比例与所述各个线程CPU的主频比例相等或近似相等即可,并不限定各个数据分区中各个第一层子页的数据划分方法。
第二种方案为:终端读取所述数据表中与索引根页相连的第一层子页中每个子页记录的数据个数;基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,此时,所述N个数据分区中的第一层子页记录的数据个数比例与所述各个线程CPU的主频比例相等或近似相等,N为预设的并行度。
可选的,针对终端数据库中的待查询的数据表划分数据分区时,若第一层子页数目不大于预设阈值时,采用上述第二种方案。
例如,针对上述例子中的同一个终端,假设终端待查询的数据表中所述第一层子页个数为2小于预设阈值8,此时,终端读取2个第一层子页中记录的数据个数,假设第一个子页中记录的数据个数为40,第二个子页中记录的数据个数为40,将90条数据记录按照4:2:3划分为3个分区。假设3个数据分区分别为分区1,分区2,分区3,此时,分区1中包括40条数据记录,可以为第一层分页中记录的数据,分区2中包括20条数据记录,可以为第二层分页中记录的前20条数据记录,分区3中包括30条数据记录,可以为第二层分页中记录的后30条数据记录。需要说明的是,所述N个数据分区中的第一层子页记录的数据个数比例与所述各个线程CPU的主频比例相等或近似相等即可,并不限定各个数据分区中第一层子页记录的数据个数的数据划分方法。
步骤303:终端通过各个线程CPU并行查询对应的数据分区中的数据。
例如,针对上述针对上述例子中的同一个终端,假设根据终端各个线程CPU的主频比例4:2:3,将待查询的数据表划分为3个数据分区,假设3个数据分区分别为分区1,分区2,分区3,此时终端通过各个线程CPU并行查询对应的数据分区中的数据,即分区1中的数据通过终端的CPU1执行数据查询功能,分区2中的数据通过终端的CPU2执行数据查询功能,分区3中的数据通过终端的CPU3执行数据查询功能。
下面针对以B-tree形式实现的数据表来举例说明图2中的方法。
如图4所示,手机终端数据库中采用B-tree形式实现的数据表,数据表的数据组织成一个B-tree结构,在B-Tree结构的最低层的节点中存储了数据记录。图4中最低层节点中的数值(比如1-200等)表示了数据表中记录的ID号。这种表结构记录ID号从左到右是顺序排列的。第一层子页中的N个数据页分别用Page1,Page1,…PageN来表示。其中,所述手机终端为上述例子中的具有4个CPU的4核手机终端。
由于这种数据表是以整数类型的主键来组织成B-Tree结构的,图3中记录ID号就是主键,因此通过读取根页和第一层子页的记录就可以完成终端数据库中的待查询的数据表中的数据分区。
数据分区需要根据当前线程CPU的主频比例来划分,例如三个线程CPU,主频分别 为2016000,1017600,1516800,即3个线程CPU的主频比例为4:2:3,则三个线程数据分区的比例也应该与为4:2:3相同或接近。因此读取图3中记录的第一层子页的数据页Page1-PageN的数目。
如果第一层子页的数据页超过预设阈值,假设为预设阈值为8,则不需要将第一层子页Page1-PageN中记录的所有数据读出来划分,直接将第一层子页Page1-PageN按4:2:3比例划分即可,并找到最后对应的主键值即可以完成数据划分。假设第一层子页有30个页,则可以将第一层子页按照4:2:3划分,结果是(14,6,10)。即第一层子页中前14个数据页中记录的数据由线程CPU1执行,第一层子页中中间6个数据页中记录的数据由线程CPU2执行,第一层子页中后10个数据页中记录的数据由线程CPU3执行。
如果第一层子页的数据页不超过预设阈值,假设为预设阈值为8,比如第一层子页只有两个数据页分别为第一数据页和第二数据页,此时,需要将第一层子页的两个数据页中记录的数据个数读取出来,其中第一数据页记录有40条数据记录,第二数据页记录有50条数据记录,将第一层子页中记录的数据个数(即40+50=90)按照4:2:3比例划分即可,也就是说第一数据页中记录的数据由线程CPU1执行,第二数据页中记录的前20条记录由线程CPU2执行,第二数据页中记录的后30条记录由线程CPU3执行。
另一种常见的数据表组织形式是Heap表。参阅图5所示,这种形式的数据表是按照数据记录插入顺序组织,没有主键字段或主键字段是单独索引,即数据表中的数据记录不以主键排序。这种形式的数据表动态分区方法和上述B-tree形式的数据表动态分区方法完全一致,在此不再赘述。
基于上述实施例提供的终端数据库的并行执行方法,参见图6所示,本发明实施例提供一种终端数据库的并行执行装置600,该装置可以用于执行上述图3所述的方法,图6所示为本发明实施例提供的装置600的结构示意图,如图6所示,该装置600包括确定单元601、计算单元602、划分单元603和查询单元604,其中:
确定单元601,用于基于预设的并行度确定各个线程CPU,所述并行度为并行执行的线程数;
计算单元602,用于获取每个线程CPU的主频,计算各个线程CPU的主频比例;
划分单元603,用于基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;
查询单元604,用于通过各个线程CPU并行查询对应的数据分区中的数据。
可选的,所述划分单元603基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区时,具体用于:
读取所述数据表中与索引根页相连的第一层子页的个数;
按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,N为预设的并行度。
可选的,所述N个数据分区中的第一层子页数目比例与所述各个线程CPU的主频比例相等或近似相等。
可选的,所述划分单元基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区时,具体用于:
读取所述数据表中与索引根页相连的第一层子页中每个子页记录的数据个数;
基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的 数据划分为N个数据分区,N为预设的并行度。
可选的,所述N个数据分区中的第一层子页记录的数据个数比例与所述各个线程CPU的主频比例相等或近似相等。
可选的,所述数据表为B-tree格式的数据表或为heap格式的数据表。
本发明实施例上述涉及的装置600,可以是独立的部件,也可以是集成于其他部件中。
需要说明的是,本发明实施例中的装置600的各个单元的功能实现以及交互方式可以进一步参照相关方法实施例的描述,在此不再赘述。
综上所述,本发明实施例中,终端基于预设的并行度确定各个线程CPU,所述并行度为并行执行的线程数;终端获取每个线程CPU的主频,计算各个线程CPU的主频比例;终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;终端通过各个线程CPU并行查询对应的数据分区中的数据,这样能够基于终端各线程CPU的主频因素对终端数据库中待查询的数据表进行动态分区,同时利用各线程CPU对对应数据分区执行查询指令的并行化处理,能够极大提升终端对数据库的并行查询执行效率。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (12)

  1. 一种终端数据库的并行执行方法,其特征在于,包括:
    终端基于预设的并行度确定各个线程中央处理器CPU,所述并行度为并行执行的线程数;
    终端获取每个线程CPU的主频,计算各个线程CPU的主频比例;
    终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;
    终端通过各个线程CPU并行查询对应的数据分区中的数据。
  2. 如权利要求1所述的方法,其特征在于,终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,包括:
    终端读取所述数据表中与索引根页相连的第一层子页的个数;
    按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,N为预设的并行度。
  3. 如权利要求2所述的方法,其特征在于,所述N个数据分区中的第一层子页数目比例与所述各个线程CPU的主频比例相等或近似相等。
  4. 如权利要求1所述的方法,其特征在于,终端基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,包括:
    终端读取所述数据表中与索引根页相连的第一层子页中每个子页记录的数据个数;
    基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,N为预设的并行度。
  5. 如权利要求4所述的方法,其特征在于,所述N个数据分区中的第一层子页记录的数据个数比例与所述各个线程CPU的主频比例相等或近似相等。
  6. 如权利要求1所述的方法,其特征在于,所述数据表为B-tree格式的数据表或为heap格式的数据表。
  7. 一种终端数据库的并行执行装置,其特征在于,包括:
    确定单元,用于基于预设的并行度确定各个线程中央处理器CPU,所述并行度为并行执行的线程数;
    计算单元,用于获取每个线程CPU的主频,计算各个线程CPU的主频比例;
    划分单元,用于基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区,确定各个线程CPU对应的数据分区;
    查询单元,用于通过各个线程CPU并行查询对应的数据分区中的数据。
  8. 如权利要求7所述的装置,其特征在于,所述划分单元基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区时,具体用于:
    读取所述数据表中与索引根页相连的第一层子页的个数;
    按照所述各个线程CPU的主频比例将第一层子页划分为N个数据分区,N为预设的并行度。
  9. 如权利要求8所述的装置,其特征在于,所述N个数据分区中的第一层子页数目比例与所述各个线程CPU的主频比例相等或近似相等。
  10. 如权利要求8所述的装置,其特征在于,所述划分单元基于所述各个线程CPU的主频比例对终端数据库中的待查询的数据表划分数据分区时,具体用于:
    读取所述数据表中与索引根页相连的第一层子页中每个子页记录的数据个数;
    基于每个子页记录的个数,按照所述各个线程CPU的主频比例将第一层子页中记录的数据划分为N个数据分区,N为预设的并行度。
  11. 如权利要求10所述的装置,其特征在于,所述N个数据分区中的第一层子页记录的数据个数比例与所述各个线程CPU的主频比例相等或近似相等。
  12. 如权利要求7所述的装置,其特征在于,所述数据表为B-tree格式的数据表或为heap格式的数据表。
PCT/CN2017/071596 2016-01-30 2017-01-18 一种终端数据库的并行执行方法和装置 WO2017129022A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP17743637.5A EP3333733B1 (en) 2016-01-30 2017-01-18 Method and device for use in parallel execution of terminal database
US15/917,166 US10884817B2 (en) 2016-01-30 2018-03-09 Method and apparatus for parallel execution in terminal database using data partitions

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610065053.0A CN107025225B (zh) 2016-01-30 2016-01-30 一种终端数据库的并行执行方法和装置
CN201610065053.0 2016-01-30

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/917,166 Continuation US10884817B2 (en) 2016-01-30 2018-03-09 Method and apparatus for parallel execution in terminal database using data partitions

Publications (1)

Publication Number Publication Date
WO2017129022A1 true WO2017129022A1 (zh) 2017-08-03

Family

ID=59397345

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/071596 WO2017129022A1 (zh) 2016-01-30 2017-01-18 一种终端数据库的并行执行方法和装置

Country Status (4)

Country Link
US (1) US10884817B2 (zh)
EP (1) EP3333733B1 (zh)
CN (1) CN107025225B (zh)
WO (1) WO2017129022A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857742A (zh) * 2019-01-18 2019-06-07 烽火通信科技股份有限公司 一种大数据虚拟表格快速显示方法及系统

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783201A (zh) * 2017-11-13 2019-05-21 北京京东尚科信息技术有限公司 数据交换方法及其系统
CN107918676B (zh) * 2017-12-15 2022-01-18 联想(北京)有限公司 结构化查询的资源优化方法及数据库查询系统
CN108984738A (zh) * 2018-07-16 2018-12-11 中国银行股份有限公司 一种数据铺底方法及装置
CN110032448B (zh) * 2019-04-15 2021-08-17 Oppo广东移动通信有限公司 一种终端解锁控制方法、装置及计算机可读存储介质
CN110389957A (zh) * 2019-07-24 2019-10-29 深圳市盟天科技有限公司 基于分库分表的文件生成方法、装置、存储介质及设备
CN110569129A (zh) * 2019-09-12 2019-12-13 北京明略软件系统有限公司 资源分配方法及装置、存储介质、电子装置
CN110618899B (zh) * 2019-09-25 2022-02-22 浙江中控技术股份有限公司 一种数据存储方法及装置
CN112015716B (zh) * 2020-08-04 2024-02-09 北京人大金仓信息技术股份有限公司 数据库数据迁移方法、装置、介质和电子设备
CN112035523A (zh) * 2020-08-25 2020-12-04 上海达梦数据库有限公司 一种并行度的确定方法、装置、设备及存储介质
CN115576969B (zh) * 2022-12-07 2023-03-10 北京奥星贝斯科技有限公司 一种并行执行数据库任务的方法、装置、介质及设备
CN116795514A (zh) * 2023-06-30 2023-09-22 荣耀终端有限公司 应用程序的线程标识方法、电子设备以及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706741A (zh) * 2009-12-11 2010-05-12 中国人民解放军国防科学技术大学 一种基于负载平衡的cpu和gpu两级动态任务划分方法
CN101799749A (zh) * 2008-10-10 2010-08-11 Sap股份公司 用于数据管理和检索的并行协同过程
CN102135901A (zh) * 2010-01-27 2011-07-27 微软公司 带有动态数量工作者的并行查询引擎
CN103177059A (zh) * 2011-12-23 2013-06-26 Sap股份公司 用于数据库计算引擎的分离处理路径
CN104216684A (zh) * 2013-06-04 2014-12-17 阿里巴巴集团控股有限公司 一种多核并行系统及其数据处理方法
US20150066972A1 (en) * 2013-09-05 2015-03-05 Futurewei Technologies, Inc. Mechanism for Optimizing Parallel Execution of Queries on Symmetric Resources

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6606626B1 (en) * 1998-10-20 2003-08-12 Sybase, Inc. Database system with lock manager enhancement for improving concurrency
US7372857B1 (en) * 2003-05-28 2008-05-13 Cisco Technology, Inc. Methods and apparatus for scheduling tasks
US8126870B2 (en) * 2005-03-28 2012-02-28 Sybase, Inc. System and methodology for parallel query optimization using semantic-based partitioning
CN104239153B (zh) * 2014-09-29 2018-09-11 三星电子(中国)研发中心 多核cpu负载均衡的方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101799749A (zh) * 2008-10-10 2010-08-11 Sap股份公司 用于数据管理和检索的并行协同过程
CN101706741A (zh) * 2009-12-11 2010-05-12 中国人民解放军国防科学技术大学 一种基于负载平衡的cpu和gpu两级动态任务划分方法
CN102135901A (zh) * 2010-01-27 2011-07-27 微软公司 带有动态数量工作者的并行查询引擎
CN103177059A (zh) * 2011-12-23 2013-06-26 Sap股份公司 用于数据库计算引擎的分离处理路径
CN104216684A (zh) * 2013-06-04 2014-12-17 阿里巴巴集团控股有限公司 一种多核并行系统及其数据处理方法
US20150066972A1 (en) * 2013-09-05 2015-03-05 Futurewei Technologies, Inc. Mechanism for Optimizing Parallel Execution of Queries on Symmetric Resources

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109857742A (zh) * 2019-01-18 2019-06-07 烽火通信科技股份有限公司 一种大数据虚拟表格快速显示方法及系统

Also Published As

Publication number Publication date
EP3333733A1 (en) 2018-06-13
EP3333733A4 (en) 2018-08-01
EP3333733B1 (en) 2020-06-03
US10884817B2 (en) 2021-01-05
CN107025225A (zh) 2017-08-08
CN107025225B (zh) 2018-12-14
US20180196703A1 (en) 2018-07-12

Similar Documents

Publication Publication Date Title
WO2017129022A1 (zh) 一种终端数据库的并行执行方法和装置
CN108512695B (zh) 监控应用卡顿的方法及装置
US10956280B2 (en) Data backup method, electronic device, and storage medium
US10186244B2 (en) Sound effect processing method and device, plug-in unit manager and sound effect plug-in unit
US10484468B2 (en) Method and device for downloading file
US9740671B2 (en) Method and apparatus of generating a webpage from an original design file comprising layers
CN110888821B (zh) 一种内存管理方法及装置
CN105224556B (zh) 瀑布流界面显示方法及装置
CN106502703B (zh) 一种函数调用方法和装置
US9792019B2 (en) Method and terminal device for selecting character
US10317931B2 (en) Method for managing multi-core processor, and apparatus
TW201512865A (zh) 一種網頁數據搜索方法、裝置和系統
CN113742366B (zh) 数据处理方法、装置、计算机设备及存储介质
WO2021109703A1 (zh) 数据处理方法、芯片、设备及存储介质
EP2869604A1 (en) Method, apparatus and device for processing a mobile terminal resource
WO2014166266A1 (en) File scanning method and system, client and server
CN116069791A (zh) 一种数据的处理方法和装置、计算机设备
CN108984374B (zh) 一种数据库性能的测试方法和系统
WO2014166307A1 (en) Method for determining performance of process of application and computer system
WO2024037068A1 (zh) 任务调度方法、电子设备及计算机可读存储介质
US20150091821A1 (en) Method and terminal device for selecting character
WO2015124060A1 (en) Login interface displaying method and apparatus
WO2015067206A1 (zh) 一种文件查找的方法及终端
CN115525554B (zh) 模型的自动化测试方法、系统及存储介质
US9471782B2 (en) File scanning method and system, client and server

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: 17743637

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE