+

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

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

Info

Publication number
CN114064148B
CN114064148B CN202111365228.7A CN202111365228A CN114064148B CN 114064148 B CN114064148 B CN 114064148B CN 202111365228 A CN202111365228 A CN 202111365228A CN 114064148 B CN114064148 B CN 114064148B
Authority
CN
China
Prior art keywords
target
configuration information
container
data sets
loading operation
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.)
Active
Application number
CN202111365228.7A
Other languages
Chinese (zh)
Other versions
CN114064148A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111365228.7A priority Critical patent/CN114064148B/en
Publication of CN114064148A publication Critical patent/CN114064148A/en
Application granted granted Critical
Publication of CN114064148B publication Critical patent/CN114064148B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • 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)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a data processing method, a device, electronic equipment and a storage medium, relates to the technical field of computers, and further relates to the field of databases, so as to at least solve the technical problems of complex operation process and high development cost in initializing a data set in a database in the related technology. The specific implementation scheme is as follows: implanting configuration information in the target starting container, wherein the configuration information is used for creating a plurality of data sets of the target type database and/or creating corresponding indexes for the plurality of data sets in the process of loading operation of the target starting container; and controlling the target starting container to execute the loading operation process, and calling configuration information at the target stage of the loading operation process to create a plurality of data sets and/or indexes corresponding to the plurality of data sets.

Description

数据处理方法、装置、电子设备及存储介质Data processing method, device, electronic device and storage medium

技术领域technical field

本公开涉及计算机技术领域,进一步涉及数据库领域,尤其涉及一种数据处理方法、装置、电子设备及存储介质。The present disclosure relates to the field of computer technology, further to the field of databases, and in particular to a data processing method, device, electronic equipment, and storage medium.

背景技术Background technique

基于分布式文件存储的数据库(MongoDB)能够为WEB应用提供可扩展的高性能数据存储解决方案。在进行轻量级开源框架(如,Spring)项目私有化或公有云部署时,需要对MongoDB数据库中的数据集合初始化。The database (MongoDB) based on distributed file storage can provide scalable high-performance data storage solutions for WEB applications. When privatizing a lightweight open source framework (such as Spring) project or deploying it on a public cloud, it is necessary to initialize the data set in the MongoDB database.

相关技术中,进行初始化时,可以执行建立数据集合和索引的命令或者语句脚本,或者,通过Spring项目数据中的文件注解和索引注解在第一次操作MongoDB文档时创建数据集合和索引。但是,相关技术对MongoDB数据库进行初始化的操作过程繁琐且开发成本较高。In related technologies, when initializing, commands or statement scripts for creating data collections and indexes can be executed, or the data collections and indexes can be created when the MongoDB document is operated for the first time through file annotations and index annotations in the Spring project data. However, in the related art, the operation process of initializing the MongoDB database is cumbersome and the development cost is relatively high.

发明内容Contents of the invention

本公开提供了一种数据处理方法、装置、电子设备及存储介质,以至少解决相关技术中对数据库中的数据集合进行初始化的操作过程繁琐且开发成本较高的技术问题。The present disclosure provides a data processing method, device, electronic device and storage medium, so as to at least solve the technical problems of cumbersome operation process and high development cost of initializing a data set in a database in the related art.

根据本公开的一方面,提供了一种数据处理方法,包括:在目标启动容器中植入配置信息,其中,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引;控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引。According to an aspect of the present disclosure, there is provided a data processing method, including: implanting configuration information in the target startup container, wherein the configuration information is used to create a plurality of data of the target type database during the loading operation of the target startup container collection and/or create corresponding indexes for multiple data collections; control the target startup container to execute the loading operation process, and call the configuration information at the target stage of the loading operation process to create multiple data collections and/or multiple data collections corresponding to index.

根据本公开的又一方面,提供了一种数据处理装置,包括:配置模块,用于在目标启动容器中植入配置信息,其中,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引;创建模块,用于控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引。According to yet another aspect of the present disclosure, a data processing device is provided, including: a configuration module configured to embed configuration information in a target startup container, wherein the configuration information is used to create a target when the target startup container executes a loading operation Multiple data collections of type database and/or create corresponding indexes for multiple data collections; create a module to control the target startup container to execute the loading operation process, and call the configuration information at the target stage of the loading operation process to create multiple A data set and/or indexes corresponding to multiple data sets.

根据本公开的又一方面,提供了一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行本公开提出的数据处理方法。According to yet another aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are Execution by at least one processor, so that at least one processor can execute the data processing method proposed in the present disclosure.

根据本公开的又一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,计算机指令用于使计算机执行本公开提出的数据处理方法。According to yet another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the data processing method proposed in the present disclosure.

根据本公开的又一方面,提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行本公开提出的数据处理方法。According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program, and the computer program is executed by a processor to execute the data processing method proposed in the present disclosure.

在本公开中,通过在目标启动容器中植入配置信息,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引,进而控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引,达到了高效创建数据库中的数据集合及对应数据集合的索引的目的,实现了简化对数据库中的数据集合进行初始化的操作流程,进而降低开发成本的效果,从而解决了相关技术中对数据库中的数据集合进行初始化的操作过程繁琐且开发成本较高的技术问题。In this disclosure, by embedding configuration information in the target startup container, the configuration information is used to create multiple data collections of the target type database and/or create corresponding indexes for multiple data collections during the loading operation of the target startup container , and then control the target startup container to execute the loading operation process, and call the configuration information at the target stage of the loading operation process to create multiple data sets and/or indexes corresponding to multiple data sets, achieving efficient creation of data sets in the database and The purpose of corresponding to the index of the data set realizes the simplification of the operation process of initializing the data set in the database, thereby reducing the effect of development cost, thus solving the cumbersome operation process of initializing the data set in the database in related technologies and the development Costly technical issues.

应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will be readily understood through the following description.

附图说明Description of drawings

附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used to better understand the present solution, and do not constitute a limitation to the present disclosure. in:

图1是相关技术的一种数据处理方法示意图;Fig. 1 is a schematic diagram of a data processing method in the related art;

图2是相关技术的又一种数据处理方法示意图;FIG. 2 is a schematic diagram of another data processing method in the related art;

图3是根据本公开实施例的一种用于实现数据处理方法的计算机终端(或移动设备)的硬件结构框图;3 is a block diagram of a hardware structure of a computer terminal (or mobile device) for implementing a data processing method according to an embodiment of the present disclosure;

图4是根据本公开实施例的一种数据处理方法流程图;Fig. 4 is a flow chart of a data processing method according to an embodiment of the present disclosure;

图5a是相关技术的一种创建数据集合与索引的操作过程示意图;Fig. 5a is a schematic diagram of an operation process of creating a data set and an index in the related art;

图5b是根据本公开实施例的一种创建数据集合与索引的操作过程示意图;Fig. 5b is a schematic diagram of an operation process of creating a data set and an index according to an embodiment of the present disclosure;

图6a是相关技术的一种实体对应关系示意图;FIG. 6a is a schematic diagram of an entity correspondence relationship in the related art;

图6b是根据本公开实施例的一种实体对应关系示意图;Fig. 6b is a schematic diagram of entity correspondence according to an embodiment of the present disclosure;

图7是根据本公开实施例的一种数据处理装置的结构框图。Fig. 7 is a structural block diagram of a data processing device according to an embodiment of the disclosure.

具体实施方式Detailed ways

以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the specification and claims of the present disclosure and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

对MongoDB数据库中的数据集合的初始化过程包括创建数据集合及对应集合的索引,现有方案中通常采用以下两种方式进行数据集合的初始化:The initialization process of the data collection in the MongoDB database includes creating the data collection and the index of the corresponding collection. In the existing scheme, the following two methods are usually used to initialize the data collection:

方式一:在MongoDB数据库中执行建立数据集合和索引的命令或者语句脚本。这种方式虽然简单直接,但是在对于一些无法访问外网的用户服务器进行私有化部署时,会出现无法登录MongoDB数据库,进而无法执行相应语句的情况。同样对于公有云项目,生产环境中的MongoDB数据库无法直接进行手动连接以执行语句操作,并且在采用手工操作进行初始化时,还需要注意建表和索引的先后顺序和依赖关系。Method 1: Execute commands or statement scripts to create data sets and indexes in the MongoDB database. Although this method is simple and direct, when some user servers that cannot access the external network are deployed privately, they may not be able to log in to the MongoDB database, and thus cannot execute the corresponding statement. Also for public cloud projects, the MongoDB database in the production environment cannot be manually connected directly to execute statement operations, and when using manual operations for initialization, you also need to pay attention to the order and dependencies of creating tables and indexes.

例如,图1是相关技术的一种数据处理方法示意图,如图1所示,在开始对MongoDB数据库中的数据集合进行初始化后,手动操作创建MongoDB数据库的数据集合及其对应的索引,随后进行项目启动,最后结束创建流程。For example, Figure 1 is a schematic diagram of a data processing method of related technologies. As shown in Figure 1, after initializing the data collection in the MongoDB database, manually create the data collection of the MongoDB database and its corresponding index, and then perform The project starts and finally ends the creation process.

方式二:通过Spring项目数据中的文件(Document)注解和索引(Indexed)注解在第一次操作MongoDB文档时创建数据集合和索引。这种方式无需登录MongoDB数据库所在设备,由程序在操作数据库时自动创建集合和索引。但是,该方案在用户数据量较大、需要对MongoDB数据库进行同结构分表操作时存在不足。Method 2: Create data collections and indexes when operating MongoDB documents for the first time through the Document annotation and Indexed annotation in the Spring project data. In this way, there is no need to log in to the device where the MongoDB database is located, and the program automatically creates collections and indexes when operating the database. However, this solution has shortcomings when the amount of user data is large and the MongoDB database needs to be divided into tables with the same structure.

由于Document注解修饰的持久化类,只能对应一个固定的数据集合创建Indexed注解修饰的字段索引,而无法对指定其他名称的数据集合建立索引。因此,在用户数据量较大、需要对MongoDB数据库进行同结构分表操作时,还是需要登录MongoDB数据库进行手动命令操作,同样面临类似于方案一中对应的服务器无法连接进而无法操作的问题。Since the persistent class modified by the Document annotation can only create a field index modified by the Indexed annotation corresponding to a fixed data set, it cannot create an index for a data set with another name specified. Therefore, when the amount of user data is large and the MongoDB database needs to be divided into tables with the same structure, it is still necessary to log in to the MongoDB database to perform manual command operations. It also faces the problem that the corresponding server in Solution 1 cannot be connected and cannot be operated.

虽然还可以利用Document注解,根据需要建立分表的数量,一一对应的建立大量的同结构持久化实体,然后在操作数据库的时候自行建立集合和索引。但这种方式会建立大量的重复结构实体,增加了服务启动时容器加载的负担,也会消耗更多的内存等服务器资源,重复代码也会指数级的增加。并且后续如果需要修改持久层代码,则所有同结构的持久化实体代码都面临修改,增加了大量的开发成本,也不利于系统本身的维护。Although you can also use Document annotations to create the number of sub-tables as needed, create a large number of persistent entities with the same structure one by one, and then create collections and indexes by yourself when operating the database. However, this method will create a large number of repetitive structural entities, increase the burden of container loading when the service starts, and consume more server resources such as memory, and the repetitive code will also increase exponentially. And if the persistence layer code needs to be modified in the future, all persistent entity codes of the same structure will face modification, which increases a lot of development costs and is not conducive to the maintenance of the system itself.

例如,图2是相关技术的又一种数据处理方法示意图,如图2所示,在开始对MongoDB数据库中的数据集合进行初始化后,首先进行项目启动,在项目启动后根据注解在第一次操作MongoDB文档时创建数据集合并添加索引。For example, Figure 2 is a schematic diagram of another data processing method of the related technology. As shown in Figure 2, after initializing the data collection in the MongoDB database, the project is started first, and after the project is started, the first Create datasets and add indexes when manipulating MongoDB documents.

现有方案在进行Spring项目私有化或公有云部署时,存在对数据库中的数据集合进行初始化的操作过程繁琐且开发成本较高的技术问题。In the existing solution, when the Spring project is privatized or deployed on the public cloud, there are technical problems such as the cumbersome operation process of initializing the data collection in the database and the high development cost.

根据本公开实施例,提供了一种数据处理方法,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present disclosure, a data processing method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and, although the steps shown in the flowcharts Although a logical order is shown, in some cases the steps shown or described may be performed in an order different from that shown or described herein.

本公开实施例所提供的方法实施例可以在移动终端、计算机终端或者类似的电子设备中执行。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。图3示出了一种用于实现数据处理方法的计算机终端(或移动设备)的硬件结构框图。The method embodiments provided by the embodiments of the present disclosure may be executed in mobile terminals, computer terminals or similar electronic devices. Electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the disclosure described and/or claimed herein. Fig. 3 shows a block diagram of a hardware structure of a computer terminal (or mobile device) for implementing the data processing method.

如图3所示,计算机终端300包括计算单元301,其可以根据存储在只读存储器(ROM)302中的计算机程序或者从存储单元308加载到随机访问存储器(RAM)303中的计算机程序,来执行各种适当的动作和处理。在RAM 303中,还可存储计算机终端300操作所需的各种程序和数据。计算单元301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。As shown in FIG. 3 , a computer terminal 300 includes a computing unit 301, which can perform calculations according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. Various appropriate actions and processes are performed. In the RAM 303, various programs and data necessary for the operation of the computer terminal 300 can also be stored. The computing unit 301 , ROM 302 and RAM 303 are connected to each other through a bus 304 . An input/output (I/O) interface 305 is also connected to the bus 304 .

计算机终端300中的多个部件连接至I/O接口305,包括:输入单元306,例如键盘、鼠标等;输出单元307,例如各种类型的显示器、扬声器等;存储单元308,例如磁盘、光盘等;以及通信单元309,例如网卡、调制解调器、无线通信收发机等。通信单元309允许计算机终端300通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the computer terminal 300 are connected to the I/O interface 305, including: an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a magnetic disk, an optical disk etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 309 allows the computer terminal 300 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.

计算单元301可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元301的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元301执行本文所描述的数据处理方法。例如,在一些实施例中,数据处理方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元308。在一些实施例中,计算机程序的部分或者全部可以经由ROM 302和/或通信单元309而被载入和/或安装到计算机终端300上。当计算机程序加载到RAM 303并由计算单元301执行时,可以执行本文描述的数据处理方法的一个或多个步骤。备选地,在其他实施例中,计算单元301可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行数据处理方法。The computing unit 301 may be various general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of computing units 301 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 executes the data processing method described herein. For example, in some embodiments, the data processing method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 308 . In some embodiments, part or all of the computer program may be loaded and/or installed on the computer terminal 300 via the ROM 302 and/or the communication unit 309 . When a computer program is loaded into RAM 303 and executed by computing unit 301, one or more steps of the data processing methods described herein may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to execute the data processing method in any other suitable manner (for example, by means of firmware).

本文中描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or a combination thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor Can be special-purpose or general-purpose programmable processor, can receive data and instruction from storage system, at least one input device, and at least one output device, and transmit data and instruction to this storage system, this at least one input device, and this at least one output device an output device.

此处需要说明的是,在一些可选实施例中,上述图3所示的电子设备可以包括硬件元件(包括电路)、软件元件(包括存储在计算机可读介质上的计算机代码)、或硬件元件和软件元件两者的结合。应当指出的是,图3仅为特定具体实例的一个实例,并且旨在示出可存在于上述电子设备中的部件的类型。It should be noted here that, in some optional embodiments, the electronic device shown in FIG. 3 may include hardware components (including circuits), software components (including computer codes stored on computer-readable media), or hardware components. Combination of both Components and Software Components. It should be noted that FIG. 3 is only one example of a particular embodiment, and is intended to illustrate the types of components that may be present in the electronic devices described above.

在上述运行环境下,本公开提供了如图4所示的数据处理方法,该方法可以由图3所示的计算机终端或者类似的电子设备执行。图4是根据本公开实施例提供的一种数据处理方法流程图。如图4所示,该方法可以包括如下步骤:Under the above operating environment, the present disclosure provides a data processing method as shown in FIG. 4 , which can be executed by the computer terminal shown in FIG. 3 or a similar electronic device. Fig. 4 is a flowchart of a data processing method provided according to an embodiment of the present disclosure. As shown in Figure 4, the method may include the following steps:

步骤S40,在目标启动容器中植入配置信息,其中,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引;Step S40, implanting configuration information in the target startup container, wherein the configuration information is used to create multiple data sets of the target type database and/or create corresponding indexes for the multiple data sets during the loading operation of the target startup container;

上述目标启动容器为一种开源应用框架,例如,目标启动容器可以为开源应用框架Springboot容器。The above target startup container is an open source application framework, for example, the target startup container may be an open source application framework Springboot container.

上述目标类型数据库包括且不限于MongoDB数据库、关系型数据库管理系统(MySQL)数据库等。上述多个数据集合可以为MongoDB数据库中的多个集合(collection),也可以为MySQL中的多个数据表。The aforementioned target type databases include but are not limited to MongoDB databases, relational database management system (MySQL) databases, and the like. The above multiple data collections may be multiple collections in the MongoDB database, or multiple data tables in MySQL.

可选地,在目标启动容器中植入配置信息包括:在目标启动容器中植入可以自动执行的代码,该代码可用于创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引。Optionally, implanting the configuration information in the target startup container includes: implanting automatically executable code in the target startup container, the code can be used to create multiple data sets of the target type database and/or create the corresponding index.

可选地,在目标启动容器中植入配置信息,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合。Optionally, configuration information is implanted in the target startup container, and the configuration information is used to create multiple data sets of the target type database when the target startup container executes the loading operation.

可选地,在目标启动容器中植入配置信息,配置信息用于在目标启动容器执行加载操作过程中为多个数据集合创建对应的索引。Optionally, configuration information is embedded in the target startup container, and the configuration information is used to create corresponding indexes for multiple data sets during the loading operation of the target startup container.

可选地,在目标启动容器中植入配置信息,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和为多个数据集合创建对应的索引。Optionally, configuration information is embedded in the target startup container, and the configuration information is used to create multiple data sets of the target type database and create corresponding indexes for the multiple data sets during the loading operation of the target startup container.

具体的,在目标启动容器中植入配置信息的实现过程可参照对于本公开实施例的进一步介绍,不予赘述。Specifically, for the implementation process of embedding configuration information in the target startup container, reference may be made to the further introduction of the embodiments of the present disclosure, and details are not repeated here.

步骤S42,控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引。Step S42, control the target to start the container to execute the loading operation process, and call the configuration information at the target stage of the loading operation process, so as to create multiple data sets and/or indexes corresponding to the multiple data sets.

上述目标阶段为加载操作完成前的最后一个操作步骤。The target phase above is the last operational step before the load operation is complete.

根据本公开上述步骤S40至步骤S42,通过在目标启动容器中植入配置信息,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引,进而控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引,达到了高效创建数据库中的数据集合及对应数据集合的索引的目的,实现了简化对数据库中的数据集合进行初始化的操作流程,进而降低开发成本的效果,从而解决了相关技术中对数据库中的数据集合进行初始化的操作过程繁琐且开发成本较高的技术问题。According to the above step S40 to step S42 of the present disclosure, by embedding configuration information in the target startup container, the configuration information is used to create multiple data sets of the target type database and/or create multiple data sets for multiple data sets during the loading operation of the target startup container. The collection creates corresponding indexes, and then controls the target startup container to execute the loading operation process, and calls the configuration information at the target stage of the loading operation process to create multiple data collections and/or indexes corresponding to multiple data collections, achieving efficient database creation The purpose of the data set in the database and the index of the corresponding data set is to simplify the operation process of initializing the data set in the database, thereby reducing the development cost, thus solving the problem of initializing the data set in the database in related technologies Technical problems with cumbersome operation process and high development cost.

下面对上述实施例的数据处理方法进行进一步介绍。The data processing method in the foregoing embodiment will be further introduced below.

作为一种可选的实施方式,在步骤S40,在目标启动容器中植入配置信息包括:在目标启动容器执行加载操作过程中,植入配置信息。As an optional implementation manner, in step S40, implanting the configuration information in the target startup container includes: implanting the configuration information during the loading operation of the target startup container.

作为一种可选的实施方式,在目标启动容器执行加载操作过程中,植入配置信息包括以下任意一个步骤:As an optional implementation manner, during the loading operation of the target startup container, implanting configuration information includes any of the following steps:

步骤S401,在目标启动容器执行加载操作过程中,基于目标启动容器提供的实例对象,在目标启动容器中植入配置信息;Step S401, during the loading operation process of the target startup container, based on the instance object provided by the target startup container, implant configuration information in the target startup container;

具体的,基于目标启动容器提供的实例对象,在目标启动容器中植入配置信息的实现过程可以参照下文实施例的进一步介绍。Specifically, based on the instance object provided by the target startup container, the implementation process of embedding configuration information in the target startup container can refer to the further introduction of the following embodiments.

步骤S402,在目标启动容器执行加载操作过程中,基于目标类型数据库的原生方式,在目标启动容器中植入配置信息。Step S402, during the loading operation process of the target startup container, based on the native mode of the target type database, implant configuration information in the target startup container.

其中,原生方式用于表示采用目标类型数据库的原生控制命令对目标类型数据库进行控制操作。Wherein, the native mode is used to indicate that a native control command of the target type database is used to perform a control operation on the target type database.

具体的,基于目标类型数据库的原生方式,在目标启动容器中植入配置信息的实现过程可以参照下文实施例的进一步介绍。Specifically, based on the native method of the target type database, the implementation process of embedding configuration information in the target startup container can refer to the further introduction of the following embodiments.

基于上述步骤S401或者步骤S402,在目标启动容器执行加载操作过程中,分别基于目标启动容器提供的实例对象,或者,基于目标类型数据库的原生方式,能够在目标启动容器中植入配置信息,以便于后续在加载操作过程中直接调用配置信息,进而提高多个数据集合及其对应索引的创建效率。Based on the above step S401 or step S402, during the loading operation process of the target startup container, based on the instance object provided by the target startup container respectively, or based on the native mode of the target type database, configuration information can be implanted in the target startup container, so that In the subsequent loading operation, the configuration information is directly called, thereby improving the efficiency of creating multiple data sets and their corresponding indexes.

作为一种可选的实施方式,在步骤S401,基于目标启动容器提供的实例对象,在目标启动容器中植入配置信息包括:As an optional implementation manner, in step S401, based on the instance object provided by the target startup container, implanting configuration information in the target startup container includes:

步骤S4011,对第一实例对象进行初始化,其中,第一实例对象由目标启动容器提供,并且第一实例对象的底层与目标类型数据库建立连接;Step S4011, initialize the first instance object, wherein the first instance object is provided by the target startup container, and the bottom layer of the first instance object establishes a connection with the target type database;

上述第一实例对象可以为Mongo模板实例对象,即MongoTemplate对象。其中,MongoTemplate对象可以由Springboot容器提供,该实例对象的底层与MongoDB数据库建立连接。The above-mentioned first instance object may be a Mongo template instance object, that is, a MongoTemplate object. Among them, the MongoTemplate object can be provided by the Springboot container, and the bottom layer of the instance object establishes a connection with the MongoDB database.

步骤S4012,通过初始化后的第一实例对象植入配置信息,以创建多个数据集合和/或多个数据集合对应的索引。Step S4012, embedding configuration information through the initialized first instance object to create multiple data sets and/or indexes corresponding to the multiple data sets.

具体的,通过初始化后的第一实例对象植入配置信息以直接操作MongoDB数据库,进而创建多个数据集合和/或多个数据集合对应的索引。Specifically, configuration information is implanted into the initialized first instance object to directly operate the MongoDB database, thereby creating multiple data sets and/or indexes corresponding to the multiple data sets.

基于上述步骤S4011至步骤S4012,能够基于目标启动容器提供的实例对象,在目标启动容器中植入配置信息,以利用第一实例对象创建多个数据集合和/或多个数据集合对应的索引。Based on the above steps S4011 to S4012, configuration information can be embedded in the target startup container based on the instance objects provided by the target startup container, so as to use the first instance object to create multiple data sets and/or indexes corresponding to the multiple data sets.

作为一种可选的实施方式,在步骤S402,基于目标类型数据库的原生方式,在目标启动容器中植入配置信息包括:As an optional implementation manner, in step S402, based on the native mode of the target type database, implanting configuration information in the target startup container includes:

步骤S4021,通过目标类型数据库的原生控制命令创建第二实例对象,其中,第二实例对象用于连接目标类型数据库;Step S4021, creating a second instance object through a native control command of the target type database, wherein the second instance object is used to connect to the target type database;

上述第二实例对象为Mongo客户对象,即MongoClient对象,MongoClient对象可以通过参数传入的网际互联协议(Internet Protocol,IP)地址和端口与MongoDB数据库建立连接。The above-mentioned second instance object is a Mongo client object, that is, a MongoClient object, and the MongoClient object can establish a connection with the MongoDB database through the Internet Protocol (Internet Protocol, IP) address and port introduced by parameters.

步骤S4022,通过第二实例对象获取目标类型数据库的第三实例对象;Step S4022, acquire the third instance object of the target type database through the second instance object;

上述第三实例对象可以为Mongo数据库对象,即MongoDataBase对象。The above-mentioned third instance object may be a Mongo database object, that is, a MongoDataBase object.

步骤S4023,通过第三实例对象获取目标类型数据库的目标集合对象;Step S4023, acquire the target collection object of the target type database through the third instance object;

上述目标集合对象为Mongo集合对象,即MongoCollection对象。The above target collection object is a Mongo collection object, that is, a MongoCollection object.

步骤S4024,通过目标集合对象植入配置信息,以创建多个数据集合和/或多个数据集合对应的索引。Step S4024, embedding configuration information through the target collection object to create multiple data sets and/or indexes corresponding to multiple data sets.

例如,通过MongoCollection对象直接操作MongoDB数据库,以创建多个数据集合和多个数据集合对应的索引。For example, directly operate the MongoDB database through the MongoCollection object to create multiple data collections and indexes corresponding to multiple data collections.

基于上述步骤S4021至步骤S4024,能够基于目标类型数据库的原生方式,在目标启动容器中植入配置信息,以创建多个数据集合和/或多个数据集合对应的索引。Based on the above steps S4021 to S4024, configuration information can be embedded in the target startup container based on the native mode of the target type database, so as to create multiple data sets and/or indexes corresponding to multiple data sets.

作为一种可选的实施方式,在步骤S42,控制目标启动容器执行加载操作过程,并在目标阶段调用配置信息包括:控制目标启动容器执行加载操作过程,并在加载操作完成前的最后一个操作步骤调用配置信息。As an optional implementation, in step S42, controlling the target startup container to execute the loading operation process, and invoking configuration information at the target stage includes: controlling the target startup container to execute the loading operation process, and the last operation before the loading operation is completed Step call configuration information.

具体的,控制目标启动容器执行加载操作过程中,将目标启动容器首先载入所需的资源,在加载操作完成前的最后一个操作步骤调用配置信息,可以充分利用加载操作过程中已载入的资源。Specifically, during the loading operation process of the control target startup container, the target startup container is first loaded with the required resources, and the configuration information is called in the last operation step before the loading operation is completed, which can make full use of the resources already loaded during the loading operation. resource.

作为一种可选的实施方式,多个数据集合具有相同的数据结构。As an optional implementation manner, multiple data sets have the same data structure.

具体的,多个数据集合的持久化实体类相同。由于目标启动容器初始化时已经对MongoDB数据库的相应集合创建了索引,因而不需要通过持久化实体中的注解创建索引。此时,利用一个持久化实体类即可操作MongoDB数据库中的多个数据结构相同的集合分表。Specifically, the persistent entity classes of multiple data collections are the same. Since the index has been created for the corresponding collection of the MongoDB database when the target startup container is initialized, there is no need to create an index through the annotation in the persistent entity. At this point, multiple collection sub-tables with the same data structure in the MongoDB database can be operated by using a persistent entity class.

下面结合示意图对本公开实施例的数据处理方法进行介绍。The data processing method of the embodiment of the present disclosure will be introduced below with reference to schematic diagrams.

图5a是相关技术的一种创建数据集合与索引的操作过程示意图,如图5a所示,部署人员需要手动在MongoDB数据库中创建多个数据集合和多个数据集合对应的索引,在完成创建之后启动项目服务。Figure 5a is a schematic diagram of the operation process of creating data sets and indexes in related technologies. As shown in Figure 5a, the deployer needs to manually create multiple data sets and indexes corresponding to multiple data sets in the MongoDB database. After the creation is completed Start the project service.

图5b是根据本公开实施例的一种创建数据集合与索引的操作过程示意图,如图5b所示,执行本公开实施例的数据处理方法,部署人员可以直接启动项目服务,在项目服务执行加载操作过程中,可以调用配置信息自动创建多个MongoDB数据库中的多个数据集合和多个数据集合对应的索引。Fig. 5b is a schematic diagram of an operation process for creating data collections and indexes according to an embodiment of the present disclosure. As shown in Fig. 5b, after executing the data processing method of the embodiment of the present disclosure, the deployer can directly start the project service, and execute the loading in the project service During the operation, configuration information can be invoked to automatically create multiple data collections in multiple MongoDB databases and indexes corresponding to multiple data collections.

本公开在目标启动容器执行加载操作过程调用配置信息,以创建多个数据集合和多个数据集合对应的索引,可以实现在项目服务启动时自动执行初始化任务,可以简化相关技术中登录数据库手动操作以进行初始化的流程。进一步地,能够避免产生手动执行时间晚于服务启动时间而导致的不符合表结构或索引的异常数据,同时。服务容器的加载过程无需等待数据库中集合、索引创建完成,从而减少了项目发布时的服务不可用时间。This disclosure invokes configuration information during the loading operation process of the target startup container to create multiple data sets and indexes corresponding to multiple data sets, which can realize automatic execution of initialization tasks when the project service is started, and can simplify the manual operation of logging into the database in related technologies to initialize the process. Furthermore, abnormal data that does not conform to the table structure or index caused by the manual execution time being later than the service startup time can be avoided, and at the same time. The loading process of the service container does not need to wait for the collection and index creation in the database to be completed, thereby reducing the service unavailable time when the project is released.

图6a是相关技术的一种实体对应关系示意图,如图6a所示,采用在持久化实体类中加入Document注解和Indexed注解等来对数据库表或集合进行操作时,一个持久化实体类只能唯一对应的初始化一个名称的集合的索引,对于同一结构的多个集合分表,需要建立与集合个数相同数目的持久化实体类,才能达到初始化每一个集合分表的目的。即在MongoDB数据库中建立n个数据集合时,需要在在项目容器中一一对应地创建n个持久化实体类,这种方式不利于后续对MongoDB数据库的操作和持久化实体类的管理。Figure 6a is a schematic diagram of an entity correspondence relationship in related technologies. As shown in Figure 6a, when adding Document annotations and Indexed annotations to a persistent entity class to operate a database table or collection, a persistent entity class can only The only corresponding index to initialize a collection with a name. For multiple collection sub-tables of the same structure, it is necessary to create the same number of persistent entity classes as the number of collections to achieve the purpose of initializing each collection sub-table. That is, when creating n data collections in the MongoDB database, it is necessary to create n persistent entity classes in the project container in one-to-one correspondence. This method is not conducive to subsequent operations on the MongoDB database and management of persistent entity classes.

图6b是根据本公开实施例的一种实体对应关系示意图,图6b所示,本公开实施例中可以在目标启动容器中植入配置信息,其中,配置信息可以进行自定义,进而可以按需建立相同数据结构的多个MongoDB的数据集合,并且在容器初始化后就完成对数据集合对应索引的创建。因此,在操作相同数据结构的数据集合时,只需要在项目容器中创建一个持久化实体类,从而实现持久化实体类的便捷管理。Fig. 6b is a schematic diagram of entity correspondence according to an embodiment of the present disclosure. As shown in Fig. 6b, in the embodiment of the present disclosure, configuration information can be implanted in the target startup container, wherein the configuration information can be customized, and then can be customized as required Create multiple MongoDB data collections with the same data structure, and complete the creation of corresponding indexes for the data collections after the container is initialized. Therefore, when operating data collections of the same data structure, it is only necessary to create a persistent entity class in the project container, so as to realize convenient management of the persistent entity class.

本公开实施例通过在目标启动容器中植入配置信息,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引,进而控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引,达到了高效创建数据库中的数据集合及对应数据集合的索引的目的,实现了简化对数据库中的数据集合进行初始化的操作流程,进而降低开发成本的效果,从而解决了相关技术中对数据库中的数据集合进行初始化的操作过程繁琐且开发成本较高的技术问题。In the embodiment of the present disclosure, configuration information is implanted in the target startup container, and the configuration information is used to create multiple data sets of the target type database and/or create corresponding indexes for multiple data sets during the loading operation of the target startup container. Then control the target to start the container to execute the loading operation process, and call the configuration information at the target stage of the loading operation process to create multiple data sets and/or indexes corresponding to multiple data sets, achieving efficient creation of data sets in the database and corresponding The purpose of indexing the data set is to simplify the operation process of initializing the data set in the database, thereby reducing the development cost, thus solving the cumbersome operation process and the development cost of initializing the data set in the database in related technologies Higher technical issues.

本公开的技术方案中,所涉及的用户个人信息的收集、存储、使用、加工、传输、提供和公开等处理,均符合相关法律法规的规定,且不违背公序良俗。In the technical solution of this disclosure, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved are all in compliance with relevant laws and regulations, and do not violate public order and good customs.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the essence of the technical solution of the present disclosure or the part that contributes to the related technology can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to make a A terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) executes the methods described in various embodiments of the present disclosure.

在本公开中还提供了一种数据处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。The present disclosure also provides a data processing device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been explained will not be repeated here. As used below, the term "module" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.

图7是根据本公开其中一实施例的一种数据处理装置的结构框图,如图7所示,一种数据处理装置700包括:Fig. 7 is a structural block diagram of a data processing device according to one embodiment of the present disclosure. As shown in Fig. 7, a data processing device 700 includes:

配置模块701,用于在目标启动容器中植入配置信息,其中,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引;The configuration module 701 is configured to embed configuration information in the target startup container, wherein the configuration information is used to create multiple data sets of the target type database and/or create corresponding index of;

创建模块702,用于控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引。The creation module 702 is configured to control the target startup container to execute the loading operation process, and call the configuration information during the target stage of the loading operation process, so as to create multiple data sets and/or indexes corresponding to the multiple data sets.

可选地,配置模块701还用于:在目标启动容器执行加载操作过程中,植入配置信息。Optionally, the configuration module 701 is further configured to: implant configuration information when the target startup container executes a loading operation.

可选地,配置模块701还用于:在目标启动容器执行加载操作过程中,基于目标启动容器提供的实例对象,在目标启动容器中植入配置信息;或者,在目标启动容器执行加载操作过程中,基于目标类型数据库的原生方式,在目标启动容器中植入配置信息,其中,原生方式用于表示采用目标类型数据库的原生控制命令对目标类型数据库进行控制操作。Optionally, the configuration module 701 is further configured to: during the loading operation process of the target startup container, based on the instance object provided by the target startup container, implant configuration information in the target startup container; or, during the loading operation process of the target startup container In , based on the native mode of the target type database, the configuration information is implanted in the target startup container, wherein the native mode is used to indicate that the target type database is controlled by the native control command of the target type database.

可选地,配置模块701还用于:对第一实例对象进行初始化,其中,第一实例对象由目标启动容器提供,并且第一实例对象的底层与目标类型数据库建立连接;通过初始化后的第一实例对象植入配置信息,以创建多个数据集合和/或多个数据集合对应的索引。Optionally, the configuration module 701 is also used to: initialize the first instance object, wherein the first instance object is provided by the target startup container, and the bottom layer of the first instance object establishes a connection with the target type database; An instance object is embedded with configuration information to create multiple data sets and/or indexes corresponding to multiple data sets.

可选地,配置模块701还用于:通过目标类型数据库的原生控制命令创建第二实例对象,其中,第二实例对象用于连接目标类型数据库;通过第二实例对象获取目标类型数据库的第三实例对象;通过第三实例对象获取目标类型数据库的目标集合对象;通过目标集合对象植入配置信息,以创建多个数据集合和多个数据集合对应的索引。Optionally, the configuration module 701 is further configured to: create a second instance object through a native control command of the target type database, wherein the second instance object is used to connect to the target type database; obtain the third instance object of the target type database through the second instance object The instance object; the target collection object of the target type database is obtained through the third instance object; the configuration information is implanted through the target collection object, so as to create multiple data sets and indexes corresponding to the multiple data sets.

可选地,创建模块702还用于:控制目标启动容器执行加载操作过程,并在加载操作完成前的最后一个操作步骤调用配置信息。Optionally, the creation module 702 is further configured to: control the target startup container to execute a loading operation process, and invoke configuration information in the last operation step before the loading operation is completed.

可选地,多个数据集合具有相同的数据结构。Optionally, multiple data sets have the same data structure.

需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.

根据本公开的实施例,本公开还提供了一种电子设备,包括存储器和至少一个处理器,该存储器中存储有计算机指令,该处理器被设置为运行计算机指令以执行上述任一项方法实施例中的步骤。According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, including a memory and at least one processor, where computer instructions are stored in the memory, and the processor is configured to execute the computer instructions to perform any one of the methods described above steps in the example.

可选地,上述电子设备还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。Optionally, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.

可选地,在本公开中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in the present disclosure, the above-mentioned processor may be configured to execute the following steps through a computer program:

S1,在目标启动容器中植入配置信息,其中,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引;S1. Embedding configuration information in the target startup container, wherein the configuration information is used to create multiple data sets of the target type database and/or create corresponding indexes for the multiple data sets during the loading operation of the target startup container;

S2,控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引。S2, the control target starts the container to execute the loading operation process, and invokes the configuration information during the target phase of the loading operation process, so as to create multiple data sets and/or indexes corresponding to the multiple data sets.

可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementation manners, and details are not repeated in this embodiment.

根据本公开的实施例,本公开还提供了一种存储有计算机指令的非瞬时计算机可读存储介质,该非瞬时计算机可读存储介质中存储有计算机指令,其中,该计算机指令被设置为运行时执行上述任一项方法实施例中的步骤。According to an embodiment of the present disclosure, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, the non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are set to run When performing the steps in any one of the above method embodiments.

可选地,在本实施例中,上述非瞬时计算机可读存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the above-mentioned non-transitory computer-readable storage medium may be configured to store a computer program for performing the following steps:

S1,在目标启动容器中植入配置信息,其中,配置信息用于在目标启动容器执行加载操作过程中创建目标类型数据库的多个数据集合和/或为多个数据集合创建对应的索引;S1. Embedding configuration information in the target startup container, wherein the configuration information is used to create multiple data sets of the target type database and/or create corresponding indexes for the multiple data sets during the loading operation of the target startup container;

S2,控制目标启动容器执行加载操作过程,并在加载操作过程的目标阶段调用配置信息,以创建多个数据集合和/或多个数据集合对应的索引。S2, the control target starts the container to execute the loading operation process, and invokes the configuration information during the target phase of the loading operation process, so as to create multiple data sets and/or indexes corresponding to the multiple data sets.

可选地,在本实施例中,上述非瞬时计算机可读存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。Optionally, in this embodiment, the above-mentioned non-transitory computer-readable storage medium may include, but not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any of the above-mentioned any suitable combination. More specific examples of readable storage media would include one or more wire-based electrical connections, portable computer diskettes, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory ( EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

根据本公开的实施例,本公开还提供了一种计算机程序产品。用于实施本公开的音频处理方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。According to an embodiment of the present disclosure, the present disclosure also provides a computer program product. Program codes for implementing the audio processing method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special purpose computer, or other programmable data processing devices, so that the program codes, when executed by the processor or controller, make the functions/functions specified in the flow diagrams and/or block diagrams Action is implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

在本公开的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present disclosure, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

在本公开所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be realized in other ways. Wherein, the device embodiments described above are only illustrative. For example, the division of the units may be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of units or modules may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM)、随机存取存储器(RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the essence of the technical solution of the present disclosure or the part that contributes to the related technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. Several instructions are included to make a computer device (which may be a personal computer, server or network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present disclosure. The aforementioned storage media include: various media capable of storing program codes such as U disk, read-only memory (ROM), random access memory (RAM), removable hard disk, magnetic disk or optical disk.

以上所述仅是本公开的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本公开原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本公开的保护范围。The above descriptions are only preferred implementations of the present disclosure. It should be pointed out that those skilled in the art can make some improvements and modifications without departing from the principles of the present disclosure. These improvements and modifications are also It should be regarded as the protection scope of the present disclosure.

Claims (10)

1. A data processing method, comprising:
implanting configuration information in a target launch container, wherein the configuration information is used for creating a plurality of data sets of a target type database and/or creating corresponding indexes for the plurality of data sets in the process of loading operation of the target launch container;
controlling the target starting container to execute the loading operation process, and calling the configuration information in a target stage of the loading operation process to create the multiple data sets and/or indexes corresponding to the multiple data sets;
wherein implanting the configuration information in the target launch container comprises: implanting the configuration information during the execution of the loading operation by the target boot container;
wherein implanting the configuration information during execution of the loading operation by the target boot container comprises: implanting the configuration information in the target boot container based on an instance object provided by the target boot container during execution of the loading operation by the target boot container; or, in the process of executing the loading operation by the target starting container, implanting the configuration information in the target starting container based on a native mode of the target type database, wherein the native mode is used for representing that a native control command of the target type database is adopted to perform a control operation on the target type database;
wherein the plurality of data sets have the same data structure.
2. The method of claim 1, wherein implanting the configuration information in the target launch container based on an instance object provided by the target launch container comprises:
initializing a first instance object, wherein the first instance object is provided by the target launch container, and the bottom layer of the first instance object is connected with the target type database;
and implanting the configuration information through the initialized first instance object to create the multiple data sets and/or indexes corresponding to the multiple data sets.
3. The method of claim 1, wherein implanting the configuration information in the target launch container based on a native manner of the target type database comprises:
creating a second instance object through a native control command of the target type database, wherein the second instance object is used for connecting with the target type database;
acquiring a third instance object of the target type database through the second instance object;
acquiring a target set object of the target type database through the third instance object;
and implanting the configuration information through the target set object to create the plurality of data sets and/or indexes corresponding to the plurality of data sets.
4. The method of claim 1, wherein controlling the target boot container to perform the load operation procedure and invoking the configuration information at the target stage comprises:
and controlling the target starting container to execute the loading operation process, and calling the configuration information in the last operation step before the loading operation is completed.
5. A data processing apparatus comprising:
the configuration module is used for implanting configuration information into the target starting container, wherein the configuration information is used for creating a plurality of data sets of a target type database and/or creating corresponding indexes for the plurality of data sets in the process of loading operation of the target starting container;
the creating module is used for controlling the target starting container to execute the loading operation process and calling the configuration information in a target stage of the loading operation process so as to create the data sets and/or indexes corresponding to the data sets;
wherein the configuration module is further configured to: implanting the configuration information during the execution of the loading operation by the target boot container;
wherein the configuration module is further configured to: implanting the configuration information in the target boot container based on an instance object provided by the target boot container during execution of the loading operation by the target boot container; or, in the process of executing the loading operation by the target starting container, implanting the configuration information in the target starting container based on a native mode of the target type database, wherein the native mode is used for representing that a native control command of the target type database is adopted to perform a control operation on the target type database;
wherein the plurality of data sets have the same data structure.
6. The apparatus of claim 5, wherein the configuration module is further to:
initializing a first instance object, wherein the first instance object is provided by the target launch container, and the bottom layer of the first instance object is connected with the target type database;
and implanting the configuration information through the initialized first instance object to create the multiple data sets and/or indexes corresponding to the multiple data sets.
7. The apparatus of claim 5, wherein the configuration module is further to:
creating a second instance object through a native control command of the target type database, wherein the second instance object is used for connecting with the target type database;
acquiring a third instance object of the target type database through the second instance object;
acquiring a target set object of the target type database through the third instance object;
and implanting the configuration information through the target set object to create the plurality of data sets and/or indexes corresponding to the plurality of data sets.
8. The apparatus of claim 5, wherein the creation module is further to:
and controlling the target starting container to execute the loading operation process, and calling the configuration information in the last operation step before the loading operation is completed.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
CN202111365228.7A 2021-11-17 2021-11-17 Data processing method, device, electronic device and storage medium Active CN114064148B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111365228.7A CN114064148B (en) 2021-11-17 2021-11-17 Data processing method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111365228.7A CN114064148B (en) 2021-11-17 2021-11-17 Data processing method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN114064148A CN114064148A (en) 2022-02-18
CN114064148B true CN114064148B (en) 2023-09-01

Family

ID=80277694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111365228.7A Active CN114064148B (en) 2021-11-17 2021-11-17 Data processing method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114064148B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109814881A (en) * 2017-11-21 2019-05-28 北京京东尚科信息技术有限公司 Method and apparatus for disposing data-base cluster
CN110968565A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Database creation method and system
CN111651248A (en) * 2020-04-29 2020-09-11 中国平安财产保险股份有限公司 Scheduled task execution method, device, electronic device and storage medium
CN111796838A (en) * 2020-06-30 2020-10-20 中国工商银行股份有限公司 MPP database automatic deployment method and device
CN112783859A (en) * 2021-01-08 2021-05-11 河北志晟信息技术股份有限公司 Lightweight concurrent migration method for database
CN113051266A (en) * 2019-12-27 2021-06-29 浙江大搜车软件技术有限公司 Data processing method, data processing device, computer readable storage medium and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7478112B2 (en) * 2004-12-16 2009-01-13 International Business Machines Corporation Method and apparatus for initializing data propagation execution for large database replication

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109814881A (en) * 2017-11-21 2019-05-28 北京京东尚科信息技术有限公司 Method and apparatus for disposing data-base cluster
CN110968565A (en) * 2018-09-30 2020-04-07 北京国双科技有限公司 Database creation method and system
CN113051266A (en) * 2019-12-27 2021-06-29 浙江大搜车软件技术有限公司 Data processing method, data processing device, computer readable storage medium and computer equipment
CN111651248A (en) * 2020-04-29 2020-09-11 中国平安财产保险股份有限公司 Scheduled task execution method, device, electronic device and storage medium
CN111796838A (en) * 2020-06-30 2020-10-20 中国工商银行股份有限公司 MPP database automatic deployment method and device
CN112783859A (en) * 2021-01-08 2021-05-11 河北志晟信息技术股份有限公司 Lightweight concurrent migration method for database

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李纪伟 ; 段中帅 ; 王顺晔 ; .非结构化数据库MongoDB的数据存储.电脑知识与技术.2018,(27),全文. *

Also Published As

Publication number Publication date
CN114064148A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
CN113312037B (en) Data processing method, device, equipment and storage medium applied to micro-service
CN114911465B (en) Operator generation method, device, equipment and storage medium
WO2022148390A1 (en) Methods for deploying, updating and calling smart contract in blockchain
CN113393367B (en) Image processing method, apparatus, device and medium
US20240264804A1 (en) Cloud code development system, method, apparatus, device and storage medium
US9971751B1 (en) Version-specific request processing
CN115098082A (en) Pipeline script generation method, system, device and medium based on Jenkins plug-in
CN114968200A (en) Software development kit assembly method, related device and computer program product
CN114416295A (en) Application control method, device, equipment, medium and program product
CN115469887A (en) Release method and device, electronic device and storage medium of cloud-native application
EP4102361A2 (en) Method and apparatus for managing functions of a query engine
CN116149728A (en) CI/CD assembly conversion method and device
CN114116487B (en) Stress testing methods, devices, electronic equipment and storage media
CN112181401A (en) Application construction method and application construction platform
CN113110920B (en) Operation method, device, device and storage medium of blockchain system
CN114064148B (en) Data processing method, device, electronic device and storage medium
CN113680068A (en) Game development engine and Docker interaction method, device and system
CN112860455A (en) Life cycle event processing method and device and electronic equipment
CN117435503A (en) Test tool generation method, test device, test equipment and test medium
CN117056022A (en) RPA task execution method and device, electronic equipment and storage medium
CN116341663A (en) Extension method, device, equipment and medium of deep learning reasoning framework
CN116932147A (en) Streaming job processing method and device, electronic equipment and medium
CN115268982A (en) A system database switching method, system, computer equipment and medium
CN114416179A (en) Program processing method, apparatus, device and storage medium
CN113703805A (en) Upgrading method, system, terminal and storage medium of arm64 architecture virtualization system

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浏览器服务,不要输入任何密码和下载