+

CN119311229A - Data writing control method, system, terminal and medium - Google Patents

Data writing control method, system, terminal and medium Download PDF

Info

Publication number
CN119311229A
CN119311229A CN202411866792.0A CN202411866792A CN119311229A CN 119311229 A CN119311229 A CN 119311229A CN 202411866792 A CN202411866792 A CN 202411866792A CN 119311229 A CN119311229 A CN 119311229A
Authority
CN
China
Prior art keywords
data
request
write
terminal
data writing
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202411866792.0A
Other languages
Chinese (zh)
Other versions
CN119311229B (en
Inventor
张勤
余玲
裴来广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baike Data Technology Shenzhen Co ltd
Original Assignee
Baike Data Technology Shenzhen Co ltd
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 Baike Data Technology Shenzhen Co ltd filed Critical Baike Data Technology Shenzhen Co ltd
Priority to CN202411866792.0A priority Critical patent/CN119311229B/en
Publication of CN119311229A publication Critical patent/CN119311229A/en
Application granted granted Critical
Publication of CN119311229B publication Critical patent/CN119311229B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种数据写入控制方法、系统、终端及介质,方法包括:接收数据写入请求,确定所述数据写入请求所对应的请求终端;基于所述请求终端,确定所述数据写入请求所对应的请求类型,所述请求类型包括回写请求或直写请求;获取所述数据写入请求所对应的写入数据,基于所述请求类型与所述写入数据进行数据更新。本发明可确定出数据写入请求的请求类型是回写请求还是直写请求,这样就可以基于请求类型来对数据进行更新,提高数据更新的效率。

The present invention discloses a data writing control method, system, terminal and medium, the method comprising: receiving a data writing request, determining a request terminal corresponding to the data writing request; based on the request terminal, determining a request type corresponding to the data writing request, the request type including a write-back request or a write-through request; obtaining the write data corresponding to the data writing request, and updating the data based on the request type and the write data. The present invention can determine whether the request type of the data writing request is a write-back request or a write-through request, so that the data can be updated based on the request type, thereby improving the efficiency of data updating.

Description

Data writing control method, system, terminal and medium
Technical Field
The present invention relates to the field of data writing technologies, and in particular, to a data writing control method, system, terminal, and medium.
Background
At present, when a request for writing data of a client is received, as the written data cannot be distinguished into the data of a direct writing request or the data of a write-back request, all data in a cache can be refreshed at one time when the data is written, so that the performance of data writing is reduced, and the efficiency of data writing is also reduced.
Accordingly, there is a need for improvement and advancement in the art.
Disclosure of Invention
The invention aims to solve the technical problems that the prior art has the defects, and provides a data writing control method, a system, a terminal and a medium, so that the problems that all data in a cache can be refreshed at one time in the prior art, the performance of data writing is reduced, the efficiency of data writing is also reduced and the like are solved.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
In a first aspect, the present invention provides a data writing control method, where the method includes:
receiving a data writing request, and determining a request terminal corresponding to the data writing request;
based on the request terminal, determining a request type corresponding to the data writing request, wherein the request type comprises a write-back request or a write-through request;
And acquiring the write-in data corresponding to the data write-in request, and updating the data based on the request type and the write-in data.
In one implementation, receiving a data writing request, determining a request terminal corresponding to the data writing request, and including:
receiving a data writing request, and analyzing the data writing request to obtain equipment information carried in the data writing request;
and determining the request terminal based on the equipment information.
In one implementation, before receiving a data writing request and determining a request terminal corresponding to the data writing request, the method includes:
acquiring equipment information of the request terminal in advance;
And generating the data writing request based on the equipment information and the writing data.
In one implementation, determining, based on the request terminal, a request type corresponding to the data writing request includes:
The marking information corresponding to the request terminal is obtained, wherein the marking information is used for marking the writing data of the data writing request;
determining a writing type of the writing data based on the mark information, wherein the writing type comprises write-through writing or write-back writing;
Based on the write type, the request type is determined.
In one implementation, obtaining the write data corresponding to the data write request, and updating the data based on the request type and the write data, includes:
acquiring write data in the data write request;
acquiring first cache data in a buffer memory and second cache data in a preset random access memory;
when the request type is a write-through request, updating the first cache data and the second cache data based on the write-in data;
When the request type is a write-back request, updating only the first cache data based on the write-in data.
In one implementation, obtaining the write data corresponding to the data write request, and updating the data based on the request type and the write data, further includes:
When the request type is a write-back request and the updating of the first cache data is finished, acquiring the running state of a data writing process;
and if the running state is idle, updating the second cache data in the random access memory based on the written data.
In one implementation, obtaining the write data corresponding to the data write request, and updating the data based on the request type and the write data, further includes:
if the running state is non-idle, determining the residual storage capacity of the random access memory;
If the residual storage capacity is larger than or equal to the data volume of the written data, determining to-be-outputted data in the second cache data based on a first-in first-out principle;
and replacing the data to be output in the second cache data with the write-in data.
In a second aspect, an embodiment of the present invention further provides a data writing control system, where the system is configured to implement the steps of the data writing control method described in the foregoing solution, and the system includes:
The request terminal determining module is used for receiving a data writing request and determining a request terminal corresponding to the data writing request;
The request type determining module is used for determining a request type corresponding to the data writing request based on the request terminal, wherein the request type comprises a write-back request or a write-through request;
And the data updating module is used for acquiring the write-in data corresponding to the data write-in request and updating the write-in data based on the request type.
In a third aspect, an embodiment of the present invention further provides a terminal, where the terminal includes a memory, a processor, and a data write control program stored in the memory and capable of running on the processor, and when the processor executes the data write control program, the processor implements the steps of the data write control method in any one of the above schemes.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where a data writing control program is stored on the computer readable storage medium, where the data writing control program, when executed by a processor, implements the steps of the data writing control method according to any one of the above schemes.
Compared with the prior art, the data writing control method has the advantages that the data writing control method is provided, firstly, the data writing request is received, and the request terminal corresponding to the data writing request is determined. Then, based on the request terminal, a request type corresponding to the data writing request is determined, wherein the request type comprises a write-back request or a write-through request. And finally, acquiring the write-in data corresponding to the data write-in request, and updating the data based on the request type and the write-in data. The invention can determine whether the request type of the data writing request is a write-back request or a write-through request, thus updating the data based on the request type and improving the data updating efficiency.
Drawings
FIG. 1 is a flowchart of a data write control method according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a data write control system according to an embodiment of the present invention.
Fig. 3 is a schematic block diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and more specific, the present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all the elements and operations or steps are included or performed in the order described. For example, some operations or steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", etc. are used to distinguish identical items or similar items having substantially the same function and effect. For example, the first control information and the second control information are merely for distinguishing different control information, and the order of the different control information is not limited.
It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
In order to solve the problems in the prior art, the present embodiment provides a data writing control method, which can identify a data writing request based on the method of the present embodiment, determine whether a request type is a write-back request or a write-through request, and further perform targeted refreshing for different request types when refreshing data, thereby improving the data refreshing efficiency. In a specific application, the embodiment may first receive a data writing request, and determine a request terminal corresponding to the data writing request. Then, based on the request terminal, a request type corresponding to the data writing request is determined, wherein the request type comprises a write-back request or a write-through request. And finally, acquiring the write-in data corresponding to the data write-in request, and updating the data based on the request type and the write-in data.
The data writing control method of the embodiment can be applied to a terminal, and the terminal can be an intelligent product terminal such as a mobile phone, a computer and an intelligent television. As shown in fig. 1, the data write control method includes the steps of:
Step S100, a data writing request is received, and a request terminal corresponding to the data writing request is determined.
When data writing or data refreshing is performed, the terminal receives a data writing request and requests to write the data into the terminal, and when the method is actually applied, the embodiment can analyze the data writing request and determine the request terminal corresponding to the data writing request, namely, determine which client the data writing request is sent.
In one implementation, when determining the request terminal, the embodiment includes the following steps:
step S101, a data writing request is received, and the data writing request is analyzed to obtain equipment information carried in the data writing request;
step S102, determining the request terminal based on the equipment information.
Specifically, the embodiment obtains, in advance, device information of the request terminal, where the device information may be a model number of the request terminal or a device name of the request terminal, and then generates the data write request based on the device information and write data, that is, data to be updated for the terminal. The data write request generated at this time carries the device information. After receiving the data writing request, the terminal can analyze the data writing request, and then obtain the content carried in the data writing request, and also obtain the equipment information, so that the request terminal can be determined based on the equipment information. The embodiment determines that the request terminal can conveniently determine the request type of the data writing request based on the request terminal in the subsequent step.
Step 200, determining a request type corresponding to the data writing request based on the request terminal, wherein the request type comprises a write-back request or a write-through request.
When the request terminal is determined, the embodiment can determine the request type of the issued data writing request based on the request terminal, wherein the request type comprises a write-back request or a write-through request, thereby realizing the identification of the request type and facilitating the realization of data refreshing based on the request type in the subsequent steps.
In one implementation, when determining a request type of a data write request, the present embodiment includes the following steps:
step S201, marking information corresponding to the request terminal is obtained, wherein the marking information is used for marking the writing data of the data writing request;
Step S202, determining the writing type of the writing data based on the mark information, wherein the writing type comprises direct writing or write-back writing;
step S203, determining the request type based on the write type.
Specifically, in this embodiment, the request terminals are divided in advance into a first terminal for sending a write-through request and a second terminal for sending a write-back request, and different marking information is used for the first terminal and the second terminal, for example, a first mark is used for the first terminal, and a second mark is used for the second terminal. Meanwhile, when the first terminal or the second terminal generates the data writing request, the writing data in the data writing request can be marked by adopting corresponding marking information. In this embodiment, after determining the request terminal, the tag information corresponding to the request terminal may be determined, for example, if the request terminal is a first terminal, the tag information is a first tag, and if the request terminal is a second terminal, the tag information is a second tag. Since the write data in the data write request has been marked using the corresponding mark information, it is determined whether the write data corresponds to the first mark or the second mark at this time, and based on this, it is determined whether the write type of the write data is write-through type write or write-back type write. Correspondingly, if the written data corresponds to the first mark, the writing type of the written data is direct writing, and if the written data corresponds to the second mark, the writing type of the written data is write-back writing. Thus, the request type is also determined based on the write type. The method and the device can determine the request type more conveniently by analyzing the marking information of the request terminal.
Step S300, obtaining the write-in data corresponding to the data write-in request, and updating the data based on the request type and the write-in data.
After determining the request type corresponding to the data writing request, the embodiment can acquire the corresponding writing data, and then update the data in the terminal based on the request type and the writing data. Since different request types are different for the data updating manner, the embodiment can update the data in a targeted manner based on the request types, thereby improving the data updating efficiency.
In one implementation, the method in this embodiment includes the following steps when performing data update:
step S301, obtaining write data in the data write request;
Step S302, obtaining first cache data in a cache memory and second cache data in a preset random access memory;
Step S303, when the request type is a direct write request, updating the first cache data and the second cache data based on the write data;
and step S304, when the request type is a write-back request, updating only the first cache data based on the write-in data.
In the embodiment, the direct writing request and the write-back request are different for all data cached on the terminal, and the write-back request is for part of data cached on the terminal, and the embodiment determines that the request type is to update the data to be updated in a targeted manner, for example, if the request type is the direct writing request, all the data cached in the terminal can be updated, and if the request type is the write-back request, part of the data cached in the terminal can be updated, but not all the data can be updated, so that the data updating efficiency can be improved.
In order to better realize updating of data, the embodiment can distinguish data cached in the terminal, specifically, the buffer memory of the terminal stores first cached data, the terminal is further provided with a random access memory, and the random access memory stores second cached data, wherein the first cached data and the second cached data form all data cached on the terminal. In practical application, when the request type is determined to be a direct write request, the embodiment may update the first cache data in the buffer memory and the second cache data in the random access memory based on the write data, that is, implement the overall update of the data. When the request type is determined to be a write-back request, the embodiment may update only the first cache data in the buffer memory based on the write-in data. Therefore, when the request type is a write-back request, all data does not need to be updated, so that the data updating efficiency is improved.
In one implementation, when the request type is a direct write request, since all data needs to be updated based on the write data, a certain time is required, and in order to increase the data update speed and shorten the data update time, the embodiment may be implemented in a manner of simultaneous storage when all data is updated. Specifically, in this embodiment, the write data may be compared with the first cache data of the buffer memory of the terminal and the second cache data of the random access memory of the terminal, to determine whether the write data is partially identical to the first cache data or the second cache data, and if the write data is partially identical to the first cache data or the second cache data, it is determined that the difference data is partially identical, and in this embodiment, the data update may be completed only by updating the difference data to the terminal. Meanwhile, in order to find out the difference data as soon as possible, the embodiment may set a data type tag for the write-in data, and the first cache data and the second cache data also set data type tags, when the write-in data is compared with the first cache data of the buffer memory of the terminal and the second cache data of the random access memory of the terminal respectively, it may be determined whether the data type tags are the same first, if the data type tags are different, it is indicated that the write-in data and the first cache data or the second cache data do not have the same data, and at this time, the write-in data needs to be updated to the terminal entirely, that is, the write-in data needs to be updated to the first cache data of the buffer memory and the second cache data of the random access memory entirely. If the data type labels are the same, further determining whether the data content is the same, finding out the part with the difference of the data content to obtain difference data, and updating the data of the terminal based on the difference data, namely updating the difference data into the first cache data of the buffer memory and the second cache data of the random access memory. Based on the update mode of the copy-save, the data update efficiency when the request type is the write-through request can be effectively improved.
Further, in this embodiment, only the first cache data in the buffer memory of the terminal is updated when the request type is a write-back request, so as to ensure the consistency of the data, in this embodiment, after the request type is the write-back request and the update of the first cache data is finished, the running state of the data writing process may be obtained, and then whether the update of the second cache data is required is determined based on the running state. Specifically, if the running state is idle, it indicates that a data update thread of the system is available at the moment, so that at the moment, the second cache data in the random access memory can be updated based on the written data, thereby implementing peak-shifting update of the first cache data and the second cache data and improving the efficiency of data update. And when the running state is not idle, determining the residual storage capacity of the random access memory. If the remaining storage capacity is greater than or equal to the data amount of the write data, it indicates that the capacity of the random access memory is sufficient at this time, and there may be enough space to accommodate the write data. However, since the running state of the data writing process at this time is not idle, which means that the data is being updated at this time, in order to reduce occupation of the data writing process, the embodiment may determine the to-be-output data in the second cache data based on the principle of first-in first-out, where the to-be-output data may be the data stored first in the second cache data, and these data may have been stored in the random access memory for a longer time, and the embodiment may use this portion of data as the to-be-output data, and then replace the to-be-output data in the second cache data with the written data. Because the data to be output is only a part of the second cache data, and the determined data quantity of the data to be output is the same as that of the written data, too many data updating threads are not occupied when the data is updated, and the implementation is convenient. In addition, the embodiment can shift the determined data to be output to other memories so as to facilitate the tracing when the data is needed later. In addition, when the second cache data is updated based on the write data, the embodiment can also be realized based on the mode of removing the coexistence difference in the scheme, so that the data updating efficiency is further improved.
In other implementations, when there are multiple clients sending data writing requests at the same time, the embodiment may analyze each data writing request and determine a request type corresponding to each data writing request, and when the request types are inconsistent, for example, there is a write-back request and a write-through request, the embodiment may change a data writing policy of the write-through request to ensure normal operation of a data writing process. Specifically, if the write-through request and the write-back request exist simultaneously, the data writing process is crowded, so that in order to reduce occupation of the data writing process, the embodiment can preferably select to update the first cache data of the buffer memory, so that when the write-through request is processed, the embodiment also ensures update of the first cache data of the buffer memory first, and updates the second cache data of the random memory first, the embodiment can adopt a mapping synchronization mode, specifically, the writing data can be mapped into the random memory from the buffer memory, thereby enabling the writing data to be updated into the random memory data. Similarly, the write-back request is also to update only the first cache data of the buffer memory until the data writing process is idle, and then determine a proper time to consider whether to update the second cache data of the random access memory. In practical application, when processing a write-back request, the embodiment only needs to ensure the update of the first cache data in the buffer memory, and whether the write-back request updates the second cache data of the random access memory or not can be selectively executed based on the importance degree of the write-back data. Therefore, in this embodiment, the importance level tag may be set in advance for the write data, and when it is determined that the importance level of the write data is high based on the importance level tag, the second cache data of the random access memory may be selectively updated, or otherwise, the second cache data of the random access memory may be selectively not updated.
In summary, the present embodiment first receives a data writing request, and determines a request terminal corresponding to the data writing request. Then, based on the request terminal, a request type corresponding to the data writing request is determined, wherein the request type comprises a write-back request or a write-through request. And finally, acquiring the write-in data corresponding to the data write-in request, and updating the data based on the request type and the write-in data. The embodiment can determine whether the request type of the data writing request is a write-back request or a write-through request, so that the data can be updated based on the request type, and the data updating efficiency is improved.
Based on the above embodiment, the present invention also provides a data writing control system, which can be used to implement the steps of the data writing control method in the above embodiment, as shown in fig. 2, and includes a request terminal determining module 10, a request type determining module 20, and a data updating module 30. Specifically, the request terminal determining module 10 is configured to receive a data writing request, and determine a request terminal corresponding to the data writing request. The request type determining module 20 is configured to determine, based on the request terminal, a request type corresponding to the data writing request, where the request type includes a write-back request or a write-through request. The data updating module 30 is configured to obtain write data corresponding to the data write request, and update the write data based on the request type.
In one implementation, the request terminal determining module 10 includes:
the information determining unit is used for receiving a data writing request, analyzing the data writing request and obtaining equipment information carried in the data writing request;
and the terminal determining unit is used for determining the request terminal based on the equipment information.
In one implementation, the request terminal determining module 10 further includes:
an equipment information setting unit, configured to obtain equipment information of the request terminal in advance;
And the write request generation unit is used for generating the data write request based on the equipment information and the write data.
In one implementation, the request type determination module 20 includes:
A tag information obtaining unit, configured to obtain tag information corresponding to the request terminal, where the tag information is used to tag write data of the data write request;
a writing type determining unit configured to determine a writing type of writing data based on the mark information, the writing type including write-through writing or write-back writing;
and the request type determining unit is used for determining the request type based on the writing type.
In one implementation, the data update module 30 includes:
a write data acquisition unit configured to acquire write data in the data write request;
the cache data acquisition unit is used for acquiring first cache data in the cache memory and second cache data in the preset random access memory;
The first data updating unit is used for updating the first cache data and the second cache data based on the writing data when the request type is a direct writing request;
And the second data updating unit is used for updating only the first cache data based on the write-in data when the request type is a write-back request.
In one implementation, the data update module 30 further includes:
the running state determining unit is used for obtaining the running state of the data writing process after the request type is a write-back request and the updating of the first cache data is finished;
And the third data updating unit is used for updating the second cache data in the random access memory based on the written data if the running state is idle.
In one implementation, the data update module 30 further includes:
A remaining capacity determining unit, configured to determine a remaining storage capacity of the random access memory if the running state is not idle;
the to-be-output data determining unit is used for determining to-be-output data in the second cache data based on a first-in first-out principle if the residual storage capacity is larger than or equal to the data quantity of the written data;
and the data replacement unit is used for replacing the data to be output in the second cache data with the write data.
The working principle of each module in the data writing control system of this embodiment is the same as that of each step in the above method embodiment, and will not be described here again.
The various modules in the data writing control system described above may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or independent of a processor in the terminal, or may be stored in software in a memory in the terminal, so that the processor may call and execute operations corresponding to the above modules.
Based on the above embodiment, the present invention also provides a terminal, and a schematic block diagram of the terminal may be shown in fig. 3. The terminal may include one or more processors 100 (only one shown in fig. 3), a memory 101, and a computer program 102 stored in the memory 101 and executable on the one or more processors 100, for example, a sleep analysis program based on multi-sensor data. The one or more processors 100, when executing the computer program 102, may implement the various steps in an embodiment of a sleep analysis method based on multi-sensor data. Or the one or more processors 100, when executing the computer program 102, may implement the functions of the various modules/units in the multi-sensor data based sleep analysis system embodiment, without limitation.
In one embodiment, the Processor 100 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), off-the-shelf Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In one embodiment, the memory 101 may be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory 101 may also be an external storage device of the electronic device, such as a plug-in hard disk provided on the electronic device, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like. Further, the memory 101 may also include both an internal storage unit and an external storage device of the electronic device. The memory 101 is used to store computer programs and other programs and data required by the terminal. The memory 101 may also be used to temporarily store data that has been output or is to be output.
It will be appreciated by those skilled in the art that the functional block diagram shown in fig. 3 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the terminal to which the present inventive arrangements may be applied, as a specific terminal may include more or less components than those shown, or may be combined with some components, or may have a different arrangement of components.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program, which may be stored on a non-transitory computer readable storage medium, that when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, operational database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual operation data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SYNCHLINK) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention, and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that the technical solution described in the above-mentioned embodiments may be modified or some technical features may be equivalently replaced, and these modifications or substitutions do not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solution of the embodiments of the present invention.

Claims (10)

1.一种数据写入控制方法,其特征在于,所述方法包括:1. A data writing control method, characterized in that the method comprises: 接收数据写入请求,确定所述数据写入请求所对应的请求终端;receiving a data writing request, and determining a request terminal corresponding to the data writing request; 基于所述请求终端,确定所述数据写入请求所对应的请求类型,所述请求类型包括回写请求或直写请求;Based on the request terminal, determining a request type corresponding to the data write request, the request type including a write-back request or a write-through request; 获取所述数据写入请求所对应的写入数据,基于所述请求类型与所述写入数据进行数据更新。The write data corresponding to the data write request is acquired, and data is updated based on the request type and the write data. 2.根据权利要求1所述的数据写入控制方法,其特征在于,接收数据写入请求,确定所述数据写入请求所对应的请求终端,包括:2. The data writing control method according to claim 1, wherein receiving a data writing request and determining a request terminal corresponding to the data writing request comprises: 接收数据写入请求,对所述数据写入请求进行解析,得到所述数据写入请求中携带的设备信息;Receiving a data writing request, parsing the data writing request, and obtaining device information carried in the data writing request; 基于所述设备信息,确定所述请求终端。Based on the device information, the requesting terminal is determined. 3.根据权利要求2所述的数据写入控制方法,其特征在于,接收数据写入请求,确定所述数据写入请求所对应的请求终端之前,包括:3. The data writing control method according to claim 2, characterized in that before receiving a data writing request and determining a request terminal corresponding to the data writing request, the method comprises: 预先获取所述请求终端的设备信息;Pre-acquire device information of the requesting terminal; 基于所述设备信息与写入数据,生成所述数据写入请求。The data write request is generated based on the device information and the write data. 4.根据权利要求3所述的数据写入控制方法,其特征在于,基于所述请求终端,确定所述数据写入请求所对应的请求类型,包括:4. The data writing control method according to claim 3, characterized in that determining the request type corresponding to the data writing request based on the request terminal comprises: 获取所述请求终端所对应的标记信息,其中,所述标记信息用于对所述数据写入请求的写入数据进行标记;Acquire tag information corresponding to the requesting terminal, wherein the tag information is used to mark the write data of the data write request; 基于所述标记信息,确定写入数据的写入类型,所述写入类型包括直写式写入或者回写式写入;Determine a write type of the write data based on the tag information, the write type including write-through write or write-back write; 基于所述写入类型,确定所述请求类型。Based on the write type, the request type is determined. 5.根据权利要求4所述的数据写入控制方法,其特征在于,获取所述数据写入请求所对应的写入数据,基于所述请求类型与所述写入数据进行数据更新,包括:5. The data writing control method according to claim 4, characterized in that obtaining the write data corresponding to the data writing request and updating the data based on the request type and the write data comprises: 获取所述数据写入请求中的写入数据;Obtaining write data in the data write request; 获取缓冲内存中的第一缓存数据以及预设的随机存储器中的第二缓存数据;Acquire first cache data in the buffer memory and second cache data in the preset random access memory; 当所述请求类型为直写请求时,则基于所述写入数据对所述第一缓存数据与第二缓存数据进行更新;When the request type is a write-through request, the first cache data and the second cache data are updated based on the write data; 当所述请求类型为回写请求时,则基于所述写入数据仅对所述第一缓存数据进行更新。When the request type is a write-back request, only the first cache data is updated based on the write data. 6.根据权利要求5所述的数据写入控制方法,其特征在于,获取所述数据写入请求所对应的写入数据,基于所述请求类型与所述写入数据进行数据更新,还包括:6. The data writing control method according to claim 5, characterized in that the step of obtaining the write data corresponding to the data writing request and updating the data based on the request type and the write data further comprises: 当所述请求类型为回写请求,且对所述第一缓存数据更新结束后, 获取数据写入进程的运行状态;When the request type is a write-back request and the updating of the first cache data is completed, obtaining the running status of the data writing process; 若所述运行状态为空闲,则基于所述写入数据,对所述随机存储器中的第二缓存数据进行更新。If the running state is idle, the second cache data in the random access memory is updated based on the write data. 7.根据权利要求6所述的数据写入控制方法,其特征在于,获取所述数据写入请求所对应的写入数据,基于所述请求类型与所述写入数据进行数据更新,还包括:7. The data writing control method according to claim 6, characterized in that the step of obtaining the write data corresponding to the data writing request and updating the data based on the request type and the write data further comprises: 若所述运行状态为非空闲,则确定所述随机存储器的剩余存储容量;If the operating state is non-idle, determining the remaining storage capacity of the random access memory; 若所述剩余存储容量大于或者等于所述写入数据的数据量,则基于先入先出的原则,确定所述第二缓存数据中的待出数据;If the remaining storage capacity is greater than or equal to the amount of the written data, determining the data to be output in the second cache data based on the first-in-first-out principle; 将所述写入数据替换所述第二缓存数据中的待出数据。The written data replaces the to-be-out data in the second cache data. 8.一种数据写入控制系统,其特征在于,所述系统用于实现权利要求1-7任一项所述的数据写入控制方法的步骤,所述系统包括:8. A data writing control system, characterized in that the system is used to implement the steps of the data writing control method according to any one of claims 1 to 7, and the system comprises: 请求终端确定模块,用于接收数据写入请求,确定所述数据写入请求所对应的请求终端;A request terminal determination module, used for receiving a data writing request and determining a request terminal corresponding to the data writing request; 请求类型确定模块,用于基于所述请求终端,确定所述数据写入请求所对应的请求类型,所述请求类型包括回写请求或直写请求;A request type determination module, used to determine the request type corresponding to the data write request based on the request terminal, the request type including a write-back request or a write-through request; 数据更新模块,用于获取所述数据写入请求所对应的写入数据,基于所述请求类型与所述写入数据进行更新。The data update module is used to obtain the write data corresponding to the data write request, and update based on the request type and the write data. 9.一种终端,其特征在于,所述终端包括存储器、处理器及存储在所述存储器中并可在所述处理器上运行的数据写入控制程序,所述处理器执行数据写入控制程序时,实现如权利要求1-7任一项所述的数据写入控制方法的步骤。9. A terminal, characterized in that the terminal includes a memory, a processor, and a data write control program stored in the memory and executable on the processor, and when the processor executes the data write control program, the steps of the data write control method according to any one of claims 1 to 7 are implemented. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有数据写入控制程序,所述数据写入控制程序被处理器执行时,实现如权利要求1-7任一项所述的数据写入控制方法的步骤。10. A computer-readable storage medium, characterized in that a data writing control program is stored on the computer-readable storage medium, and when the data writing control program is executed by a processor, the steps of the data writing control method according to any one of claims 1 to 7 are implemented.
CN202411866792.0A 2024-12-18 2024-12-18 Data writing control method, system, terminal and medium Active CN119311229B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411866792.0A CN119311229B (en) 2024-12-18 2024-12-18 Data writing control method, system, terminal and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411866792.0A CN119311229B (en) 2024-12-18 2024-12-18 Data writing control method, system, terminal and medium

Publications (2)

Publication Number Publication Date
CN119311229A true CN119311229A (en) 2025-01-14
CN119311229B CN119311229B (en) 2025-03-25

Family

ID=94179329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411866792.0A Active CN119311229B (en) 2024-12-18 2024-12-18 Data writing control method, system, terminal and medium

Country Status (1)

Country Link
CN (1) CN119311229B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120162286A (en) * 2025-05-16 2025-06-17 摩尔线程智能科技(北京)股份有限公司 Data transmission method, device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5895485A (en) * 1997-02-24 1999-04-20 Eccs, Inc. Method and device using a redundant cache for preventing the loss of dirty data
US20120198164A1 (en) * 2010-09-28 2012-08-02 Texas Instruments Incorporated Programmable Address-Based Write-Through Cache Control
CN106775502A (en) * 2017-02-16 2017-05-31 上海新储集成电路有限公司 A kind of wiring method based on data renewal frequency
CN115510161A (en) * 2022-09-28 2022-12-23 北京二六三企业通信有限公司 Data synchronization method, device, equipment and storage medium
CN117931467A (en) * 2023-12-27 2024-04-26 深圳市优必选科技股份有限公司 Multi-terminal request processing method, device, server and readable storage medium
CN119002798A (en) * 2023-05-19 2024-11-22 三星电子株式会社 System, method and apparatus for using commit queues for write buffer utilization

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5895485A (en) * 1997-02-24 1999-04-20 Eccs, Inc. Method and device using a redundant cache for preventing the loss of dirty data
US20120198164A1 (en) * 2010-09-28 2012-08-02 Texas Instruments Incorporated Programmable Address-Based Write-Through Cache Control
CN106775502A (en) * 2017-02-16 2017-05-31 上海新储集成电路有限公司 A kind of wiring method based on data renewal frequency
CN115510161A (en) * 2022-09-28 2022-12-23 北京二六三企业通信有限公司 Data synchronization method, device, equipment and storage medium
CN119002798A (en) * 2023-05-19 2024-11-22 三星电子株式会社 System, method and apparatus for using commit queues for write buffer utilization
CN117931467A (en) * 2023-12-27 2024-04-26 深圳市优必选科技股份有限公司 Multi-terminal request processing method, device, server and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120162286A (en) * 2025-05-16 2025-06-17 摩尔线程智能科技(北京)股份有限公司 Data transmission method, device and storage medium

Also Published As

Publication number Publication date
CN119311229B (en) 2025-03-25

Similar Documents

Publication Publication Date Title
CN119311229B (en) Data writing control method, system, terminal and medium
CN107408079B (en) Memory controller with coherent unit for multi-level system memory
CN113468105B (en) Data structure of data snapshot, related data processing method, device and system
CN105224255A (en) A kind of storage file management method and device
CN112306993A (en) Data reading method, device and equipment based on Redis and readable storage medium
WO2015196378A1 (en) Method, device and user equipment for reading/writing data in nand flash
US20240086113A1 (en) Synchronous write method and device, storage system and electronic device
CN111124314A (en) SSD performance improvement method, device, computer equipment and storage medium with dynamic loading of mapping table
CN115858417B (en) Cache data processing method, device, equipment and storage medium
CN116400852A (en) Method and device for optimizing writing performance of solid state disk, computer equipment and storage medium
CN108287793B (en) Response message buffering method and server
CN117453643B (en) File caching method, device, terminal and medium based on distributed file system
CN116150041A (en) Space allocation method, apparatus, electronic device, and computer-readable storage medium
US8803900B2 (en) Synchronization with semaphores in a multi-engine GPU
CN110928890B (en) Data storage method and device, electronic equipment and computer readable storage medium
CN115840654B (en) Message processing method, system, computing device and readable storage medium
CN116225314B (en) Data writing method, device, computer equipment and storage medium
CN116627331B (en) Cache verification device, method and system
CN110716923A (en) Data processing method, data processing device, node equipment and storage medium
CN110727405A (en) Data processing method and device, electronic equipment and computer readable medium
CN112882831A (en) Data processing method and device
US20150089264A1 (en) Processing apparatus and processing method
CN114242147B (en) Method, device, computer equipment and storage medium for improving SSD write performance
CN110795045A (en) Data migration method and system of hybrid memory and electronic equipment
CN117609367A (en) Data synchronization method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载