CN116610748A - Data writing method, terminal equipment and computer readable storage medium - Google Patents
Data writing method, terminal equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN116610748A CN116610748A CN202310434027.0A CN202310434027A CN116610748A CN 116610748 A CN116610748 A CN 116610748A CN 202310434027 A CN202310434027 A CN 202310434027A CN 116610748 A CN116610748 A CN 116610748A
- Authority
- CN
- China
- Prior art keywords
- data
- written
- node
- writing method
- concurrent
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5066—Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5011—Pool
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本申请涉及数据处理技术领域,特别是涉及一种数据写入方法、终端设备以及计算机可读存储介质。The present application relates to the technical field of data processing, and in particular to a data writing method, a terminal device, and a computer-readable storage medium.
背景技术Background technique
随着大数据时代的到来,业务数据量越来越大,数据库之间导入或导出的数据量也越来越大,在海量数据高并发的背景下,如何实现高速安全的数据交互成为当务之急。With the advent of the big data era, the amount of business data is increasing, and the amount of data imported or exported between databases is also increasing. In the context of massive data and high concurrency, how to achieve high-speed and secure data interaction has become a top priority.
现有的数据写入方法在面对集群的分布式节点写入时,由于无法感知集群的索引状态,存在分布式长尾效应,在处理批量的写入请求时,写入性能受限于负载最高的节点,不利于集群写入性能的提高,使得集群资源不能得到充分的利用。When the existing data writing methods are written to the distributed nodes of the cluster, because they cannot perceive the index status of the cluster, there is a distributed long-tail effect. When processing batch write requests, the write performance is limited by the load The highest node is not conducive to the improvement of cluster write performance, so that cluster resources cannot be fully utilized.
发明内容Contents of the invention
为解决上述技术问题,本申请提供了一种数据写入方法、终端设备以及计算机可读存储介质。In order to solve the above technical problems, the present application provides a data writing method, a terminal device, and a computer-readable storage medium.
为解决上述问题,本申请提供第一种技术方案:提供一种数据写入方法,包括:从数据源获取若干待写入数据,所述待写入数据包括具有唯一标识的属性信息;根据所述属性信息将若干所述待写入数据分配至对应的数据缓冲队列;响应于写入请求,将所述数据缓冲队列的待写入数据发送至对应的数据节点。In order to solve the above problems, the present application provides a first technical solution: providing a data writing method, including: obtaining a number of data to be written from a data source, the data to be written includes attribute information with a unique identifier; according to the Allocate the data to be written to the corresponding data buffer queue according to the attribute information; and send the data to be written in the data buffer queue to the corresponding data node in response to the write request.
其中,所述从数据源获取若干待写入数据,所述待写入数据包括具有唯一标识的属性信息的步骤之后,所述数据写入方法还包括:将若干所述待写入数据传输至线程池;获取若干所述数据节点的负载状态;根据所述负载状态调整所述线程池的并发线程的数量,所述并发线程用于基于所述待写入数据向所述数据节点发起写入请求。Wherein, after the step of obtaining a plurality of data to be written from the data source, and the data to be written includes attribute information with a unique identifier, the data writing method further includes: transmitting the plurality of data to be written to thread pool; obtaining the load status of several data nodes; adjusting the number of concurrent threads of the thread pool according to the load status, and the concurrent threads are used to initiate writing to the data node based on the data to be written ask.
其中,所述根据所述负载状态调整所述线程池的并发线程的数量,所述并发线程用于基于所述待写入数据向所述数据节点发起写入请求,包括:根据所述数据节点的负载状态,控制所述并发线程向所述数据节点发起写入请求,或者,控制所述并发线程暂停发起写入请求。Wherein, the adjusting the number of concurrent threads in the thread pool according to the load state, the concurrent threads being used to initiate a write request to the data node based on the data to be written, includes: according to the data node control the concurrent thread to initiate a write request to the data node, or control the concurrent thread to suspend the initiation of the write request.
其中,所述根据所述数据节点的负载状态,控制所述并发线程向所述数据节点发起写入请求,或者,控制所述并发线程暂停发起写入请求,包括:响应于所述数据节点为低负载状态,将所述待写入数据分配至所述并发线程,以使所述并发线程基于所述待写入数据向所述数据节点发起写入请求;响应于所述数据节点为高负载状态,控制所述并发线程暂停发起写入请求,并在预设时间后继续获取所述数据节点的负载状态。Wherein, the controlling the concurrent thread to initiate a write request to the data node according to the load state of the data node, or controlling the concurrent thread to suspend the initiation of the write request includes: responding to the data node being In a low load state, assign the data to be written to the concurrent thread, so that the concurrent thread initiates a write request to the data node based on the data to be written; in response to the high load of the data node state, controlling the concurrent thread to suspend initiating write requests, and continue to obtain the load state of the data node after a preset time.
其中,所述响应于所述数据节点为低负载状态,将所述待写入数据分配至所述并发线程,以使所述并发线程基于所述待写入数据向所述数据节点发起写入请求的步骤之后,所述数据写入方法还包括:响应于所述数据节点为超低负载状态,增加所述并发线程的数量。Wherein, in response to the data node being in a low load state, allocating the data to be written to the concurrent thread, so that the concurrent thread initiates writing to the data node based on the data to be written After the step of requesting, the data writing method further includes: increasing the number of concurrent threads in response to the data node being in an ultra-low load state.
其中,所述响应于所述数据节点为高负载状态,控制所述并发线程暂停发起写入请求,并在预设时间后继续获取所述数据节点的负载状态的步骤之后,所述数据写入方法还包括:响应于所述数据节点为超高负载状态,减少所述并发线程的数量。Wherein, after the step of controlling the concurrent threads to suspend and initiate write requests in response to the data node being in a high load state, and continuing to obtain the load state of the data node after a preset time, the data write The method further includes: reducing the number of concurrent threads in response to the data node being in an extremely high load state.
其中,所述获取若干所述数据节点的负载状态,包括:通过所述线程池获取若干所述数据节点的负载状态,并将所述负载状态存储于所述线程池的缓存,以使所述并发线程从所述缓存获取与所述待写入数据对应的负载状态。Wherein, said obtaining the load states of several said data nodes includes: obtaining the load states of several said data nodes through said thread pool, and storing said load states in the cache of said thread pool, so that said The concurrent thread acquires the load status corresponding to the data to be written from the cache.
其中,所述根据所述属性信息将若干所述待写入数据分配至对应的数据缓冲队列,包括:根据所述属性信息计算与所述待写入数据对应的数据节点;根据预设的所述数据节点与所述数据缓冲队列的对应关系,将所述待写入数据分配至对应的所述数据缓冲队列。Wherein, the allocating the data to be written to the corresponding data buffer queue according to the attribute information includes: calculating the data node corresponding to the data to be written according to the attribute information; The corresponding relationship between the data nodes and the data buffer queues is determined, and the data to be written is allocated to the corresponding data buffer queues.
为解决上述问题,本申请提供第二种技术方案:提供一种终端设备,包括处理器以及与所述处理器连接的存储器,其中,所述存储器中存储有程序数据,所述处理器调取所述存储器存储的所述程序数据,以执行如上所述的数据写入方法。In order to solve the above problems, this application provides a second technical solution: provide a terminal device, including a processor and a memory connected to the processor, wherein program data is stored in the memory, and the processor calls The program data stored in the memory is used to execute the above-mentioned data writing method.
为解决上述问题,本申请提供第三种技术方案:提供一种计算机可读存储介质,存储有程序指令,所述程序指令被执行以实现如上所述的数据写入方法。In order to solve the above problems, the present application provides a third technical solution: provide a computer-readable storage medium storing program instructions, the program instructions are executed to implement the above-mentioned data writing method.
本申请提供了一种数据写入方法、终端设备以及计算机可读存储介质,该数据写入方法包括:从数据源获取若干待写入数据,待写入数据包括具有唯一标识的属性信息;根据属性信息将若干待写入数据分配至对应的数据缓冲队列;响应于写入请求,将数据缓冲队列的待写入数据发送至对应的数据节点。本申请的数据写入方法通过根据属性信息将若干待写入数据分配至对应的数据缓冲队列,使得数据缓冲队列的待写入数据能够发送到对应的数据节点,待写入数据的写入只与对应的数据节点有关,避免了分布式长尾效应,使得集群资源得到充分利用,提高了数据写入效率。The present application provides a data writing method, a terminal device, and a computer-readable storage medium. The data writing method includes: obtaining a number of data to be written from a data source, and the data to be written includes attribute information with a unique identifier; according to The attribute information assigns several data to be written to the corresponding data buffer queue; in response to the write request, the data to be written in the data buffer queue is sent to the corresponding data node. The data writing method of the present application allocates a number of data to be written to the corresponding data buffer queue according to the attribute information, so that the data to be written in the data buffer queue can be sent to the corresponding data node, and the writing of the data to be written only It is related to the corresponding data nodes, avoiding the distributed long tail effect, making full use of cluster resources and improving the efficiency of data writing.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。其中:In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort. in:
图1是本申请提供的数据写入方法的第一实施例的流程示意图;Fig. 1 is a schematic flow chart of the first embodiment of the data writing method provided by the present application;
图2是本申请提供的数据写入方法的第二实施例的流程示意图;FIG. 2 is a schematic flow diagram of a second embodiment of the data writing method provided by the present application;
图3是本申请提供的数据写入方法的第三实施例的流程示意图;FIG. 3 is a schematic flowchart of a third embodiment of the data writing method provided by the present application;
图4是本申请提供的数据写入方法的第四实施例的流程示意图;FIG. 4 is a schematic flowchart of a fourth embodiment of the data writing method provided by the present application;
图5是本申请提供的终端设备的一实施例的结构示意图;FIG. 5 is a schematic structural diagram of an embodiment of a terminal device provided by the present application;
图6是本申请提供的计算机可读存储介质的一实施例的结构示意图。Fig. 6 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided by the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动情况下所获得的所有其他实施例,均属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
需要说明,若本申请实施例中有涉及方向性指示(诸如上、下、左、右、前、后……),则该方向性指示仅用于解释在某一特定姿态(如附图所示)下各部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。It should be noted that if there are directional indications (such as up, down, left, right, front, back...) in the embodiment of the present application, the directional indications are only used to explain the position in a certain posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
另外,若本申请实施例中有涉及“第一”、“第二”等的描述,则该“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only for descriptive purposes, and cannot be interpreted as indications or hints Its relative importance or implicitly indicates the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In addition, the technical solutions of the various embodiments can be combined with each other, but it must be based on the realization of those skilled in the art. When the combination of technical solutions is contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist , nor within the scope of protection required by the present application.
现有的数据写入方法在进行海量数据的高并发入库时,例如,将数据写入Elasticsearch集群时,可以通过开源工具elasticsearch-hadoop将生态数据写入到集群中。Existing data writing methods can use the open source tool elasticsearch-hadoop to write ecological data into the cluster when massive data is loaded into the database with high concurrency, for example, when data is written into the Elasticsearch cluster.
然而该数据写入方法在将数据写入到集群的数据节点时,由于无法感知集群索引状态,比如集群负载过高或者索引状态不佳,仍会持续向集群发起写入请求,造成数据节点崩溃,引起集群雪崩;并且,写入请求分配至多个数据节点,每个数据节点之间的负载不均衡,使得将数据写入数据节点时需要考虑整个集群的负载状态,存在分布式长尾效应,在批量发起写入请求时,写入性能受限于负载最高的数据节点。However, when this data writing method writes data to the data nodes of the cluster, because it cannot perceive the status of the cluster index, such as the cluster load is too high or the index status is not good, it will continue to send write requests to the cluster, causing the data node to crash , causing cluster avalanche; and, write requests are distributed to multiple data nodes, and the load between each data node is unbalanced, so that the load status of the entire cluster needs to be considered when writing data to data nodes, and there is a distributed long tail effect. When batching write requests, the write performance is limited by the data node with the highest load.
该数据写入方法在通过其他开发工具进行并发控制时,比如使用Spark/MapReduce集成时,只能够预先申请再确定计算资源,用户往往只能够根据数据源的大小,确定申请的计算资源大小。在申请资源过多时,容易造成集群压力过大,集群负载过高;在申请资源过小时,集群的资源空闲,集群负载过低,现有的数据写入方法无法对集群和数据节点的负载状态进行弹性调节,使得集群资源不能得到充分的利用。When this data writing method is used for concurrency control by other development tools, such as when using Spark/MapReduce integration, it can only pre-apply for and then determine computing resources. Users often can only determine the size of computing resources to apply for based on the size of the data source. When too many resources are applied for, it is easy to cause too much pressure on the cluster and the cluster load is too high; when the application resources are too small, the resources of the cluster are idle and the load of the cluster is too low, and the existing data writing method cannot control the load status of the cluster and data nodes. Perform elastic adjustment so that cluster resources cannot be fully utilized.
现有的数据写入方法还可以通过应用网关对批量的写入请求进行处理,具体地,该数据写入方法通过使用网关接收批量的写入请求,再由网关将写入请求转发至对应的后端的数据节点进行处理,然而该方法需要独立部署应用网关,数据写入的成本高。The existing data writing method can also process batch write requests through the application gateway. Specifically, the data writing method uses the gateway to receive batch write requests, and then the gateway forwards the write requests to the corresponding However, this method needs to deploy the application gateway independently, and the cost of data writing is high.
有鉴于此,本申请提出了一种数据写入方法,该数据写入方法应用于终端设备,该终端设备用于将批量的待写入数据写入至集群的数据节点中,以使数据节点对待写入数据进行处理。可以理解地,集群包括若干分布式设置的数据节点,每个数据节点可以为对应不同处理功能的服务实例。终端设备用于根据待写入数据的属性信息将待写入数据分配至对应的数据缓冲队列,以在数据节点的负载状态较低时将数据缓冲队列的待写入数据发送至对应的数据节点。该终端设备可以应用于数据处理技术领域。其中,该数据写入方法应用的集群可以用于金融科技,例如,可以用于在电子商务、电子支付、证券、电子银行、税务交易、信用卡、网络购物、保险等业务场景下的高速检索,在此不做具体限定。In view of this, this application proposes a data writing method, the data writing method is applied to a terminal device, and the terminal device is used to write batches of data to be written into the data nodes of the cluster, so that the data nodes Process the data to be written. Understandably, the cluster includes several distributed data nodes, and each data node may be a service instance corresponding to a different processing function. The terminal device is used to allocate the data to be written to the corresponding data buffer queue according to the attribute information of the data to be written, so as to send the data to be written in the data buffer queue to the corresponding data node when the load status of the data node is low . The terminal device can be applied in the technical field of data processing. Among them, the cluster applied by the data writing method can be used for financial technology, for example, it can be used for high-speed retrieval in business scenarios such as e-commerce, electronic payment, securities, electronic banking, tax transactions, credit cards, online shopping, insurance, etc. No specific limitation is made here.
其中,本申请的终端设备可以为服务器,也可以为由服务器和本地终端相互配合的系统。相应地,终端设备包括的各个部分,例如各个单元、子单元、模块、子模块可以全部设置于服务器中,也可以分别设置于服务器和本地终端中。Wherein, the terminal device in the present application may be a server, or may be a system in which the server and the local terminal cooperate with each other. Correspondingly, various parts included in the terminal device, such as various units, subunits, modules, and submodules, may all be set in the server, or may be set in the server and the local terminal respectively.
进一步地,上述服务器可以是硬件,也可以是软件。当服务器为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务器为软件时,可以实现成多个软件或软件模块,例如用来提供分布式服务器的软件或软件模块,也可以实现成单个软件或软件模块,在此不做具体限定。在一些可能的实现方式中,本申请实施例的数据写入方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。Further, the above server may be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide a distributed server, or as a single software or software module, which is not specifically limited here. In some possible implementation manners, the data writing method in the embodiment of the present application may be implemented in a manner in which a processor invokes a computer-readable instruction stored in a memory.
请参见图1,图1是本申请提供的数据写入方法的第一实施例的流程示意图。如图1所示,在本实施例中,该数据写入方法包括以下步骤:Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of a first embodiment of a data writing method provided by the present application. As shown in Figure 1, in this embodiment, the data writing method includes the following steps:
步骤S11:从数据源获取若干待写入数据,待写入数据包括具有唯一标识的属性信息。Step S11: Obtain a number of data to be written from the data source, the data to be written includes attribute information with a unique identifier.
具体地,数据源可以是数据获取系统、业务系统、数据处理系统等,数据源用于实时地获取海量数据,以使终端设备从数据源中获取若干待写入数据,每个待写入数据包括与之唯一对应的属性信息,该属性信息用于标识待写入数据。示例性地,在待写入数据为数据文档时,属性信息用于索引待写入数据,使得待写入数据可以被存储和搜索。例如,在该数据处理方法用于将数据写入Elasticsearch集群时,属性信息可以通过Elasticsearch文档的版本号、文档的user_account字段等生成,在其他的应用场景中,还可以通过使用插件等工具自动生成用于标识待写入数据的属性信息,在此对属性信息不做具体限定。Specifically, the data source can be a data acquisition system, a business system, a data processing system, etc. The data source is used to acquire massive data in real time, so that the terminal device obtains several data to be written from the data source, and each data to be written It includes uniquely corresponding attribute information, and the attribute information is used to identify the data to be written. Exemplarily, when the data to be written is a data file, the attribute information is used to index the data to be written, so that the data to be written can be stored and searched. For example, when the data processing method is used to write data into the Elasticsearch cluster, the attribute information can be generated through the version number of the Elasticsearch document, the user_account field of the document, etc. In other application scenarios, it can also be automatically generated by using tools such as plug-ins It is used to identify the attribute information of the data to be written, and the attribute information is not specifically limited here.
步骤S12:根据属性信息将若干待写入数据分配至对应的数据缓冲队列。Step S12: Allocate a number of data to be written into corresponding data buffer queues according to the attribute information.
获取待写入数据后,根据每一待写入数据的属性信息,将待写入数据分配至对应的数据缓冲队列中。可以理解地,终端设备用于将待写入数据写入集群的若干数据节点中,终端设备中存储有数据缓冲队列与数据节点的对应关系,每一数据节点都具有与之唯一对应的数据缓冲队列,使得在同一个数据缓冲队列的待写入数据由对应的数据节点进行数据写入。After the data to be written is acquired, the data to be written is allocated to the corresponding data buffer queue according to the attribute information of each data to be written. It can be understood that the terminal device is used to write the data to be written into several data nodes of the cluster, and the corresponding relationship between the data buffer queue and the data node is stored in the terminal device, and each data node has a unique corresponding data buffer queue, so that the data to be written in the same data buffer queue is written by the corresponding data node.
步骤S13:响应于写入请求,将数据缓冲队列的待写入数据发送至对应的数据节点。Step S13: In response to the write request, send the data to be written in the data buffer queue to the corresponding data node.
在可选地实施方式中,终端设备获取数据节点的负载状态,并在负载状态为低负载时生成待写入数据的写入请求,响应于写入请求,终端设备将数据缓冲队列的待写入数据发送至对应的数据节点。In an optional implementation, the terminal device obtains the load status of the data node, and generates a write request for data to be written when the load status is low load, and in response to the write request, the terminal device buffers the data in the queue to be written The incoming data is sent to the corresponding data node.
在本申请实施例中,终端设备通过设置与数据节点对应的数据缓冲队列,在接收待写入数据后先将待写入数据分配至对应的数据缓冲队列,以对待写入数据进行预先分拣,避免了待写入数据在数据节点内部的数据流动,提高了待写入数据的安全性,提高了数据写入效率;由于构建了数据节点与数据缓冲队列的对应关系,使得写入待写入数据只与对应的数据节点有关,避免了分布式长尾效应,使得集群资源得到充分利用,提高了数据写入效率。In the embodiment of this application, the terminal device assigns the data to be written to the corresponding data buffer queue after receiving the data to be written by setting the data buffer queue corresponding to the data node, so as to sort the data to be written in advance , which avoids the data flow of the data to be written inside the data node, improves the security of the data to be written, and improves the efficiency of data writing; due to the establishment of the corresponding relationship between the data node and the data buffer queue, the write to be written The input data is only related to the corresponding data node, which avoids the distributed long tail effect, makes full use of cluster resources, and improves the efficiency of data writing.
请参见图2,图2是本申请提供的数据写入方法的第二实施例的流程示意图。如图2所示,在本实施例中,步骤S11之后,该数据写入方法还可以包括:Please refer to FIG. 2 . FIG. 2 is a schematic flowchart of a second embodiment of the data writing method provided by the present application. As shown in Figure 2, in this embodiment, after step S11, the data writing method may also include:
步骤S21:将若干待写入数据传输至线程池。Step S21: Transfer some data to be written to the thread pool.
具体地,在使用客户端进行数据写入时,客户端中设置有线程池,该线程池用于根据数据节点的负载状态来判断是否满足发起写入请求的条件,并在负载状态满足发起写入请求的条件时向对应的数据节点发起写入请求。Specifically, when using the client to write data, a thread pool is set in the client, and the thread pool is used to judge whether the condition for initiating a write request is met according to the load status of the data node, and to initiate the write request when the load status is satisfied. Initiate a write request to the corresponding data node when the condition of the input request is met.
步骤S22:获取若干数据节点的负载状态。Step S22: Obtain the load status of several data nodes.
具体地,终端设备可以在当前的预设时间段内获取上一个预设时间段的数据节点的负载状态,或者,终端设备可以在预设时间段内获取当前的数据节点的负载状态,以使得线程池可以根据数据节点的负载状态来判断是否满足向数据节点发起写入请求的条件。在一可选地实施方式中,终端设备可以通过线程池获取数据节点的负载状态。Specifically, the terminal device can obtain the load status of the data node in the previous preset time period within the current preset time period, or the terminal device can obtain the current load status of the data node within the preset time period, so that The thread pool can judge whether the conditions for initiating a write request to the data node are met according to the load status of the data node. In an optional implementation manner, the terminal device may acquire the load status of the data node through the thread pool.
步骤S23:根据负载状态调整线程池的并发线程的数量,并发线程用于基于待写入数据向数据节点发起写入请求。Step S23: Adjust the number of concurrent threads in the thread pool according to the load status, and the concurrent threads are used to initiate a write request to the data node based on the data to be written.
获取若干数据节点的负载状态后,根据负载状态调整线程池的并发线程的数量,并发线程用于基于待写入数据向数据节点发起写入请求,每一并发线程可以处理一个待写入数据的写入请求。After obtaining the load status of several data nodes, adjust the number of concurrent threads in the thread pool according to the load status. The concurrent threads are used to initiate write requests to the data nodes based on the data to be written. Each concurrent thread can process a data to be written. write request.
因此,根据负载状态调整线程池的并发线程的数量可以使得终端设备对待写入数据的写入速度进行控制,以充分利用集群的资源,提高数据写入效率。Therefore, adjusting the number of concurrent threads in the thread pool according to the load status can enable the terminal device to control the writing speed of the data to be written, so as to make full use of the resources of the cluster and improve the efficiency of data writing.
可选地,步骤S23包括:根据数据节点的负载状态,控制并发线程向数据节点发起写入请求,或者,控制并发线程暂停发起写入请求。Optionally, step S23 includes: controlling the concurrent thread to initiate a write request to the data node according to the load status of the data node, or controlling the concurrent thread to suspend the initiation of the write request.
进一步地,根据数据节点的负载状态,控制并发线程向数据节点发起写入请求,或者,控制并发线程暂停发起写入请求的步骤包括:响应于数据节点为低负载状态,将待写入数据分配至并发线程,以使并发线程基于待写入数据向数据节点发起写入请求;响应于数据节点为高负载状态,暂停待写入数据的写入,并在预设时间后继续获取数据节点的负载状态。Further, according to the load state of the data node, controlling the concurrent thread to initiate a write request to the data node, or the step of controlling the concurrent thread to suspend and initiate the write request includes: in response to the data node being in a low load state, allocating the data to be written To the concurrent thread, so that the concurrent thread initiates a write request to the data node based on the data to be written; in response to the high load state of the data node, suspend the writing of the data to be written, and continue to obtain the data node after the preset time load status.
具体地,在本实施例中,根据数据节点的负载状态对线程池的并发线程的数量进行动态调整,使得在数据节点为低负载状态,终端设备可以将待写入数据分配至并发线程,以使并发线程基于待写入数据向数据节点发起写入请求;在数据节点为高负载状态,终端设备可以暂停当前待写入数据的写入进程,并在预设时间后继续获取数据节点的负载状态,直至数据节点为低负载状态。Specifically, in this embodiment, the number of concurrent threads in the thread pool is dynamically adjusted according to the load state of the data node, so that when the data node is in a low-load state, the terminal device can allocate the data to be written to the concurrent threads to Make concurrent threads initiate a write request to the data node based on the data to be written; when the data node is in a high-load state, the terminal device can suspend the writing process of the current data to be written, and continue to obtain the load of the data node after a preset time state until the data node is in a low load state.
可以理解地,上述的低负载状态和高负载状态为相对状态,低负载状态和高负载状态可以通过数值判断来判定;例如,在数据节点的负载大于第一预设数值时,判定该数据节点处于高负载状态,在数据节点的负载小于第二预设数值时,判定该数据节点处于低负载状态,第二预设数值小于第一预设数值。本实施例根据负载状态对线程池进行动态调整,使得在进行数据写入时集群的负载处于较高状态并且不超过集群的负载能力,使得集群资源得到充分利用,实现了集群的限流熔断,提高集群的数据写入性能。It can be understood that the above-mentioned low-load state and high-load state are relative states, and the low-load state and high-load state can be determined by numerical judgment; for example, when the load of a data node is greater than a first preset value, it is determined that the data node In the high load state, when the load of the data node is less than a second preset value, it is determined that the data node is in a low load state, and the second preset value is smaller than the first preset value. This embodiment dynamically adjusts the thread pool according to the load state, so that the load of the cluster is in a relatively high state when data is written and does not exceed the load capacity of the cluster, so that the cluster resources are fully utilized, and the current limiting fuse of the cluster is realized. Improve the data writing performance of the cluster.
进一步地,根据数据节点的负载状态,控制并发线程向数据节点发起写入请求,或者,控制并发线程暂停发起写入请求的步骤还包括:响应于数据节点为超低负载状态,增加并发线程的数量。Further, according to the load state of the data node, controlling the concurrent thread to initiate a write request to the data node, or the step of controlling the concurrent thread to suspend the initiation of the write request further includes: in response to the data node being in an ultra-low load state, increasing the number of concurrent threads quantity.
具体地,并发线程的数量增加,使得线程池中能够处理待写入数据的线程增多,提高集群对待写入数据的处理数量,进而提高集群负载,使得集群资源得到充分利用,也降低服务器的成本,达到降本增效的作用。Specifically, the increase in the number of concurrent threads increases the number of threads that can process data to be written in the thread pool, increases the number of data to be processed by the cluster, and then increases the cluster load, making full use of cluster resources and reducing server costs. , to reduce costs and increase efficiency.
其中,超低负载状态为低负载状态的相对状态,超低负载状态可以在低负载状态的基础上进行判定。例如,在数据节点的负载小于第二预设数值时,判定该数据节点处于低负载状态,继续判断负载是否小于第三预设数值(第三预设数值小于第二预设数值),以在负载小于第三预设数值时,判定该数据节点处于超低负载状态。Wherein, the ultra-low load state is a relative state of the low-load state, and the ultra-low-load state can be determined on the basis of the low-load state. For example, when the load of the data node is less than the second preset value, it is determined that the data node is in a low load state, and continues to determine whether the load is less than the third preset value (the third preset value is less than the second preset value), so as to When the load is less than the third preset value, it is determined that the data node is in an ultra-low load state.
进一步地,根据数据节点的负载状态,控制并发线程向数据节点发起写入请求,或者,控制并发线程暂停发起写入请求的步骤还包括:响应于数据节点为超高负载状态,减少并发线程的数量。Further, according to the load state of the data node, controlling the concurrent thread to initiate a write request to the data node, or the step of controlling the concurrent thread to suspend the initiation of the write request further includes: in response to the data node being in an ultra-high load state, reducing the number of concurrent threads quantity.
具体地,并发线程的数量减少,使得线程池对于待写入数据的处理能力下降,能够有效降低集群负载,使得数据节点位于正常负载区间,有利于集群资源的充分利用。其中,超高负载状态为高负载状态的相对状态,超高负载状态可以在高负载状态的基础上进行判定。例如,在数据节点的负载大于第一预设数值时,判定该数据节点处于高负载状态,继续判断负载是否大于第四预设数值(第四预设数值大于第一预设数值),以在负载大于第四预设数值时,判定该数据节点处于超高负载状态。Specifically, the reduction in the number of concurrent threads reduces the processing capacity of the thread pool for the data to be written, which can effectively reduce the cluster load and make the data nodes in the normal load range, which is conducive to the full utilization of cluster resources. Wherein, the ultra-high load state is a relative state of the high load state, and the ultra-high load state can be determined on the basis of the high load state. For example, when the load of the data node is greater than the first preset value, it is determined that the data node is in a high load state, and continue to determine whether the load is greater than the fourth preset value (the fourth preset value is greater than the first preset value), so as to When the load is greater than the fourth preset value, it is determined that the data node is in an ultra-high load state.
可选地,步骤S22包括:通过线程池获取若干数据节点的负载状态,并将负载状态存储于线程池的缓存,以使并发线程从缓存获取与待写入数据对应的负载状态。Optionally, step S22 includes: acquiring the load status of several data nodes through the thread pool, and storing the load status in the cache of the thread pool, so that the concurrent threads can acquire the load status corresponding to the data to be written from the cache.
具体地,为了避免并发线程频繁地发起获取负载状态的请求造成的集群压力过大,可选地实施方式中,在线程池设置一个用于获取负载状态的专用线程,该专用线程用于在预设时间段向集群发起请求,以获取集群的数据节点的负载状态,并将获取的负载状态存储于线程池的缓存;在并发线程接收待写入数据后,并发线程根据待写入数据与数据节点的映射关系,从线程池的缓存中获取对应的数据节点的负载状态,并根据该负载状态判断是否发起写入请求。Specifically, in order to avoid excessive cluster pressure caused by concurrent threads frequently initiating requests to obtain load status, in an optional implementation, a dedicated thread for obtaining load status is set in the thread pool. Set a time period to initiate a request to the cluster to obtain the load status of the data nodes of the cluster, and store the acquired load status in the cache of the thread pool; after the concurrent thread receives the data to be written, the concurrent thread according to the data to be written and the data The mapping relationship of the nodes, obtain the load status of the corresponding data node from the cache of the thread pool, and judge whether to initiate a write request according to the load status.
进一步地,线程池的缓存包括本地缓存和/或分布式缓存。Further, the cache of the thread pool includes a local cache and/or a distributed cache.
具体地,本地缓存和分布式缓存(Redis)为客户端在单机环境和分布式环境的缓存,线程池的缓存可以根据客户端的环境选择本地缓存和/或分布式缓存。Specifically, the local cache and the distributed cache (Redis) are the caches of the client in the stand-alone environment and the distributed environment, and the cache of the thread pool can select the local cache and/or the distributed cache according to the client's environment.
请参见图3,图3是本申请提供的数据写入方法的第三实施例的流程示意图。如图3所示,在本实施例中,步骤S12还可以包括:Please refer to FIG. 3 . FIG. 3 is a schematic flowchart of a third embodiment of the data writing method provided by the present application. As shown in Figure 3, in this embodiment, step S12 may also include:
步骤S31:根据属性信息计算与待写入数据对应的数据节点。Step S31: Calculate the data node corresponding to the data to be written according to the attribute information.
具体地,将从数据源获取待写入数据到数据节点完成待写入数据的写入的过程定义为待写入数据的数据路由,即数据路由为待写入数据从数据源到目的数据节点的动态流程。本实施例可以根据路由算法以及待写入数据的属性信息,计算出与待写入数据对应的数据节点。其中,路由算法为寻找待写入数据从数据源到目的数据节点的最小费用路径的算法。Specifically, the process of obtaining the data to be written from the data source to the data node to complete the writing of the data to be written is defined as the data routing of the data to be written, that is, the data routing is the data to be written from the data source to the destination data node dynamic process. In this embodiment, the data node corresponding to the data to be written can be calculated according to the routing algorithm and the attribute information of the data to be written. Among them, the routing algorithm is an algorithm for finding the least-cost path of the data to be written from the data source to the destination data node.
步骤S32:根据预设的数据节点与数据缓冲队列的对应关系,将待写入数据分配至对应的数据缓冲队列。Step S32: According to the preset correspondence between data nodes and data buffer queues, allocate the data to be written to the corresponding data buffer queues.
终端设备中存储有数据节点与数据缓冲队列的对应关系,在获取待写入数据对应的数据节点后,根据数据节点与数据缓冲队列的对应关系可以获取与待写入数据对应的数据缓冲队列,并将待写入数据分配至对应的数据缓冲队列。The corresponding relationship between the data node and the data buffer queue is stored in the terminal device. After obtaining the data node corresponding to the data to be written, the data buffer queue corresponding to the data to be written can be obtained according to the corresponding relationship between the data node and the data buffer queue. And allocate the data to be written to the corresponding data buffer queue.
因此,本实施例可以根据数据节点与数据缓冲队列的对应关系,将待写入数据预先分拣至数据缓冲队列,避免了待写入数据在集群内部的数据节点之间的路由,提高了数据的本地性,提高了数据写入性能;由于写入待写入数据只与对应的数据节点有关,避免了分布式长尾效应,使得集群资源得到充分利用,提高了数据写入效率。Therefore, this embodiment can pre-sort the data to be written into the data buffer queue according to the corresponding relationship between the data node and the data buffer queue, avoiding the routing of the data to be written between the data nodes inside the cluster, and improving the data efficiency. The locality improves the data writing performance; since the data to be written is only related to the corresponding data node, the distributed long tail effect is avoided, the cluster resources are fully utilized, and the data writing efficiency is improved.
可选地,请参见图4,图4是本申请提供的数据写入方法的第四实施例的流程示意图。如图4所示,终端设备从数据源中获取若干待写入数据,并通过线程池获取待写入数据对应的数据节点的负载状态,以根据负载状态调整线程池的并发线程的数量。终端设备根据数据节点的负载状态判断是否控制并发线程向数据节点发起写入请求;在数据节点的负载状态为低负载时,终端设备增加并发线程的数量以提高数据节点的负载,并且,控制并发线程将待写入数据和写入请求发送至数据缓冲队列,以使数据缓冲队列根据写入请求将待写入数据发送至对应的数据节点,使得数据节点完成待写入数据的写入;在数据节点的负载状态为高负载时,控制并发线程暂停发起写入请求,数据缓冲队列暂停将待写入数据写入数据节点,以在数据节点的负载状态较低时继续发起写入请求;在数据节点的负载状态为超高负载时,终端设备减少并发线程的数量以降低数据节点的负载。Optionally, please refer to FIG. 4 , which is a schematic flowchart of a fourth embodiment of the data writing method provided by the present application. As shown in Figure 4, the terminal device obtains some data to be written from the data source, and obtains the load status of the data node corresponding to the data to be written through the thread pool, so as to adjust the number of concurrent threads in the thread pool according to the load status. The terminal device judges whether to control the concurrent thread to initiate a write request to the data node according to the load status of the data node; when the load status of the data node is low, the terminal device increases the number of concurrent threads to increase the load of the data node, and controls the concurrent The thread sends the data to be written and the write request to the data buffer queue, so that the data buffer queue sends the data to be written to the corresponding data node according to the write request, so that the data node completes the writing of the data to be written; When the load status of the data node is high load, the control concurrent thread suspends to initiate the write request, and the data buffer queue suspends writing the data to be written into the data node, so as to continue to initiate the write request when the load status of the data node is low; When the load state of the data node is extremely high, the terminal device reduces the number of concurrent threads to reduce the load of the data node.
进一步地,如图4所示,数据缓冲队列与集群的数据节点对应,例如,在集群包括第一数据节点、第二数据节点、…、第N数据节点时,数据缓冲队列包括对应的第一缓冲队列、第二缓冲队列、…、第N缓冲队列;在第一数据节点处于低负载状态时,控制并发线程将待写入数据和写入请求发送至第一缓冲队列,以使第一缓冲队列将待写入数据写入第一数据节点;在第二数据节点处于高负载状态时,控制并发线程将待写入数据发送至第二缓冲队列并暂停发起写入请求,第二缓冲队列在没有获取写入请求时暂停将写入数据发送至第二数据节点,使得第二数据节点的负载不会继续提高,实现集群负载的限流熔断。Further, as shown in Figure 4, the data buffer queue corresponds to the data nodes of the cluster, for example, when the cluster includes the first data node, the second data node, ..., the Nth data node, the data buffer queue includes the corresponding first Buffer queue, the second buffer queue, ..., the Nth buffer queue; when the first data node is in a low-load state, the control concurrent thread sends the data to be written and the write request to the first buffer queue, so that the first buffer The queue writes the data to be written to the first data node; when the second data node is in a high-load state, the control concurrent thread sends the data to be written to the second buffer queue and suspends initiating write requests, and the second buffer queue is in the When the write request is not obtained, the sending of the write data to the second data node is suspended, so that the load of the second data node will not continue to increase, and the current limit fuse of the cluster load is realized.
区别于现有技术,本申请实施例的数据写入方法通过数据预路由和动态线程池来提高数据写入性能。在数据预路由过程中,将待写入数据预先分拣至数据缓冲队列,避免了待写入数据在数据节点之间的路由,提高了数据的本地性,提高了数据写入性能;由于待写入数据是否写入只与对应的数据节点的负载有关,避免了分布式长尾效应,使得集群资源得到充分利用,提高了数据写入效率;在动态线程池中,通过获取集群的数据节点的负载状态,来动态调整发起写入请求的并发线程的数量,使得集群负载能够充分提高,同时在集群负载过大时又起到限流熔断的作用,使得集群资源得到充分利用。本申请实施例的数据写入方法通过提高写入性能,提高了数据的及时性,也降低服务器的采购成本,进而达到降本增效的作用。Different from the prior art, the data writing method in the embodiment of the present application improves data writing performance through data pre-routing and a dynamic thread pool. In the process of data pre-routing, the data to be written is pre-sorted to the data buffer queue, which avoids the routing of data to be written between data nodes, improves the locality of data, and improves the performance of data writing; Whether the written data is written is only related to the load of the corresponding data node, which avoids the distributed long-tail effect, makes full use of cluster resources, and improves the efficiency of data writing; in the dynamic thread pool, by obtaining the data node of the cluster The load status is used to dynamically adjust the number of concurrent threads that initiate write requests, so that the cluster load can be fully increased. At the same time, when the cluster load is too large, it also plays the role of current limiting and fuse, so that the cluster resources can be fully utilized. The data writing method of the embodiment of the present application improves the timeliness of data by improving the writing performance, and also reduces the purchase cost of the server, thereby achieving the effect of cost reduction and efficiency increase.
请参见图5,图5是本申请提供的终端设备的一实施例的结构示意图。如图5所示,该终端设备100包括处理器101以及与处理器101连接的存储器102,其中,存储器102中存储有程序数据,处理器101调取存储器102存储的程序数据,以执行上述的所有方法。Please refer to FIG. 5 , which is a schematic structural diagram of an embodiment of a terminal device provided in this application. As shown in FIG. 5 , the terminal device 100 includes a processor 101 and a memory 102 connected to the processor 101, wherein program data is stored in the memory 102, and the processor 101 calls the program data stored in the memory 102 to execute the above-mentioned all methods.
可选地,在一实施例中,处理器101用于执行程序数据以实现如下方法:获取若干通用任务的通用文本,将通用文本输入待训练的语言模型,以获取对应的第一提示文本;对若干通用任务的第一提示文本进行聚类,以获取聚类簇信息;获取待训练任务的训练文本和任务参数,基于聚类簇信息、第一提示文本以及任务参数获取第二提示文本;利用训练文本和第二提示文本对待训练的语言模型进行训练。Optionally, in an embodiment, the processor 101 is configured to execute the program data to implement the following method: obtain the general text of several general tasks, input the general text into the language model to be trained, so as to obtain the corresponding first prompt text; Clustering the first prompt texts of several common tasks to obtain cluster cluster information; obtaining training text and task parameters of tasks to be trained, and obtaining second prompt texts based on the cluster cluster information, the first prompt text and task parameters; The language model to be trained is trained by using the training text and the second prompt text.
可选地,在另一实施例中,处理器101用于执行程序数据以实现如下方法:接收实例文本,并将实例文本输入至语言模型,以得到实例文本的第二提示文本;将第二提示文本输入至语言模型,以获取语言模型基于第二提示文本对实例文本输出的预测结果;基于预测结果输出与实例文本对应的答案文本,以完成问答;语言模型是利用如上的模型训练方法得到的。Optionally, in another embodiment, the processor 101 is configured to execute program data to implement the following method: receive the example text, and input the example text into the language model to obtain the second prompt text of the example text; The prompt text is input to the language model to obtain the prediction result of the language model based on the second prompt text to the example text output; the answer text corresponding to the example text is output based on the prediction result to complete the question and answer; the language model is obtained by using the above model training method of.
其中,处理器101还可以称为CPU(Central Processing Unit,中央处理单元)。处理器101可能是一种电子芯片,具有信号的处理能力。处理器101还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。Wherein, the processor 101 may also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 101 may be an electronic chip with signal processing capabilities. The processor 101 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components . A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器102可以为内存条、TF卡等,可以存储终端设备100中的全部信息,包括输入的原始数据、计算机程序、中间运行结果和最终运行结果都保存在存储器102中。它根据处理器101指定的位置存入和取出信息。有了存储器102,终端设备100才有记忆功能,才能保证正常工作。终端设备100的存储器102按用途可分为主存储器(内存)和辅助存储器(外存),也有分为外部存储器和内部存储器的分类方法。外存通常是磁性介质或光盘等,能长期保存信息。内存指主板上的存储部件,用来存放当前正在执行的数据和程序,但仅用于暂时存放程序和数据,关闭电源或断电,数据会丢失。The memory 102 can be a memory stick, a TF card, etc., and can store all information in the terminal device 100, including input raw data, computer programs, intermediate running results and final running results are all stored in the memory 102. It stores and retrieves information according to locations specified by the processor 101. With the memory 102, the terminal device 100 has a memory function to ensure normal operation. The memory 102 of the terminal device 100 can be divided into main memory (internal memory) and auxiliary memory (external memory) according to the purpose, and there is also a classification method of external memory and internal memory. External storage is usually magnetic media or optical discs, which can store information for a long time. Memory refers to the storage unit on the motherboard, which is used to store data and programs currently being executed, but it is only used to store programs and data temporarily, and the data will be lost when the power is turned off or cut off.
请参见图6,图6是本申请提供的计算机可读存储介质的一实施例的结构示意图。如图6所示,该计算机可读存储介质110中存储有能够实现上述所有方法的程序指令111。Please refer to FIG. 6 , which is a schematic structural diagram of an embodiment of a computer-readable storage medium provided by the present application. As shown in FIG. 6 , the computer-readable storage medium 110 stores program instructions 111 capable of implementing all the above-mentioned methods.
在本申请各个实施例中的各功能单元集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在计算机可读存储介质110中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机可读存储介质110在一个程序指令111中,包括若干指令用以使得一台计算机设备(可以是个人计算机,系统服务器,或者网络设备等)、电子设备(例如MP3、MP4等,也可以是手机、平板电脑、可穿戴设备等移动终端,也可以是台式电脑等)或者处理器(processor)以执行本申请各个实施方式方法的全部或部分步骤。If the integrated units of the functional units in various embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they may be stored in the computer-readable storage medium 110 . Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of software products, and the computer-readable storage medium 110 is in a program Instruction 111 includes several instructions to make a computer device (which can be a personal computer, a system server, or a network device, etc.), an electronic device (such as MP3, MP4, etc., or a mobile phone, a tablet computer, a wearable device, etc.) The mobile terminal may also be a desktop computer, etc.) or a processor (processor) to execute all or part of the steps of the methods in various implementation manners of the present application.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可读存储介质110(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media 110 (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机可读存储介质110实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机可读存储介质110到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的程序指令111产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each process and/or block in the flowchart and/or block diagram, and a combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by the computer-readable storage medium 110 . These computer-readable storage media 110 can be provided to a general purpose computer, a special purpose computer, an embedded processor, or a processor of other programmable data processing devices to produce a machine such that the The program instructions 111 generate means for implementing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机可读存储介质110也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储介质110中的程序指令111产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer-readable storage media 110 can also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the program instructions 111 stored in the computer-readable storage medium 110 generate An article of manufacture of a device that instructs a device to implement the function specified in a flow or steps of a flowchart and/or a block or blocks of a block diagram.
这些计算机可读存储介质110也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的程序指令111提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer-readable storage media 110 can also be loaded onto a computer or other programmable data processing device, so that a series of operational steps are performed on the computer or other programmable device to produce computer-implemented processing, thereby The program instructions 111 executed on it provide steps for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions in flowcharts or otherwise described herein may be understood to represent modules, segments or portions of code comprising one or more executable instructions for implementing specific logical functions or steps of the process , and the scope of preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in substantially simultaneous fashion or in reverse order depending on the functions involved, which shall It should be understood by those skilled in the art to which the embodiments of the present application belong.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(可以是个人计算机,服务器,网络设备或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。以上所述仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The logic and/or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium, For the use of instruction execution systems, devices or equipment (which may be personal computers, servers, network equipment or other systems that can fetch instructions from instruction execution systems, devices or devices and execute instructions), or in combination with these instruction execution systems, devices or devices And use. The above is only the implementation of the application, and does not limit the patent scope of the application. Any equivalent structure or equivalent process conversion made by using the specification and drawings of the application, or directly or indirectly used in other related technologies fields, are all included in the scope of patent protection of this application in the same way.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310434027.0A CN116610748A (en) | 2023-04-17 | 2023-04-17 | Data writing method, terminal equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310434027.0A CN116610748A (en) | 2023-04-17 | 2023-04-17 | Data writing method, terminal equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116610748A true CN116610748A (en) | 2023-08-18 |
Family
ID=87675488
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310434027.0A Pending CN116610748A (en) | 2023-04-17 | 2023-04-17 | Data writing method, terminal equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116610748A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118170737A (en) * | 2024-05-11 | 2024-06-11 | 中移(苏州)软件技术有限公司 | Data processing method, device and related equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109947896A (en) * | 2019-03-11 | 2019-06-28 | 浙江邦盛科技有限公司 | A kind of unstructured flow data real-time storage method of rail traffic |
CN112035437A (en) * | 2020-08-31 | 2020-12-04 | 平安医疗健康管理股份有限公司 | Method and device for transmitting medical record data, computer equipment and storage medium |
CN114237505A (en) * | 2021-12-14 | 2022-03-25 | 中国建设银行股份有限公司 | Batch processing method, device and computer equipment for business data |
CN115373811A (en) * | 2021-05-17 | 2022-11-22 | 腾讯科技(深圳)有限公司 | Service related data reporting system, method and device |
CN115543613A (en) * | 2022-09-23 | 2022-12-30 | 北京京东振世信息技术有限公司 | Data processing method and device, electronic equipment and storage medium |
-
2023
- 2023-04-17 CN CN202310434027.0A patent/CN116610748A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109947896A (en) * | 2019-03-11 | 2019-06-28 | 浙江邦盛科技有限公司 | A kind of unstructured flow data real-time storage method of rail traffic |
CN112035437A (en) * | 2020-08-31 | 2020-12-04 | 平安医疗健康管理股份有限公司 | Method and device for transmitting medical record data, computer equipment and storage medium |
CN115373811A (en) * | 2021-05-17 | 2022-11-22 | 腾讯科技(深圳)有限公司 | Service related data reporting system, method and device |
CN114237505A (en) * | 2021-12-14 | 2022-03-25 | 中国建设银行股份有限公司 | Batch processing method, device and computer equipment for business data |
CN115543613A (en) * | 2022-09-23 | 2022-12-30 | 北京京东振世信息技术有限公司 | Data processing method and device, electronic equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118170737A (en) * | 2024-05-11 | 2024-06-11 | 中移(苏州)软件技术有限公司 | Data processing method, device and related equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109783229B (en) | Thread resource allocation method and device | |
US20230124520A1 (en) | Task execution method and storage device | |
TWI694339B (en) | Blockchain consensus method, equipment and system | |
US11275622B2 (en) | Utilizing accelerators to accelerate data analytic workloads in disaggregated systems | |
US8478926B1 (en) | Co-processing acceleration method, apparatus, and system | |
CN115408100B (en) | Method, device, equipment and storage medium for container cluster scheduling | |
WO2021159820A1 (en) | Data transmission and task processing methods, apparatuses and devices | |
US9904337B2 (en) | Affinity-aware parallel zeroing of pages in non-uniform memory access (NUMA) servers | |
JP6172649B2 (en) | Information processing apparatus, program, and information processing method | |
JP2012118987A (en) | Computer implementation method, computer program, and system for memory usage query governor (memory usage query governor) | |
US20110202918A1 (en) | Virtualization apparatus for providing a transactional input/output interface | |
US8930518B2 (en) | Processing of write requests in application server clusters | |
WO2021258512A1 (en) | Data aggregation processing apparatus and method, and storage medium | |
CN112600761A (en) | Resource allocation method, device and storage medium | |
Ahmed et al. | A hybrid and optimized resource scheduling technique using map reduce for larger instruction sets | |
CN115543222B (en) | Storage optimization method, system, equipment and readable storage medium | |
Hussain et al. | A counter based approach for reducer placement with augmented Hadoop rackawareness | |
CN116610748A (en) | Data writing method, terminal equipment and computer readable storage medium | |
CN116661873A (en) | Data parallel processing method, device, computer equipment and storage medium | |
CN120196421A (en) | A method and device for GPU resource virtualization computing power scheduling | |
CN109923533B (en) | Method and apparatus for separating computation and storage in a database | |
US10979359B1 (en) | Polling resource management system | |
US10430233B1 (en) | Scheduling computational tasks among multiple classes of storage resources based on job classification | |
US11233847B1 (en) | Management of allocated computing resources in networked environment | |
US10887381B1 (en) | Management of allocated computing resources in networked environment |
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 |