WO2019000675A1 - Data processing method and electronic device - Google Patents

Data processing method and electronic device Download PDF

Info

Publication number
WO2019000675A1
WO2019000675A1 PCT/CN2017/103709 CN2017103709W WO2019000675A1 WO 2019000675 A1 WO2019000675 A1 WO 2019000675A1 CN 2017103709 W CN2017103709 W CN 2017103709W WO 2019000675 A1 WO2019000675 A1 WO 2019000675A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage unit
operation request
data operation
electronic device
state
Prior art date
Application number
PCT/CN2017/103709
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 WO2019000675A1 publication Critical patent/WO2019000675A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Definitions

  • the present disclosure relates to the field of data processing, and in particular, to a data processing method and an electronic device.
  • SSDs Solid State Drives
  • the processing speed of the data is very fast; after using for a period of time, since the SSD controller needs to consume more resources for sorting the data, the bad block processing and the write equalization algorithm are processed on the data, resulting in the SSD pair. The processing speed of the data will be reduced.
  • the SSD controller is usually optimized based on the code of the SSD itself, but the optimization space is limited.
  • the embodiments of the present disclosure provide a data processing method and an electronic device, which can solve at least the above problems existing in the prior art.
  • An embodiment of the present disclosure provides a data processing method, including:
  • the data operation request is sent to the target storage unit for processing, and the operation processing result is returned to the program.
  • the acquiring, by the acquiring, the status of each storage unit in the electronic device includes:
  • the determining, according to the data operation request, the state of each storage unit that is obtained, and determining a target storage unit for responding to the data operation request includes:
  • a target storage unit for responding to the data operation request is determined based on the sort result.
  • the storing, according to the screening condition of the at least one dimension, sorting the storage units to obtain a sorting result including:
  • the storage units are sorted according to the acquired load values of the storage units, or the remaining write life values of the storage units, or the expected response time of the data operations by the storage units, to obtain a sort result.
  • the storing, according to the screening condition of the at least one dimension, sorting the storage units to obtain a sorting result including:
  • the screening condition of each dimension corresponds to a weighting value, and the score for characterizing the state of each storage unit is calculated according to the screening condition and the weighting value corresponding to each screening condition;
  • the determining, according to the sorting result, the target storage unit for responding to the data operation request comprises:
  • An embodiment of the present disclosure further provides an electronic device, including:
  • a processor configured to acquire a state of each storage unit in the electronic device, analyze a state of each acquired storage unit according to a data operation request, and determine a target storage unit for responding to the data operation request;
  • a transceiver configured to receive a data operation request from the program, send a data operation request to the target storage unit for processing, and return an operation processing result to the program.
  • the processor is specifically configured to periodically detect a state of each storage unit
  • the processor is specifically configured to determine a screening condition of multiple dimensions that characterize states of the storage units
  • a target storage unit for responding to the data operation request is determined based on the sort result.
  • the processor is specifically configured to: according to the acquired load value of each storage unit, or a remaining write lifetime value of each storage unit, or an expected response time of each storage unit to the data operation, The storage units are sorted to obtain a sort result.
  • the screening condition of each dimension corresponds to a weighting value
  • the processor is specifically configured to calculate a score for characterizing the state of each storage unit according to the screening condition and the weighting value corresponding to each screening condition
  • Another aspect of the disclosure provides a computer program comprising computer executable instructions that, when executed, are used to implement a method as described above.
  • the electronic device acquires the state of each storage unit of its own, and analyzes the acquired state of each storage unit according to the received data operation request, and determines a target storage unit for responding to the data operation request. In this way, by determining the target storage unit for responding to the data operation request according to the state of each storage unit before processing the data operation request, not only the overhead of calculating the resource generated by the SSD controller but also the balance of each storage unit is avoided. load.
  • FIG. 1 is a schematic flowchart of processing of a data processing method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of determining a target storage unit according to a usage rate of a CPU according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the techniques of this disclosure may be implemented in the form of hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer readable medium storing instructions for use by or in connection with an instruction execution system.
  • a computer readable medium can be any medium that can contain, store, communicate, propagate or transport the instructions.
  • a computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium.
  • FIG. 1 is a schematic flowchart of a data processing method according to an embodiment of the present disclosure. As shown in FIG. 1, the method includes the following steps:
  • Step S101 Acquire a state of each storage unit in the electronic device.
  • the electronic device periodically detects the state of each storage unit, stores the state of each storage unit to a storage area of the electronic device, and queries the storage area for the state of each storage unit.
  • the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources.
  • the state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
  • the electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
  • the state of the storage unit includes at least: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
  • Step S102 receiving a data operation request from a program
  • the electronic device receives a data operation request from the program
  • the program is a program installed on the electronic device;
  • the data operation request may be a request sent by a user clicking an application or function that triggers the program.
  • Step S103 analyzing the acquired state of each storage unit according to the data operation request, and determining a target storage unit for responding to the data operation request;
  • the electronic device determines a screening condition that identifies a plurality of dimensions of the states of the storage units; sorts the storage units according to the screening conditions of the at least one dimension to obtain a sorting result; and determines, according to the sorting result, the response The target storage unit of the data operation request.
  • the screening conditions include: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
  • the load value of the storage unit includes: a central processing unit (CPU) usage rate of the storage unit, a continuous working time of the storage unit, a temperature of the storage unit, a read/write status of the storage unit, and the like.
  • CPU central processing unit
  • Step S104 sending the data operation request to the target storage unit for processing, and returning an operation processing result to the program;
  • the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
  • the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
  • FIG. 2 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 2, the method includes the following steps:
  • Step S201 the electronic device periodically detects the state of each storage unit, and stores the state of each storage unit.
  • the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources.
  • the state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
  • the electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
  • the state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
  • the state of the storage unit When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
  • Step S202 the electronic device receives a data operation request from the program
  • the program is a program installed on the electronic device; the data operation request may be sent by a user clicking an application or function corresponding to triggering the program.
  • Step S203 analyzing a load value of each storage unit according to the data operation request, and determining a target storage unit for responding to the data operation request;
  • the electronic device analyzes the load value of each storage unit according to the data operation request;
  • the parameter used to represent the load value of the storage unit includes: a usage rate of the storage unit CPU, a continuous working time of the storage unit, a temperature of the storage unit, Read and write status of the storage unit, etc.;
  • the storage unit load value can be characterized by one of the above parameters or in combination with the above plurality of parameters.
  • FIG. 3 is a schematic diagram of determining a target storage unit according to a usage rate of a CPU according to an embodiment of the present disclosure. As shown in FIG. 3, when an application sends a data operation request, the usage rates of the CPUs of the four SSDs acquired by the electronic device are respectively 43%, 21%, 86%, and 13%; therefore, the SSD that determines the CPU usage rate of 13% is the target storage unit for responding to data operation requests sent by the application.
  • a storage unit in a non-read-write state may be arbitrarily selected as a target storage unit for responding to the data operation request; or a target for responding to the data operation request may be determined according to parameters of other dimensions. Storage unit.
  • the continuous working time of each storage unit is sorted to obtain a sorting result; and the storage unit with the shortest continuous working time in the sorting result is determined to be used for the response The target storage unit of the data operation request.
  • Step S204 sending the data operation request to the target storage unit for processing, and returning an operation processing result to the program
  • the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
  • the result of the operation processing is that a data operation request for the program is being processed by the pointer; for example, the data operation
  • the corresponding operation processing result is that data is being written; when the data operation request is read data, the corresponding operation processing result is reading data.
  • Step S205 the target storage unit responds to the data operation request
  • the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
  • FIG. 4 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 4, the method includes the following steps:
  • Step S301 the electronic device periodically detects the state of each storage unit, and stores the state of each storage unit.
  • the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources.
  • the state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
  • the electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
  • the state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
  • the state of the storage unit When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
  • Step S302 the electronic device receives a data operation request from the program
  • the program is a program installed on the electronic device; the data operation request may be sent by a user clicking an application or function corresponding to triggering the program.
  • Step S303 analyzing a remaining write lifetime value of each storage unit according to the data operation request, and determining a target storage unit for responding to the data operation request;
  • the electronic device sorts the storage units according to the remaining write lifetime values of the storage units to obtain a sort result; and determines that the storage unit with the largest write lifetime value in the sort result is used for response.
  • the target storage unit of the data operation request is a sort result of the data operation request.
  • Step S304 the data operation request is sent to the target storage unit for processing, and the operation processing result is returned to the program.
  • the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
  • the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
  • Step S305 the target storage unit responds to the data operation request
  • the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
  • FIG. 5 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 5, the method includes the following steps:
  • Step S401 the electronic device periodically detects the state of each storage unit and stores the state of each storage unit.
  • the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources.
  • the state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
  • the electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
  • the state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
  • the state of the storage unit When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
  • Step S402 the electronic device receives a data operation request from the program
  • the program is a program installed on the electronic device; the data operation request may be sent by a user clicking an application or function corresponding to triggering the program.
  • Step S403 analyzing an expected response time of each storage unit for the data operation according to the data operation request, and determining a target storage unit for responding to the data operation request;
  • the electronic device determines, according to the data operation request, a tolerance delay time of the program to respond to the data operation request; and sorts an expected response time of each data unit for the data operation to obtain a sort result; and determines the sorting
  • the storage unit with the shortest expected response time for the data operation in the result is the target storage unit for responding to the data operation request, or the expected response time for the data operation in the sort result is less than any of the tolerance delay times.
  • a storage unit is a target storage unit for responding to the data operation request.
  • Step S404 sending the data operation request to the target storage unit for processing, and returning to the program Operation processing results.
  • the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
  • the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
  • Step S405 the target storage unit responds to the data operation request
  • the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
  • FIG. 6 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 6, the method includes the following steps:
  • Step S501 the electronic device periodically detects the state of each storage unit and stores the state of each storage unit.
  • the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources. And storing the state of each storage unit to a reserved byte in the SSD read/write protocol; or storing the state of each storage unit to a preset cache area or the like.
  • the electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
  • the state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
  • the state of the storage unit When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
  • Step S502 the electronic device receives a data operation request from the program
  • the program is a program installed on the electronic device;
  • the data operation request may be a request sent by a user clicking an application or function that triggers the program.
  • Step S503 sorting each storage unit according to the screening condition of multiple dimensions, and obtaining a sorting result
  • the screening condition of each dimension corresponds to a weighting value
  • the electronic device calculates a score for characterizing the state of each storage unit according to the screening condition and the weighting value corresponding to each screening condition; determining the storage unit with the highest score as the target Storage unit.
  • the filtering condition is the load value a of the storage unit, the corresponding weighting value is A, the filtering condition is the remaining writing lifetime value b of the storage unit, and the corresponding weighting value is B, and the filtering condition is that the storage unit operates on the data.
  • the target storage unit may be determined according to the screening condition of any two dimensions; specifically, when the data operation request is a read operation request, first determining to store the read operation according to the data operation request a storage unit of the corresponding data as a candidate storage unit; and sorting the candidate storage units according to a load value of the storage unit, or a remaining write lifetime value, or an expected response time of the data operation, and determining according to the sorting result A target storage unit for responding to the data operation request.
  • the data operation request is a write operation request
  • first determining a read/write state of each storage unit selecting a storage unit in a non-read-write state as a candidate storage unit;
  • the candidate storage unit is sorted by the load value, or the remaining write life value, or the expected response time for the data operation, and the target storage unit for responding to the data operation request is determined based on the sort result.
  • the above is only two embodiments for determining the target storage unit according to the screening conditions of the two dimensions.
  • the response may be determined according to the data operation request and the screening condition of any two or more dimensions.
  • the target storage unit for the data operation request may be determined according to the data operation request and the screening condition of any two or more dimensions.
  • Step S504 the data operation request is sent to the target storage unit for processing, and the operation processing result is returned to the program.
  • the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
  • the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
  • Step S505 the target storage unit responds to the data operation request
  • the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 7, the processor 11 and the transceiver are included. 12 and a storage unit 13; wherein
  • the processor 11 is configured to acquire a state of each storage unit in the electronic device, analyze a state of each acquired storage unit according to a data operation request, and determine a target storage unit for responding to the data operation request.
  • the state of the storage unit includes at least: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
  • the load value of the storage unit further includes: a CPU usage rate of the storage unit, a continuous working time of the storage unit, a temperature of the storage unit, a read/write status of the storage unit, and the like.
  • the transceiver 12 is configured to receive a data operation request from a program, send a data operation request to the target storage unit for processing, and return an operation processing result to the program.
  • the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
  • the processor 11 is specifically configured to periodically detect the status of each storage unit.
  • the processor 11 is specifically configured to determine a screening condition of multiple dimensions that characterize states of the storage units
  • a target storage unit for responding to the data operation request is determined based on the sort result.
  • the processor 11 is specifically configured to: according to the acquired load value of each storage unit, or the remaining write life value of each storage unit, or the expected response time of each storage unit to the data operation, Sorting the storage units to obtain a sort result.
  • the filtering condition of each dimension corresponds to a weighting value
  • the processor 11 is specifically configured to calculate a score for characterizing the state of each storage unit according to the screening condition and the weighting value corresponding to each screening condition
  • the functions performed by the processor 11 and the transceiver 12 in the electronic device in the embodiment of the present disclosure may be implemented by a CPU, an microprocessor (MPU), or a digital signal processor (DSP) on the electronic device. Or a programmable gate array (FPGA) implementation.
  • MPU microprocessor
  • DSP digital signal processor
  • FPGA programmable gate array
  • a person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions.
  • the foregoing program may be stored in a computer readable storage unit, and the program is executed when executed.
  • the foregoing storage unit includes: SSD, mobile storage device, read-only memory (ROM), random access memory (RAM), disk or optical disk, and the like. A variety of media that can store program code.
  • the above-described integrated unit of the present disclosure may be stored in a computer readable storage unit if it is implemented in the form of a software function module and sold or used as a standalone product.
  • the technical solution of the embodiments of the present disclosure may be embodied in the form of a software product in essence or in the form of a software product, which is stored in a storage unit and includes a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present disclosure.
  • the foregoing storage unit includes: a removable storage device, a ROM, a RAM, a magnetic disk, or an optical disk, and the like, which can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Provided is a data processing method and an electronic device. The method comprises: obtaining a status of each storage unit in the electronic device (S101); receiving a data operation request from a program (S102); determining, according to the data operation request, the obtained status of each storage unit, and determining a target storage unit for responding to the data operation request (S103); and transmitting the data operation request to the target storage unit for processing, and returning an operation processing result to the program (S104).

Description

一种数据处理方法及电子设备Data processing method and electronic device 技术领域Technical field
本公开涉及数据处理领域,尤其涉及一种数据处理方法及电子设备。The present disclosure relates to the field of data processing, and in particular, to a data processing method and an electronic device.
背景技术Background technique
固态硬盘(Solid State Drives,SSD)作为高速存储介质,其应用越来越广泛。SSD在刚投入使用时,对数据的处理速度很快;使用一段时间之后,由于SSD控制器需要消耗更多的资源用于整理数据,对数据进行坏块处理和写均衡算法处理,导致SSD对数据的处理速度会降低。Solid State Drives (SSDs) are widely used as high-speed storage media. When the SSD is just put into use, the processing speed of the data is very fast; after using for a period of time, since the SSD controller needs to consume more resources for sorting the data, the bad block processing and the write equalization algorithm are processed on the data, resulting in the SSD pair. The processing speed of the data will be reduced.
现有技术中,通常基于SSD本身的代码对SSD控制器进行优化,但是优化空间有限。In the prior art, the SSD controller is usually optimized based on the code of the SSD itself, but the optimization space is limited.
发明内容Summary of the invention
为解决现有存在的技术问题,本公开实施例提供了一种数据处理方法及电子设备,能至少解决现有技术中存在的上述问题。In order to solve the existing technical problems, the embodiments of the present disclosure provide a data processing method and an electronic device, which can solve at least the above problems existing in the prior art.
本公开实施例提供一种数据处理方法,包括:An embodiment of the present disclosure provides a data processing method, including:
获取电子设备内各存储单元的状态;Obtaining a status of each storage unit in the electronic device;
接收来自程序的数据操作请求;Receiving a data operation request from a program;
根据所述数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元;And analyzing, according to the data operation request, the acquired status of each storage unit, and determining a target storage unit for responding to the data operation request;
将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果。The data operation request is sent to the target storage unit for processing, and the operation processing result is returned to the program.
上述方案中,所述获取电子设备内各存储单元的状态包括:In the above solution, the acquiring, by the acquiring, the status of each storage unit in the electronic device includes:
定时检测各存储单元的状态;Timingly detecting the status of each storage unit;
将所述各存储单元的状态存储至所述电子设备的存储区域;Storing the state of each storage unit to a storage area of the electronic device;
在所述存储区域查询所述各存储单元的状态。Querying the status of each storage unit in the storage area.
上述方案中,所述根据所述数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元,包括:In the above solution, the determining, according to the data operation request, the state of each storage unit that is obtained, and determining a target storage unit for responding to the data operation request, includes:
确定表征所述各存储单元的状态的多个维度的筛选条件;Determining screening conditions for a plurality of dimensions characterizing the states of the respective storage units;
根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果; Sorting each storage unit according to the screening condition of at least one dimension, and obtaining a sorting result;
根据所述排序结果确定用于响应所述数据操作请求的目标存储单元。A target storage unit for responding to the data operation request is determined based on the sort result.
上述方案中,所述根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果,包括:In the foregoing solution, the storing, according to the screening condition of the at least one dimension, sorting the storage units to obtain a sorting result, including:
根据所获取到的各存储单元的负荷值、或各存储单元的剩余写入寿命值、或各存储单元对所述数据操作的预计响应时间,对所述各存储单元进行排序,得到排序结果。The storage units are sorted according to the acquired load values of the storage units, or the remaining write life values of the storage units, or the expected response time of the data operations by the storage units, to obtain a sort result.
上述方案中,所述根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果,包括:In the foregoing solution, the storing, according to the screening condition of the at least one dimension, sorting the storage units to obtain a sorting result, including:
每个维度的筛选条件对应一个加权值,根据筛选条件及各筛选条件对应的加权值计算用于表征各存储单元状态的评分;The screening condition of each dimension corresponds to a weighting value, and the score for characterizing the state of each storage unit is calculated according to the screening condition and the weighting value corresponding to each screening condition;
相应的,所述根据所述排序结果确定用于响应所述数据操作请求的目标存储单元,包括:Correspondingly, the determining, according to the sorting result, the target storage unit for responding to the data operation request comprises:
确定评分最高的存储单元为目标存储单元。Determine the storage unit with the highest score as the target storage unit.
本公开实施例还提供一种电子设备,包括:An embodiment of the present disclosure further provides an electronic device, including:
处理器,用于获取所述电子设备内各存储单元的状态,根据数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元;a processor, configured to acquire a state of each storage unit in the electronic device, analyze a state of each acquired storage unit according to a data operation request, and determine a target storage unit for responding to the data operation request;
收发器,用于接收来自程序的数据操作请求,发送数据操作请求至所述目标存储单元进行处理,并向所述程序返回操作处理结果。And a transceiver, configured to receive a data operation request from the program, send a data operation request to the target storage unit for processing, and return an operation processing result to the program.
上述方案中,所述处理器,具体用于定时检测各存储单元的状态;In the foregoing solution, the processor is specifically configured to periodically detect a state of each storage unit;
将所述各存储单元的状态存储至所述电子设备的存储区域;Storing the state of each storage unit to a storage area of the electronic device;
在所述存储区域查询所述各存储单元的状态。Querying the status of each storage unit in the storage area.
上述方案中,所述处理器,具体用于确定表征所述各存储单元的状态的多个维度的筛选条件;In the above solution, the processor is specifically configured to determine a screening condition of multiple dimensions that characterize states of the storage units;
根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果;Sorting each storage unit according to the screening condition of at least one dimension, and obtaining a sorting result;
根据所述排序结果确定用于响应所述数据操作请求的目标存储单元。A target storage unit for responding to the data operation request is determined based on the sort result.
上述方案中,所述处理器,具体用于根据所获取到的各存储单元的负荷值、或各存储单元的剩余写入寿命值、或各存储单元对所述数据操作的预计响应时间,对所述各存储单元进行排序,得到排序结果。In the above solution, the processor is specifically configured to: according to the acquired load value of each storage unit, or a remaining write lifetime value of each storage unit, or an expected response time of each storage unit to the data operation, The storage units are sorted to obtain a sort result.
上述方案中,每个维度的筛选条件对应一个加权值,所述处理器,具体用于根据筛选条件及各筛选条件对应的加权值计算用于表征各存储单元状态的评分;In the above solution, the screening condition of each dimension corresponds to a weighting value, and the processor is specifically configured to calculate a score for characterizing the state of each storage unit according to the screening condition and the weighting value corresponding to each screening condition;
确定评分最高的存储单元为目标存储单元。Determine the storage unit with the highest score as the target storage unit.
本公开的另一方面提供了一种计算机程序,所述计算机程序包括计算机可执行指令,所述指令在被执行时用于实现如上所述的方法。 Another aspect of the disclosure provides a computer program comprising computer executable instructions that, when executed, are used to implement a method as described above.
本公开实施例中,电子设备获取自身的各存储单元的状态,并根据接收到的数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元。如此,通过在处理数据操作请求之前,根据各存储单元的状态确定用于响应所述数据操作请求的目标存储单元,不仅避免了计算SSD控制器的资源产生的开销,而且均衡了各存储单元的负荷。In the embodiment of the present disclosure, the electronic device acquires the state of each storage unit of its own, and analyzes the acquired state of each storage unit according to the received data operation request, and determines a target storage unit for responding to the data operation request. In this way, by determining the target storage unit for responding to the data operation request according to the state of each storage unit before processing the data operation request, not only the overhead of calculating the resource generated by the SSD controller but also the balance of each storage unit is avoided. load.
附图说明DRAWINGS
图1为本公开实施例提供的一种数据处理方法的处理流程示意图;1 is a schematic flowchart of processing of a data processing method according to an embodiment of the present disclosure;
图2为本公开实施例提供的另一种数据处理方法的处理流程示意图;2 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure;
图3为本公开实施例提供的根据CUP的使用率确定目标存储单元示意图;FIG. 3 is a schematic diagram of determining a target storage unit according to a usage rate of a CPU according to an embodiment of the present disclosure;
图4为本公开实施例提供的另一种数据处理方法的处理流程示意图;4 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure;
图5为本公开实施例提供的另一种数据处理方法的处理流程示意图;FIG. 5 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure;
图6为本公开实施例提供的另一种数据处理方法的处理流程示意图;以及FIG. 6 is a schematic flowchart of processing of another data processing method according to an embodiment of the present disclosure;
图7为本公开实施例提供的一种电子设备的组成结构示意图。FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下,将参照附图来描述本公开的实施例。但是应该理解,这些描述只是示例性的,而并非要限制本公开的范围。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本公开的概念。Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. It should be understood, however, that the description is only illustrative, and is not intended to limit the scope of the disclosure. In addition, descriptions of well-known structures and techniques are omitted in the following description in order to avoid unnecessarily obscuring the concept of the present disclosure.
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。The terminology used herein is for the purpose of describing the particular embodiments, The use of the terms "comprising", "comprising" or "an"
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。All terms (including technical and scientific terms) used herein have the meaning commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted as having a meaning consistent with the context of the present specification and should not be interpreted in an ideal or too rigid manner.
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。在使用类似于“A、B或C等中至少一个”这样的表 述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B或C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。本领域技术人员还应理解,实质上任意表示两个或更多可选项目的转折连词和/或短语,无论是在说明书、权利要求书还是附图中,都应被理解为给出了包括这些项目之一、这些项目任一方、或两个项目的可能性。例如,短语“A或B”应当被理解为包括“A”或“B”、或“A和B”的可能性。Where an expression similar to "at least one of A, B, and C, etc." is used, it should generally be interpreted in accordance with the meaning of the expression as commonly understood by those skilled in the art (for example, "having A, B, and C" "Systems of at least one of" shall include, but are not limited to, systems having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc. ). Using a table similar to "at least one of A, B, or C, etc." In the case of the description, it should be generally explained in accordance with the meaning of the expression as generally understood by those skilled in the art (for example, "a system having at least one of A, B or C" should include, but is not limited to, having A alone, alone B, having C alone, having A and B, having A and C, having B and C, and/or having A, B, C, etc.). Those skilled in the art will also appreciate that transitional conjunctions and/or phrases that are arbitrarily arbitrarily representing two or more optional items, whether in the specification, claims, or drawings, are to be construed as The possibility of one of the projects, either or both of these projects. For example, the phrase "A or B" should be understood to include the possibility of "A" or "B", or "A and B."
附图中示出了一些方框图和/或流程图。应理解,方框图和/或流程图中的一些方框或其组合可以由计算机程序指令来实现。这些计算机程序指令可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,从而这些指令在由该处理器执行时可以创建用于实现这些方框图和/或流程图中所说明的功能/操作的装置。Some block diagrams and/or flowcharts are shown in the drawings. It will be understood that some blocks or combinations of the block diagrams and/or flowcharts can be implemented by computer program instructions. These computer program instructions may be provided to a general purpose computer, a special purpose computer or a processor of other programmable data processing apparatus such that when executed by the processor, the instructions may be used to implement the functions illustrated in the block diagrams and/or flowcharts. / operating device.
因此,本公开的技术可以硬件和/或软件(包括固件、微代码等)的形式来实现。另外,本公开的技术可以采取存储有指令的计算机可读介质上的计算机程序产品的形式,该计算机程序产品可供指令执行系统使用或者结合指令执行系统使用。在本公开的上下文中,计算机可读介质可以是能够包含、存储、传送、传播或传输指令的任意介质。例如,计算机可读介质可以包括但不限于电、磁、光、电磁、红外或半导体系统、装置、器件或传播介质。计算机可读介质的具体示例包括:磁存储装置,如磁带或硬盘(HDD);光存储装置,如光盘(CD-ROM);存储器,如随机存取存储器(RAM)或闪存;和/或有线/无线通信链路。本公开实施例提供了一种数据处理方法,图1为本公开实施例提供的一种数据处理方法的处理流程示意图,如图1所示,包括以下步骤:Thus, the techniques of this disclosure may be implemented in the form of hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer readable medium storing instructions for use by or in connection with an instruction execution system. In the context of the present disclosure, a computer readable medium can be any medium that can contain, store, communicate, propagate or transport the instructions. For example, a computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the computer readable medium include: a magnetic storage device such as a magnetic tape or a hard disk (HDD); an optical storage device such as a compact disk (CD-ROM); a memory such as a random access memory (RAM) or a flash memory; and/or a wired /Wireless communication link. The embodiment of the present disclosure provides a data processing method. FIG. 1 is a schematic flowchart of a data processing method according to an embodiment of the present disclosure. As shown in FIG. 1, the method includes the following steps:
步骤S101,获取电子设备内各存储单元的状态;Step S101: Acquire a state of each storage unit in the electronic device.
具体地,电子设备定时检测自身各存储单元的状态,将所述各存储单元的状态存储至所述电子设备的存储区域,在所述存储区域查询所述各存储单元的状态。Specifically, the electronic device periodically detects the state of each storage unit, stores the state of each storage unit to a storage area of the electronic device, and queries the storage area for the state of each storage unit.
这里,检测各存储单元的状态的周期可根据需要灵活设定;存储所述各存储单元的状态的存储区域也可根据电子设备的属性灵活设定;如,为减小SSD读写资源的消耗,可将所述各存储单元的状态存储至SSD读写协议中某个预留字节;或将所述各存储单元的状态存储至预先设定的缓存区域等。Here, the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources. The state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
所述电子设备内部包括一个或多个存储单元,在电子设备内部包括多个存储单元时,获取每个存储单元的状态;所述存储单元为SSD、或其他类型的存储介质。The electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
所述存储单元的状态至少包括:存储单元的负荷值、存储单元的剩余写入寿命值、存储单元对数据操作的预计响应时间。 The state of the storage unit includes at least: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
步骤S102,接收来自程序的数据操作请求;Step S102, receiving a data operation request from a program;
具体地,电子设备接收来自程序的数据操作请求;Specifically, the electronic device receives a data operation request from the program;
这里,所述程序为安装于所述电子设备上的程序;所述数据操作请求可以是通过用户点击触发所述程序对应的应用或功能而发送的请求。Here, the program is a program installed on the electronic device; the data operation request may be a request sent by a user clicking an application or function that triggers the program.
步骤S103,根据所述数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元;Step S103, analyzing the acquired state of each storage unit according to the data operation request, and determining a target storage unit for responding to the data operation request;
具体地,电子设备确定表征所述各存储单元的状态的多个维度的筛选条件;根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果;根据所述排序结果确定用于响应所述数据操作请求的目标存储单元。Specifically, the electronic device determines a screening condition that identifies a plurality of dimensions of the states of the storage units; sorts the storage units according to the screening conditions of the at least one dimension to obtain a sorting result; and determines, according to the sorting result, the response The target storage unit of the data operation request.
这里,所述筛选条件包括:存储单元的负荷值、存储单元的剩余写入寿命值、存储单元对数据操作的预计响应时间。Here, the screening conditions include: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
其中,存储单元的负荷值包括:存储单元的中央处理器(Central Processing Unit,CPU)使用率、存储单元的连续工作时间、存储单元的温度、存储单元的读写状态等。The load value of the storage unit includes: a central processing unit (CPU) usage rate of the storage unit, a continuous working time of the storage unit, a temperature of the storage unit, a read/write status of the storage unit, and the like.
步骤S104,将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果;Step S104, sending the data operation request to the target storage unit for processing, and returning an operation processing result to the program;
具体地,电子设备将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果;Specifically, the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
这里,所述操作处理结果是指针对所述程序的数据操作请求正在处理;如,所述数据操作请求为写数据时,相应的所述操作处理结果为正在写数据;所述数据操作请求为读数据时,相应的所述操作处理结果为正在读数据。Here, the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
本公开实施例还提供了一种数据处理方法,图2为本公开实施例提供的另一种数据处理方法的处理流程示意图,如图2所示,包括以下步骤:The embodiment of the present disclosure further provides a data processing method. FIG. 2 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 2, the method includes the following steps:
步骤S201,电子设备定时检测自身各存储单元的状态,并存储所述各存储单元的状态;Step S201, the electronic device periodically detects the state of each storage unit, and stores the state of each storage unit.
这里,检测各存储单元的状态的周期可根据需要灵活设定;存储所述各存储单元的状态的存储区域也可根据电子设备的属性灵活设定;如,为减小SSD读写资源的消耗,可将所述各存储单元的状态存储至SSD读写协议中某个预留字节;或将所述各存储单元的状态存储至预先设定的缓存区域等。Here, the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources. The state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
所述电子设备内部包括一个或多个存储单元,在电子设备内部包括多个存储单元时,获取每个存储单元的状态;所述存储单元为SSD、或其他类型的存储介质。The electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
所述存储单元的状态包括:存储单元的负荷值、存储单元的剩余写入寿命值、存储单元对数据操作的预计响应时间。 The state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
在存储区域预先存储有存储单元的状态时,检测存储单元的状态后,更新所述存储区域内已经存储的该存储单元的状态;在所述存储区域内没有存储该存储单元的状态时,检测存储单元的状态后,在所述存储区域内增加该存储单元的状态。When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
步骤S202,电子设备接收来自程序的数据操作请求;Step S202, the electronic device receives a data operation request from the program;
这里,所述程序为安装于所述电子设备上的程序;所述数据操作请求可通过用户点击触发所述程序对应的应用或功能发送。Here, the program is a program installed on the electronic device; the data operation request may be sent by a user clicking an application or function corresponding to triggering the program.
步骤S203,根据所述数据操作请求分析各存储单元的负荷值,确定用于响应所述数据操作请求的目标存储单元;Step S203, analyzing a load value of each storage unit according to the data operation request, and determining a target storage unit for responding to the data operation request;
具体地,电子设备根据所述数据操作请求分析各存储单元的负荷值;用于表征存储单元的负荷值的参数包括:存储单元CPU的使用率、存储单元的连续工作时间、存储单元的温度、存储单元的读写状态等;Specifically, the electronic device analyzes the load value of each storage unit according to the data operation request; the parameter used to represent the load value of the storage unit includes: a usage rate of the storage unit CPU, a continuous working time of the storage unit, a temperature of the storage unit, Read and write status of the storage unit, etc.;
因此,在分析各存储单元的负荷值时,可以用上述的一个参数、或结合上述的多个参数来表征存储单元负荷值。Therefore, when analyzing the load value of each storage unit, the storage unit load value can be characterized by one of the above parameters or in combination with the above plurality of parameters.
在用存储单元CPU的使用率来表征存储单元的负荷值时,对各存储单元CPU的使用率进行排序,得到排序结果;确定所述排序结果中CPU的使用率最低的存储单元为用于响应所述数据操作请求的目标存储单元。图3为本公开实施例提供的根据CUP的使用率确定目标存储单元示意图,如图3所示,一个应用程序发送数据操作请求时,获取到电子设备的四个SSD的CPU的使用率分别为43%、21%、86%和13%;因此,确定CPU的使用率为13%的SSD为目标存储单元,用于响应应用程序发送的数据操作请求。When the load value of the storage unit is used to represent the load value of the storage unit, the usage rate of each storage unit CPU is sorted to obtain a sort result; and the storage unit with the lowest CPU usage in the sort result is determined to be used for response. The target storage unit of the data operation request. FIG. 3 is a schematic diagram of determining a target storage unit according to a usage rate of a CPU according to an embodiment of the present disclosure. As shown in FIG. 3, when an application sends a data operation request, the usage rates of the CPUs of the four SSDs acquired by the electronic device are respectively 43%, 21%, 86%, and 13%; therefore, the SSD that determines the CPU usage rate of 13% is the target storage unit for responding to data operation requests sent by the application.
在用存储单元的读写状态来表征存储单元的负荷值时,确定处于非读写状态的存储单元为用于响应所述数据操作请求的目标存储单元;在处于非读写状态的存储单元的数量为多个时,可任意选择一个处于非读写状态的存储单元为用于响应所述数据操作请求的目标存储单元;或根据其他维度的参数来确定用于响应所述数据操作请求的目标存储单元。When the load value of the storage unit is used to characterize the load value of the storage unit, determining that the storage unit in the non-read-write state is the target storage unit for responding to the data operation request; in the storage unit in the non-read-write state When the number is plural, a storage unit in a non-read-write state may be arbitrarily selected as a target storage unit for responding to the data operation request; or a target for responding to the data operation request may be determined according to parameters of other dimensions. Storage unit.
在用存储单元的连续工作时间来表征存储单元的负荷值时,对各存储单元的连续工作时间进行排序,得到排序结果;确定所述排序结果中连续工作时间最短的存储单元为用于响应所述数据操作请求的目标存储单元。When the load value of the storage unit is characterized by the continuous working time of the storage unit, the continuous working time of each storage unit is sorted to obtain a sorting result; and the storage unit with the shortest continuous working time in the sorting result is determined to be used for the response The target storage unit of the data operation request.
步骤S204,将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果;Step S204, sending the data operation request to the target storage unit for processing, and returning an operation processing result to the program;
具体地,电子设备将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果;Specifically, the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
这里,所述操作处理结果是指针对所述程序的数据操作请求正在处理;如,所述数据操 作请求为写数据时,相应的所述操作处理结果为正在写数据;所述数据操作请求为读数据时,相应的所述操作处理结果为正在读数据。Here, the result of the operation processing is that a data operation request for the program is being processed by the pointer; for example, the data operation When the request is to write data, the corresponding operation processing result is that data is being written; when the data operation request is read data, the corresponding operation processing result is reading data.
步骤S205,目标存储单元响应所述数据操作请求;Step S205, the target storage unit responds to the data operation request;
具体地,目标存储单元响应所述数据操作请求,对所述数据进行相应的操作,如读数据或写数据等。Specifically, the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
本公开实施例还提供了一种数据处理方法,图4为本公开实施例提供的另一种数据处理方法的处理流程示意图,如图4所示,包括以下步骤:The embodiment of the present disclosure further provides a data processing method. FIG. 4 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 4, the method includes the following steps:
步骤S301,电子设备定时检测自身各存储单元的状态,并存储所述各存储单元的状态;Step S301, the electronic device periodically detects the state of each storage unit, and stores the state of each storage unit.
这里,检测各存储单元的状态的周期可根据需要灵活设定;存储所述各存储单元的状态的存储区域也可根据电子设备的属性灵活设定;如,为减小SSD读写资源的消耗,可将所述各存储单元的状态存储至SSD读写协议中某个预留字节;或将所述各存储单元的状态存储至预先设定的缓存区域等。Here, the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources. The state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
所述电子设备内部包括一个或多个存储单元,在电子设备内部包括多个存储单元时,获取每个存储单元的状态;所述存储单元为SSD、或其他类型的存储介质。The electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
所述存储单元的状态包括:存储单元的负荷值、存储单元的剩余写入寿命值、存储单元对数据操作的预计响应时间。The state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
在存储区域预先存储有存储单元的状态时,检测存储单元的状态后,更新所述存储区域内已经存储的该存储单元的状态;在所述存储区域内没有存储该存储单元的状态时,检测存储单元的状态后,在所述存储区域内增加该存储单元的状态。When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
步骤S302,电子设备接收来自程序的数据操作请求;Step S302, the electronic device receives a data operation request from the program;
这里,所述程序为安装于所述电子设备上的程序;所述数据操作请求可通过用户点击触发所述程序对应的应用或功能发送。Here, the program is a program installed on the electronic device; the data operation request may be sent by a user clicking an application or function corresponding to triggering the program.
步骤S303,根据所述数据操作请求分析各存储单元的剩余写入寿命值,确定用于响应所述数据操作请求的目标存储单元;Step S303, analyzing a remaining write lifetime value of each storage unit according to the data operation request, and determining a target storage unit for responding to the data operation request;
具体地,电子设备根据对所述各存储单元的剩余写入寿命值对所述各存储单元进行排序,得到排序结果;确定所述排序结果中剩余写入寿命值最大的存储单元为用于响应所述数据操作请求的目标存储单元。Specifically, the electronic device sorts the storage units according to the remaining write lifetime values of the storage units to obtain a sort result; and determines that the storage unit with the largest write lifetime value in the sort result is used for response. The target storage unit of the data operation request.
步骤S304,将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果。Step S304, the data operation request is sent to the target storage unit for processing, and the operation processing result is returned to the program.
具体地,电子设备将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果; Specifically, the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
这里,所述操作处理结果是指针对所述程序的数据操作请求正在处理;如,所述数据操作请求为写数据时,相应的所述操作处理结果为正在写数据;所述数据操作请求为读数据时,相应的所述操作处理结果为正在读数据。Here, the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
步骤S305,目标存储单元响应所述数据操作请求;Step S305, the target storage unit responds to the data operation request;
具体地,目标存储单元响应所述数据操作请求,对所述数据进行相应的操作,如读数据或写数据等。Specifically, the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
本公开实施例还提供了一种数据处理方法,图5为本公开实施例提供的另一种数据处理方法的处理流程示意图,如图5所示,包括以下步骤:The embodiment of the present disclosure further provides a data processing method. FIG. 5 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 5, the method includes the following steps:
步骤S401,电子设备定时检测自身各存储单元的状态,并存储所述各存储单元的状态;Step S401, the electronic device periodically detects the state of each storage unit and stores the state of each storage unit.
这里,检测各存储单元的状态的周期可根据需要灵活设定;存储所述各存储单元的状态的存储区域也可根据电子设备的属性灵活设定;如,为减小SSD读写资源的消耗,可将所述各存储单元的状态存储至SSD读写协议中某个预留字节;或将所述各存储单元的状态存储至预先设定的缓存区域等。Here, the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources. The state of each storage unit may be stored to a reserved byte in the SSD read/write protocol; or the state of each storage unit may be stored in a preset cache area or the like.
所述电子设备内部包括一个或多个存储单元,在电子设备内部包括多个存储单元时,获取每个存储单元的状态;所述存储单元为SSD、或其他类型的存储介质。The electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
所述存储单元的状态包括:存储单元的负荷值、存储单元的剩余写入寿命值、存储单元对数据操作的预计响应时间。The state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
在存储区域预先存储有存储单元的状态时,检测存储单元的状态后,更新所述存储区域内已经存储的该存储单元的状态;在所述存储区域内没有存储该存储单元的状态时,检测存储单元的状态后,在所述存储区域内增加该存储单元的状态。When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
步骤S402,电子设备接收来自程序的数据操作请求;Step S402, the electronic device receives a data operation request from the program;
这里,所述程序为安装于所述电子设备上的程序;所述数据操作请求可通过用户点击触发所述程序对应的应用或功能发送。Here, the program is a program installed on the electronic device; the data operation request may be sent by a user clicking an application or function corresponding to triggering the program.
步骤S403,根据所述数据操作请求分析各存储单元对数据操作的预计响应时间,确定用于响应所述数据操作请求的目标存储单元;Step S403, analyzing an expected response time of each storage unit for the data operation according to the data operation request, and determining a target storage unit for responding to the data operation request;
具体地,电子设备根据所述数据操作请求确定所述程序对响应所述数据操作请求的容忍延迟时间;并对各存储单元对数据操作的预计响应时间进行排序,得到排序结果;确定所述排序结果中对数据操作的预计响应时间最短的存储单元为用于响应所述数据操作请求的目标存储单元,或在所述排序结果中对数据操作的预计响应时间小于所述容忍延迟时间中任意选择一存储单元为用于响应所述数据操作请求的目标存储单元。Specifically, the electronic device determines, according to the data operation request, a tolerance delay time of the program to respond to the data operation request; and sorts an expected response time of each data unit for the data operation to obtain a sort result; and determines the sorting The storage unit with the shortest expected response time for the data operation in the result is the target storage unit for responding to the data operation request, or the expected response time for the data operation in the sort result is less than any of the tolerance delay times. A storage unit is a target storage unit for responding to the data operation request.
步骤S404,将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回 操作处理结果。Step S404, sending the data operation request to the target storage unit for processing, and returning to the program Operation processing results.
具体地,电子设备将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果;Specifically, the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
这里,所述操作处理结果是指针对所述程序的数据操作请求正在处理;如,所述数据操作请求为写数据时,相应的所述操作处理结果为正在写数据;所述数据操作请求为读数据时,相应的所述操作处理结果为正在读数据。Here, the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
步骤S405,目标存储单元响应所述数据操作请求;Step S405, the target storage unit responds to the data operation request;
具体地,目标存储单元响应所述数据操作请求,对所述数据进行相应的操作,如读数据或写数据等。Specifically, the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
本公开实施例还提供了一种数据处理方法,图6为本公开实施例提供的另一种数据处理方法的处理流程示意图,如图6所示,包括以下步骤:The embodiment of the present disclosure further provides a data processing method. FIG. 6 is a schematic diagram of a processing flow of another data processing method according to an embodiment of the present disclosure. As shown in FIG. 6, the method includes the following steps:
步骤S501,电子设备定时检测自身各存储单元的状态,并存储所述各存储单元的状态;Step S501, the electronic device periodically detects the state of each storage unit and stores the state of each storage unit.
这里,检测各存储单元的状态的周期可根据需要灵活设定;存储所述各存储单元的状态的存储区域也可根据电子设备的属性灵活设定;如,为减小SSD读写资源的消耗,可将所述各存储单元的状态存储至SSD读写协议中某个预留字节;或将所述各存储单元的状态存储至预先设定的缓存区域等。Here, the period for detecting the state of each storage unit can be flexibly set according to requirements; the storage area storing the state of each storage unit can also be flexibly set according to the attributes of the electronic device; for example, to reduce the consumption of SSD read and write resources. And storing the state of each storage unit to a reserved byte in the SSD read/write protocol; or storing the state of each storage unit to a preset cache area or the like.
所述电子设备内部包括一个或多个存储单元,在电子设备内部包括多个存储单元时,获取每个存储单元的状态;所述存储单元为SSD、或其他类型的存储介质。The electronic device internally includes one or more storage units that acquire the state of each storage unit when the electronic device includes a plurality of storage units; the storage unit is an SSD, or other type of storage medium.
所述存储单元的状态包括:存储单元的负荷值、存储单元的剩余写入寿命值、存储单元对数据操作的预计响应时间。The state of the storage unit includes: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
在存储区域预先存储有存储单元的状态时,检测存储单元的状态后,更新所述存储区域内已经存储的该存储单元的状态;在所述存储区域内没有存储该存储单元的状态时,检测存储单元的状态后,在所述存储区域内增加该存储单元的状态。When the state of the storage unit is stored in advance in the storage area, after detecting the state of the storage unit, the state of the storage unit already stored in the storage area is updated; when the state of the storage unit is not stored in the storage area, detecting After the state of the storage unit, the state of the storage unit is increased within the storage area.
步骤S502,电子设备接收来自程序的数据操作请求;Step S502, the electronic device receives a data operation request from the program;
这里,所述程序为安装于所述电子设备上的程序;所述数据操作请求可以是通过用户点击触发所述程序对应的应用或功能而发送的请求。Here, the program is a program installed on the electronic device; the data operation request may be a request sent by a user clicking an application or function that triggers the program.
步骤S503,根据多个维度的筛选条件对各存储单元进行排序,得到排序结果;Step S503, sorting each storage unit according to the screening condition of multiple dimensions, and obtaining a sorting result;
在一具体实施方式中,每个维度的筛选条件对应一个加权值,电子设备根据筛选条件及各筛选条件对应的加权值计算用于表征各存储单元状态的评分;确定评分最高的存储单元为目标存储单元。In a specific implementation, the screening condition of each dimension corresponds to a weighting value, and the electronic device calculates a score for characterizing the state of each storage unit according to the screening condition and the weighting value corresponding to each screening condition; determining the storage unit with the highest score as the target Storage unit.
举例来说,筛选条件为存储单元的负荷值a,对应的加权值为A,筛选条件为存储单元 的剩余写入寿命值b,对应的加权值为B,筛选条件为存储单元对数据操作的预计响应时间c,对应的加权值为C;那么,表征存储单元状态的评分S=a*A+b*B+c*C;确定评分S最高的存储单元为用于响应所述数据操作请求的目标存储单元。For example, the filtering condition is the load value a of the storage unit, the corresponding weighting value is A, the filtering condition is the remaining writing lifetime value b of the storage unit, and the corresponding weighting value is B, and the filtering condition is that the storage unit operates on the data. Estimated response time c , the corresponding weighting value is C; then, the score S=a*A+b*B+c*C characterizing the state of the storage unit; the storage unit determining the highest score S is used to respond to the data operation request Target storage unit.
在另一具体实施方式中,可根据任意两个维度的筛选条件确定目标存储单元;具体地,在所述数据操作请求为读操作请求时,首先根据所述数据操作请求确定存储所述读操作对应的数据的存储单元,作为候选存储单元;再根据存储单元的负荷值、或剩余写入寿命值、或对所述数据操作的预计响应时间对所述候选存储单元进行排序,根据排序结果确定用于响应所述数据操作请求的目标存储单元。In another specific implementation, the target storage unit may be determined according to the screening condition of any two dimensions; specifically, when the data operation request is a read operation request, first determining to store the read operation according to the data operation request a storage unit of the corresponding data as a candidate storage unit; and sorting the candidate storage units according to a load value of the storage unit, or a remaining write lifetime value, or an expected response time of the data operation, and determining according to the sorting result A target storage unit for responding to the data operation request.
在另一具体实施方式中,在所述数据操作请求为写操作请求时,首先确定所述各存储单元的读写状态,选择处于非读写状态的存储单元为候选存储单元;再根据存储单元的负荷值、或剩余写入寿命值、或对所述数据操作的预计响应时间对所述候选存储单元进行排序,根据排序结果确定用于响应所述数据操作请求的目标存储单元。In another embodiment, when the data operation request is a write operation request, first determining a read/write state of each storage unit, selecting a storage unit in a non-read-write state as a candidate storage unit; The candidate storage unit is sorted by the load value, or the remaining write life value, or the expected response time for the data operation, and the target storage unit for responding to the data operation request is determined based on the sort result.
以上仅为根据两个维度的筛选条件确定目标存储单元的两个实施例,在具体实施方式中,可根据数据操作请求、结合任意两个或多个维度的筛选条件来确定用于响应所述数据操作请求的目标存储单元。The above is only two embodiments for determining the target storage unit according to the screening conditions of the two dimensions. In a specific embodiment, the response may be determined according to the data operation request and the screening condition of any two or more dimensions. The target storage unit for the data operation request.
步骤S504,将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果。Step S504, the data operation request is sent to the target storage unit for processing, and the operation processing result is returned to the program.
具体地,电子设备将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果;Specifically, the electronic device sends the data operation request to the target storage unit for processing, and returns an operation processing result to the program;
这里,所述操作处理结果是指针对所述程序的数据操作请求正在处理;如,所述数据操作请求为写数据时,相应的所述操作处理结果为正在写数据;所述数据操作请求为读数据时,相应的所述操作处理结果为正在读数据。Here, the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
步骤S505,目标存储单元响应所述数据操作请求;Step S505, the target storage unit responds to the data operation request;
具体地,目标存储单元响应所述数据操作请求,对所述数据进行相应的操作,如读数据或写数据等。Specifically, the target storage unit performs corresponding operations on the data, such as reading data or writing data, in response to the data operation request.
需要说明的是,本公开上述实施例示例性的列出了用于表征各存储单元的状态的多个维度的筛选条件;但是,在实际应中,并不限定于上述筛选条件,任何表征存储单元状态的参数或指标均适用于本公开实施例。It should be noted that the foregoing embodiments of the present disclosure exemplarily list the screening conditions for characterizing the multiple dimensions of the state of each storage unit; however, in actual application, it is not limited to the above filtering conditions, and any characterization storage The parameters or indicators of the unit state are applicable to the embodiments of the present disclosure.
为实现上述数据处理方法,本公开实施例还提供了一种电子设备,图7为本公开实施例提供的一种电子设备的组成结构示意图,如图7所示,包括处理器11、收发器12和存储单元13;其中, The embodiment of the present disclosure further provides an electronic device, and FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in FIG. 7, the processor 11 and the transceiver are included. 12 and a storage unit 13; wherein
所述处理器11,用于获取所述电子设备内各存储单元的状态,根据数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元。The processor 11 is configured to acquire a state of each storage unit in the electronic device, analyze a state of each acquired storage unit according to a data operation request, and determine a target storage unit for responding to the data operation request.
其中。所述存储单元的状态至少包括:存储单元的负荷值、存储单元的剩余写入寿命值、存储单元对数据操作的预计响应时间。among them. The state of the storage unit includes at least: a load value of the storage unit, a remaining write life value of the storage unit, and an expected response time of the storage unit to the data operation.
所述存储单元的负荷值进一步包括:存储单元的CPU使用率、存储单元的连续工作时间、存储单元的温度、存储单元的读写状态等。The load value of the storage unit further includes: a CPU usage rate of the storage unit, a continuous working time of the storage unit, a temperature of the storage unit, a read/write status of the storage unit, and the like.
所述收发器12,用于接收来自程序的数据操作请求,发送数据操作请求至所述目标存储单元进行处理,并向所述程序返回操作处理结果。The transceiver 12 is configured to receive a data operation request from a program, send a data operation request to the target storage unit for processing, and return an operation processing result to the program.
这里,所述操作处理结果是指针对所述程序的数据操作请求正在处理;如,所述数据操作请求为写数据时,相应的所述操作处理结果为正在写数据;所述数据操作请求为读数据时,相应的所述操作处理结果为正在读数据。Here, the operation processing result is that the data operation request of the program is being processed by the pointer; for example, when the data operation request is write data, the corresponding operation processing result is that the data is being written; the data operation request is When the data is read, the corresponding operation result is that the data is being read.
上述方案中,所述处理器11,具体用于定时检测各存储单元的状态;In the above solution, the processor 11 is specifically configured to periodically detect the status of each storage unit.
将所述各存储单元的状态存储至所述电子设备的存储区域;Storing the state of each storage unit to a storage area of the electronic device;
在所述存储区域查询所述各存储单元的状态。Querying the status of each storage unit in the storage area.
上述方案中,所述处理器11,具体用于确定表征所述各存储单元的状态的多个维度的筛选条件;In the above solution, the processor 11 is specifically configured to determine a screening condition of multiple dimensions that characterize states of the storage units;
根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果;Sorting each storage unit according to the screening condition of at least one dimension, and obtaining a sorting result;
根据所述排序结果确定用于响应所述数据操作请求的目标存储单元。A target storage unit for responding to the data operation request is determined based on the sort result.
上述方案中,所述处理器11,具体用于根据所获取到的各存储单元的负荷值、或各存储单元的剩余写入寿命值、或各存储单元对所述数据操作的预计响应时间,对所述各存储单元进行排序,得到排序结果。In the above solution, the processor 11 is specifically configured to: according to the acquired load value of each storage unit, or the remaining write life value of each storage unit, or the expected response time of each storage unit to the data operation, Sorting the storage units to obtain a sort result.
上述方案中,每个维度的筛选条件对应一个加权值,所述处理器11,具体用于根据筛选条件及各筛选条件对应的加权值计算用于表征各存储单元状态的评分;In the above solution, the filtering condition of each dimension corresponds to a weighting value, and the processor 11 is specifically configured to calculate a score for characterizing the state of each storage unit according to the screening condition and the weighting value corresponding to each screening condition;
确定评分最高的存储单元为目标存储单元。Determine the storage unit with the highest score as the target storage unit.
需要说明的是,本公开实施例中所述电子设备中的处理器11和收发器12执行的功能可由电子设备上的CPU、或微处理器(MPU)、或数字信号处理器(DSP)、或可编程门阵列(FPGA)实现。本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储单元中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储单元包括:SSD、移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。 It should be noted that the functions performed by the processor 11 and the transceiver 12 in the electronic device in the embodiment of the present disclosure may be implemented by a CPU, an microprocessor (MPU), or a digital signal processor (DSP) on the electronic device. Or a programmable gate array (FPGA) implementation. A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage unit, and the program is executed when executed. The foregoing storage unit includes: SSD, mobile storage device, read-only memory (ROM), random access memory (RAM), disk or optical disk, and the like. A variety of media that can store program code.
或者,本公开上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储单元中。基于这样的理解,本公开实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储单元中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本公开各个实施例所述方法的全部或部分。而前述的存储单元包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, the above-described integrated unit of the present disclosure may be stored in a computer readable storage unit if it is implemented in the form of a software function module and sold or used as a standalone product. Based on such understanding, the technical solution of the embodiments of the present disclosure may be embodied in the form of a software product in essence or in the form of a software product, which is stored in a storage unit and includes a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present disclosure. The foregoing storage unit includes: a removable storage device, a ROM, a RAM, a magnetic disk, or an optical disk, and the like, which can store program codes.
以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所述权利要求的保护范围为准。 The above is only the specific embodiment of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the disclosure. It should be covered within the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be determined by the scope of the claims.

Claims (10)

  1. 一种数据处理方法,,包括:A data processing method, comprising:
    获取电子设备内各存储单元的状态;Obtaining a status of each storage unit in the electronic device;
    接收来自程序的数据操作请求;Receiving a data operation request from a program;
    根据所述数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元;以及Determining, according to the data operation request, the acquired state of each storage unit, determining a target storage unit for responding to the data operation request;
    将所述数据操作请求发送至所述目标存储单元进行处理,并向所述程序返回操作处理结果。The data operation request is sent to the target storage unit for processing, and the operation processing result is returned to the program.
  2. 根据权利要求1所述的方法,其中,所述获取电子设备内各存储单元的状态包括:The method of claim 1, wherein the obtaining the status of each storage unit in the electronic device comprises:
    定时检测各存储单元的状态;Timingly detecting the status of each storage unit;
    将所述各存储单元的状态存储至所述电子设备的存储区域;以及Storing the state of each of the storage units to a storage area of the electronic device;
    在所述存储区域查询所述各存储单元的状态。Querying the status of each storage unit in the storage area.
  3. 根据权利要求1所述的方法,其中,所述根据所述数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元,包括:The method of claim 1, wherein the analyzing the status of each of the acquired storage units according to the data operation request, and determining a target storage unit for responding to the data operation request comprises:
    确定表征所述各存储单元的状态的多个维度的筛选条件;Determining screening conditions for a plurality of dimensions characterizing the states of the respective storage units;
    根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果;以及Sorting each storage unit according to a filter condition of at least one dimension to obtain a sort result;
    根据所述排序结果确定用于响应所述数据操作请求的目标存储单元。A target storage unit for responding to the data operation request is determined based on the sort result.
  4. 根据权利要求3所述的方法,其中,所述根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果,包括:The method according to claim 3, wherein the sorting each storage unit according to the screening condition of at least one dimension to obtain a sorting result comprises:
    根据所获取到的各存储单元的负荷值、或各存储单元的剩余写入寿命值、或各存储单元对所述数据操作的预计响应时间,对所述各存储单元进行排序,得到排序结果。The storage units are sorted according to the acquired load values of the storage units, or the remaining write life values of the storage units, or the expected response time of the data operations by the storage units, to obtain a sort result.
  5. 根据权利要求3所述的方法,其中:The method of claim 3 wherein:
    所述根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果,包括:每个维度的筛选条件对应一个加权值,根据筛选条件及各筛选条件对应的加权值计算用于表征各存储单元状态的评分;以及And sorting the storage units according to the screening condition of the at least one dimension, and obtaining the sorting result, including: the filtering condition of each dimension corresponds to a weighting value, and is used for characterizing each storage according to the screening condition and the weighting value corresponding to each screening condition. The score of the unit status;
    所述根据所述排序结果确定用于响应所述数据操作请求的目标存储单元,包括:确定评分最高的存储单元为目标存储单元。The determining, according to the sorting result, the target storage unit for responding to the data operation request comprises: determining that the storage unit with the highest score is the target storage unit.
  6. 一种电子设备,,包括:An electronic device comprising:
    处理器,用于获取所述电子设备内各存储单元的状态,根据数据操作请求分析所获取到的各存储单元的状态,确定用于响应所述数据操作请求的目标存储单元;以及 a processor, configured to acquire a state of each storage unit in the electronic device, analyze a state of each acquired storage unit according to a data operation request, and determine a target storage unit for responding to the data operation request;
    收发器,用于接收来自程序的所述数据操作请求,发送所述数据操作请求至所述目标存储单元进行处理,并向所述程序返回操作处理结果。And a transceiver, configured to receive the data operation request from the program, send the data operation request to the target storage unit for processing, and return an operation processing result to the program.
  7. 根据权利要求6所述的电子设备,其中,所述处理器,具体用于定时检测各存储单元的状态;The electronic device according to claim 6, wherein the processor is specifically configured to periodically detect a state of each storage unit;
    将所述各存储单元的状态存储至所述电子设备的存储区域;以及Storing the state of each of the storage units to a storage area of the electronic device;
    在所述存储区域查询所述各存储单元的状态。Querying the status of each storage unit in the storage area.
  8. 根据权利要求6所述的电子设备,其中,所述处理器,具体用于确定表征所述各存储单元的状态的多个维度的筛选条件;The electronic device according to claim 6, wherein the processor is specifically configured to determine a screening condition of a plurality of dimensions that characterize states of the storage units;
    根据至少一个维度的筛选条件对各存储单元进行排序,得到排序结果;以及Sorting each storage unit according to a filter condition of at least one dimension to obtain a sort result;
    根据所述排序结果确定用于响应所述数据操作请求的目标存储单元。A target storage unit for responding to the data operation request is determined based on the sort result.
  9. 根据权利要求8所述的电子设备,其中,所述处理器,具体用于根据所获取到的各存储单元的负荷值、或各存储单元的剩余写入寿命值、或各存储单元对所述数据操作的预计响应时间,对所述各存储单元进行排序,得到排序结果。The electronic device according to claim 8, wherein the processor is specifically configured to: according to the acquired load value of each storage unit, or a remaining write life value of each storage unit, or each storage unit pair The estimated response time of the data operation, sorting the storage units to obtain a sort result.
  10. 根据权利要求8所述的电子设备,其中,每个维度的筛选条件对应一个加权值,所述处理器,具体用于根据筛选条件及各筛选条件对应的加权值计算用于表征各存储单元状态的评分;以及The electronic device according to claim 8, wherein the filter condition of each dimension corresponds to a weighting value, and the processor is configured to calculate a state of each storage unit according to a filter condition and a weighting value corresponding to each filter condition. Rating; and
    确定评分最高的存储单元为目标存储单元。 Determine the storage unit with the highest score as the target storage unit.
PCT/CN2017/103709 2017-06-27 2017-09-27 Data processing method and electronic device WO2019000675A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710500191.1 2017-06-27
CN201710500191.1A CN107357523B (en) 2017-06-27 2017-06-27 Data processing method and electronic equipment

Publications (1)

Publication Number Publication Date
WO2019000675A1 true WO2019000675A1 (en) 2019-01-03

Family

ID=60273113

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/103709 WO2019000675A1 (en) 2017-06-27 2017-09-27 Data processing method and electronic device

Country Status (2)

Country Link
CN (1) CN107357523B (en)
WO (1) WO2019000675A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433674B (en) * 2020-11-16 2021-07-06 连邦网络科技服务南通有限公司 Data migration system and method for computer
CN117149099B (en) * 2023-10-31 2024-03-12 江苏华鲲振宇智能科技有限责任公司 Calculation and storage split server system and control method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140173188A1 (en) * 2012-12-17 2014-06-19 Nec Corporation Information processing device
CN105159602A (en) * 2015-08-03 2015-12-16 联想(北京)有限公司 Data processing method and storage device
CN105302479A (en) * 2015-09-29 2016-02-03 联想(北京)有限公司 Data management method and storage device
CN106802775A (en) * 2017-01-18 2017-06-06 郑州云海信息技术有限公司 A kind of date storage method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015042778A1 (en) * 2013-09-24 2015-04-02 华为技术有限公司 Data migration method, data migration apparatus and storage device
CN103927134A (en) * 2014-04-09 2014-07-16 汉柏科技有限公司 Harddisk load balancing method, operating system and storage control device
US9214045B1 (en) * 2014-08-29 2015-12-15 Freescale Semiconductor, Inc. Flash memory express erase and program
US20160306822A1 (en) * 2015-04-17 2016-10-20 Samsung Electronics Co., Ltd. Load balancing of queries in replication enabled ssd storage
CN105159620B (en) * 2015-09-29 2018-07-20 华为数字技术(成都)有限公司 Store the implementation method and device of QoS control strategies
CN106469198B (en) * 2016-08-31 2019-10-15 华为技术有限公司 Key assignments storage method, apparatus and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140173188A1 (en) * 2012-12-17 2014-06-19 Nec Corporation Information processing device
CN105159602A (en) * 2015-08-03 2015-12-16 联想(北京)有限公司 Data processing method and storage device
CN105302479A (en) * 2015-09-29 2016-02-03 联想(北京)有限公司 Data management method and storage device
CN106802775A (en) * 2017-01-18 2017-06-06 郑州云海信息技术有限公司 A kind of date storage method and device

Also Published As

Publication number Publication date
CN107357523B (en) 2021-06-15
CN107357523A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
TWI727226B (en) Multi-level storage method and device for blockchain data
US8739167B2 (en) Method and device for balancing load of multiprocessor system by sequencing migration priorities based on memory size and calculated execution time
US9665284B2 (en) Partition extension method and apparatus
JP5774742B2 (en) Data deduplication method and apparatus
US20170286484A1 (en) Graph Data Search Method and Apparatus
WO2017000822A1 (en) Transmission control method and device for direct memory access
US20150220370A1 (en) Job scheduling apparatus and method therefor
US9460032B2 (en) Apparatus and method for processing an interrupt
WO2017028696A1 (en) Method and device for monitoring load of distributed storage system
US9898329B1 (en) Flexible processor association for virtual machines
JP2012521042A (en) Web front end throttling
WO2018068714A1 (en) Deduplication processing method, and storage device
JP2017215966A (en) Technologies for limiting performance variation in storage device
WO2019000675A1 (en) Data processing method and electronic device
WO2020244243A1 (en) Method and device for dividing a plurality of storage devices into device groups
US9274827B2 (en) Data processing apparatus, transmitting apparatus, transmission control method, scheduling method, and computer product
US11144234B2 (en) Apparatus, method for storage access management, and non-transitory computer-readable storage medium for storing program
US8135924B2 (en) Data storage device driver
EP3488572A1 (en) Systems and methods for managing network congestion
US20160266808A1 (en) Information processing device, information processing method, and recording medium
KR102396309B1 (en) Device and method for controlling data request
US11243597B2 (en) Microprocessor power logging at a sub-process level
CN105183398B (en) A kind of storage device, electronic equipment and data processing method
US20160054929A1 (en) Data processing apparatus, data processing method, and computer program product
JP6906405B2 (en) Information processing equipment, information processing methods, information processing programs, and information processing systems

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 13/07/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 17915947

Country of ref document: EP

Kind code of ref document: A1