[go: up one dir, main page]

CN114020629B - Data processing method and device, management platform of test environment and electronic equipment - Google Patents

Data processing method and device, management platform of test environment and electronic equipment Download PDF

Info

Publication number
CN114020629B
CN114020629B CN202111321832.XA CN202111321832A CN114020629B CN 114020629 B CN114020629 B CN 114020629B CN 202111321832 A CN202111321832 A CN 202111321832A CN 114020629 B CN114020629 B CN 114020629B
Authority
CN
China
Prior art keywords
environment
data
task
version
test
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
CN202111321832.XA
Other languages
Chinese (zh)
Other versions
CN114020629A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202111321832.XA priority Critical patent/CN114020629B/en
Publication of CN114020629A publication Critical patent/CN114020629A/en
Application granted granted Critical
Publication of CN114020629B publication Critical patent/CN114020629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3698Environments for analysis, debugging or testing of software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a data processing method and device, a management platform of a test environment and electronic equipment. The processing method comprises the following steps: receiving a service processing request, wherein the service processing request carries an environment identifier of an environment to be processed, responding to the service processing request, inquiring environment information of the environment to be processed from an environment management module, generating a data task of the environment to be processed based on the environment information of the environment to be processed, controlling a task processing module to execute the data task to obtain an execution result, and updating version information of the environment to be processed based on the execution result to complete the service processing request. The invention solves the technical problem of low service processing efficiency caused by the fact that various types of test environments cannot be uniformly managed in the related technology.

Description

数据处理方法及其装置、测试环境的管理平台、电子设备Data processing method and device, test environment management platform, and electronic equipment

技术领域Technical Field

本发明涉及数据处理技术领域,具体而言,涉及一种数据处理方法及其装置、测试环境的管理平台、电子设备。The present invention relates to the field of data processing technology, and in particular to a data processing method and device thereof, a management platform for a test environment, and electronic equipment.

背景技术Background Art

随着DevOps和敏捷软件开发的广泛使用,构建、开发、测试、发布软件变得更加快捷和频繁,因此,需要一种能够有效管理复杂多变的测试环境的管理平台,使得这些测试环境能够兼具灵活性和可靠性,以支撑快捷频繁的软件迭代需求。With the widespread use of DevOps and agile software development, building, developing, testing, and releasing software have become faster and more frequent. Therefore, a management platform is needed that can effectively manage complex and changeable test environments so that these test environments can have both flexibility and reliability to support the needs of fast and frequent software iterations.

相关技术中,建立一种能够有效管理复杂多变的测试环境的管理平台存在如下多个困难:(1)测试环境有复杂的结构,具有多个分支和版本,在DevOps活动中常常需要快速的创建新分支和版本,也常常需要在不同的分支和版本间进行频繁切换;(2)随着微服务的发展,测试数据库随着服务被拆分成多库的形式,而分库作为一个集群也需要随着测试环境快捷方便地整体迁移,因此,给测试环境的管理带来了极大的不便,也使得处理相关业务的效率较低。In the related art, there are several difficulties in establishing a management platform that can effectively manage complex and ever-changing test environments: (1) The test environment has a complex structure with multiple branches and versions. In DevOps activities, it is often necessary to quickly create new branches and versions, and it is also often necessary to frequently switch between different branches and versions. (2) With the development of microservices, the test database is split into multiple databases along with the services, and the sub-databases as a cluster also need to be quickly and conveniently migrated as a whole along with the test environment. Therefore, it brings great inconvenience to the management of the test environment and also makes the efficiency of handling related business low.

针对上述的问题,目前尚未提出有效的解决方案。To address the above-mentioned problems, no effective solution has been proposed yet.

发明内容Summary of the invention

本发明实施例提供了一种数据处理方法及其装置、测试环境的管理平台、电子设备,以至少解决相关技术中无法统一管理各类型测试坏境,导致处理业务的效率较低的技术问题。The embodiments of the present invention provide a data processing method and device thereof, a test environment management platform, and an electronic device, so as to at least solve the technical problem in the related art that various types of test environments cannot be managed uniformly, resulting in low efficiency in processing business.

根据本发明实施例的一个方面,提供了一种数据处理方法,应用于开发环境管理平台中的版本控制模块,所述开发环境管理平台还包括:环境管理模块和任务处理模块,所述数据处理方法包括:接收业务处理请求,其中,所述业务处理请求携带有待处理环境的环境标识;响应所述业务处理请求,向所述环境管理模块查询所述待处理环境的环境信息;基于所述待处理环境的环境信息,生成所述待处理环境的数据任务;控制所述任务处理模块执行所述数据任务,得到执行结果,并基于执行结果更新所述待处理环境的版本信息,完成业务处理请求。According to one aspect of an embodiment of the present invention, there is provided a data processing method, which is applied to a version control module in a development environment management platform, wherein the development environment management platform further includes: an environment management module and a task processing module, and the data processing method includes: receiving a business processing request, wherein the business processing request carries an environment identifier of an environment to be processed; responding to the business processing request, querying the environment management module for environment information of the environment to be processed; generating a data task for the environment to be processed based on the environment information of the environment to be processed; controlling the task processing module to execute the data task, obtaining an execution result, and updating the version information of the environment to be processed based on the execution result to complete the business processing request.

可选地,所述待处理环境的环境类型包括:测试环境和生产环境,若所述待处理环境为测试环境,则所述待处理环境的环境信息包括:测试环境的源数据以及与所述测试环境对应的数据源列表,每个所述测试环境对应有至少一个环境版本,每个环境版本对应有数据源。Optionally, the environment type of the environment to be processed includes: test environment and production environment. If the environment to be processed is a test environment, the environment information of the environment to be processed includes: source data of the test environment and a list of data sources corresponding to the test environment. Each of the test environments corresponds to at least one environment version, and each environment version corresponds to a data source.

可选地,所述业务处理请求的类型包括:创建测试环境版本、切换测试环境版本和生产数据还原。Optionally, the types of the business processing request include: creating a test environment version, switching a test environment version, and restoring production data.

可选地,若所述待处理环境为测试环境且所述业务处理请求的类型为创建测试环境版本,则基于所述待处理环境的环境信息,生成所述待处理环境的数据任务的步骤,包括:基于所述测试环境的环境信息,生成所述测试环境的版本创建任务;控制所述任务处理模块执行所述数据任务,得到执行结果的步骤,包括:控制所述任务处理模块在接收版本创建任务后,根据所述版本创建任务中携带的数据源列表,向所述开发环境管理平台中的数据库操作模块发送测试数据备份请求;基于执行结果更新所述待处理环境的版本信息,完成业务处理请求的步骤,包括:控制所述开发环境管理平台中的数据库操作模块响应所述测试数据备份请求,执行测试数据备份操作,将备份文件保存至数据资源库中;控制所述任务处理模块登记创建的目标版本的数据资源,并更新所述测试环境的版本信息,完成版本创建任务。Optionally, if the environment to be processed is a test environment and the type of the business processing request is to create a test environment version, then based on the environmental information of the environment to be processed, a step of generating a data task for the environment to be processed includes: based on the environmental information of the test environment, generating a version creation task for the test environment; controlling the task processing module to execute the data task and obtaining an execution result includes: after receiving the version creation task, controlling the task processing module to send a test data backup request to the database operation module in the development environment management platform according to the data source list carried in the version creation task; updating the version information of the environment to be processed based on the execution result and completing the business processing request includes: controlling the database operation module in the development environment management platform to respond to the test data backup request, execute a test data backup operation, and save the backup file to the data resource library; controlling the task processing module to register the created target version of the data resources, and update the version information of the test environment to complete the version creation task.

可选地,若所述待处理环境为测试环境且所述业务处理请求的类型为切换测试环境版本,则基于所述待处理环境的环境信息,生成所述待处理环境的数据任务的步骤,包括:基于当前测试环境的环境信息和待切换测试环境的数据资源信息,生成与所述待切换测试环境对应的版本切换任务;控制所述任务处理模块执行所述数据任务,得到执行结果的步骤,包括:控制所述任务处理模块在接收版本切换任务后,根据所述数据资源信息,提取所述当前测试环境的被切换版本的数据资源,并向所述开发环境管理平台中的数据库操作模块发送测试数据还原请求,其中,所述测试数据还原请求携带有数据源列表和所述数据资源信息;基于执行结果更新所述待处理环境的版本信息,完成业务处理请求的步骤,包括:控制所述开发环境管理平台中的数据库操作模块响应所述测试数据还原请求,根据所述测试数据还原请求中的数据源列表和数据资源信息访问待切换数据源,执行测试数据还原操作,将数据还原结果返回所述任务处理模块,并更新所述待切换测试环境的版本信息,完成版本切换任务。Optionally, if the environment to be processed is a test environment and the type of the business processing request is to switch the test environment version, then based on the environment information of the environment to be processed, the step of generating a data task for the environment to be processed includes: based on the environment information of the current test environment and the data resource information of the test environment to be switched, generating a version switching task corresponding to the test environment to be switched; the step of controlling the task processing module to execute the data task and obtaining an execution result includes: after receiving the version switching task, controlling the task processing module to extract the data resources of the switched version of the current test environment according to the data resource information, and sending a test data restoration request to the database operation module in the development environment management platform, wherein the test data restoration request carries a data source list and the data resource information; the step of updating the version information of the environment to be processed based on the execution result and completing the business processing request includes: controlling the database operation module in the development environment management platform to respond to the test data restoration request, accessing the data source to be switched according to the data source list and data resource information in the test data restoration request, executing the test data restoration operation, returning the data restoration result to the task processing module, and updating the version information of the test environment to be switched to complete the version switching task.

可选地,根据所述数据资源信息,提取所述当前测试环境的被切换版本的数据资源的步骤,包括:根据所述数据资源信息,向所述开发环境管理平台中的数据资源管理模块发送资源提取请求,以提取出所述当前测试环境的被切换版本的数据资源。Optionally, the step of extracting the switched version of data resources of the current test environment according to the data resource information includes: sending a resource extraction request to the data resource management module in the development environment management platform according to the data resource information to extract the switched version of data resources of the current test environment.

可选地,若所述待处理环境为测试环境,则在接收业务处理请求之后,所述数据处理方法还包括:向所述开发环境管理平台中的数据资源管理模块发送数据源导入请求,其中,所述数据源导入请求用于将所述测试环境的环境数据资源导入至数据资源库中。Optionally, if the environment to be processed is a test environment, then after receiving the business processing request, the data processing method also includes: sending a data source import request to a data resource management module in the development environment management platform, wherein the data source import request is used to import the environmental data resources of the test environment into a data resource library.

可选地,若所述待处理环境为测试环境且所述业务处理请求的类型为生产数据还原,基于所述待处理环境的环境信息,生成所述待处理环境的数据任务的步骤,包括:创建目标生产数据版本,并将所述目标生产数据版本与所述数据资源库中的环境数据资源建立关联关系;基于所述目标生产数据版本的版本信息,向任务处理模块发送生产数据还原请求;基于执行结果更新所述待处理环境的版本信息,完成业务处理请求的步骤,包括:控制数据库操作模块响应所述生产数据还原请求,根据生产数据资源和所述版本信息访问数据源,执行生产数据还原现场操作,得到执行结果;将所述执行结果返回任务处理模块,并更新所述测试环境的版本信息,完成生产数据还原任务。Optionally, if the environment to be processed is a test environment and the type of the business processing request is production data restoration, the step of generating a data task for the environment to be processed based on the environmental information of the environment to be processed includes: creating a target production data version, and establishing an association between the target production data version and the environmental data resources in the data resource library; sending a production data restoration request to the task processing module based on the version information of the target production data version; updating the version information of the environment to be processed based on the execution result, and completing the step of the business processing request includes: controlling the database operation module to respond to the production data restoration request, accessing the data source according to the production data resources and the version information, performing the production data restoration on-site operation, and obtaining the execution result; returning the execution result to the task processing module, and updating the version information of the test environment to complete the production data restoration task.

可选地,控制所述任务处理模块执行所述数据任务,得到执行结果的步骤,包括:控制所述任务处理模块在接收到所述数据任务后,将所述数据任务发送至任务缓冲池;根据所述任务缓冲池的任务排队顺序,执行每个所述数据任务。Optionally, the step of controlling the task processing module to execute the data task and obtain the execution result includes: controlling the task processing module to send the data task to the task buffer pool after receiving the data task; and executing each of the data tasks according to the task queuing order of the task buffer pool.

根据本发明实施例的另一方面,还提供了一种测试环境的管理平台,包括:环境管理模块,用于管理测试环境或者生产的环境信息;版本控制模块,用于执行上述任意一项所述的数据处理方法;数据库操作模块,用于与所述测试环境对应的数据资源库的库操作,其中,所述库操作包括下述至少之一:数据资源库的库连接、数据备份、数据还原;任务处理模块,用于执行业务处理请求,并返回执行结果;数据资源管理模块,用于管理测试环境下各环境版本下的测试数据,并完成测试环境的版本切换任务。According to another aspect of an embodiment of the present invention, a test environment management platform is also provided, including: an environment management module for managing environment information of a test environment or production; a version control module for executing any of the data processing methods described above; a database operation module for library operations of a data resource library corresponding to the test environment, wherein the library operations include at least one of the following: library connection, data backup, and data restoration of the data resource library; a task processing module for executing business processing requests and returning execution results; a data resource management module for managing test data under each environment version under the test environment and completing version switching tasks of the test environment.

可选地,所述任务处理模块包括:任务缓冲池,所述任务缓冲池用于调度待处理的多个数据任务。Optionally, the task processing module includes: a task buffer pool, and the task buffer pool is used to schedule multiple data tasks to be processed.

根据本发明实施例的另一方面,还提供了一种数据处理装置,应用于开发环境管理平台中的版本控制模块,所述开发环境管理平台还包括:环境管理模块和任务处理模块,所述数据处理装置包括:接收单元,用于接收业务处理请求,其中,所述业务处理请求携带有待处理环境的环境标识;查询单元,用于响应所述业务处理请求,向所述环境管理模块查询所述待处理环境的环境信息;生成单元,用于基于所述待处理环境的环境信息,生成所述待处理环境的数据任务;控制单元,用于控制所述任务处理模块执行所述数据任务,得到执行结果,并基于执行结果更新所述待处理环境的版本信息,完成业务处理请求。According to another aspect of an embodiment of the present invention, there is also provided a data processing device, which is applied to a version control module in a development environment management platform. The development environment management platform also includes: an environment management module and a task processing module. The data processing device includes: a receiving unit, which is used to receive a business processing request, wherein the business processing request carries an environment identifier of the environment to be processed; a query unit, which is used to respond to the business processing request and query the environment management module for the environment information of the environment to be processed; a generation unit, which is used to generate a data task for the environment to be processed based on the environment information of the environment to be processed; and a control unit, which is used to control the task processing module to execute the data task, obtain an execution result, and update the version information of the environment to be processed based on the execution result to complete the business processing request.

可选地,所述待处理环境的环境类型包括:测试环境和生产环境,若所述待处理环境为测试环境,则所述待处理环境的环境信息包括:测试环境的源数据以及与所述测试环境对应的数据源列表,每个所述测试环境对应有至少一个环境版本,每个环境版本对应有数据源。Optionally, the environment type of the environment to be processed includes: test environment and production environment. If the environment to be processed is a test environment, the environment information of the environment to be processed includes: source data of the test environment and a list of data sources corresponding to the test environment. Each of the test environments corresponds to at least one environment version, and each environment version corresponds to a data source.

可选地,所述业务处理请求的类型包括:创建测试环境版本、切换测试环境版本和生产数据还原。Optionally, the types of the business processing request include: creating a test environment version, switching a test environment version, and restoring production data.

可选地,所述数据处理装置包括:第一生成模块,用于若所述待处理环境为测试环境且所述业务处理请求的类型为创建测试环境版本,则基于所述待处理环境的环境信息,生成所述待处理环境的数据任务的步骤,包括:基于所述测试环境的环境信息,生成所述测试环境的版本创建任务;控制所述任务处理模块执行所述数据任务,得到执行结果的步骤,包括:第一发送模块,用于控制所述任务处理模块在接收版本创建任务后,根据所述版本创建任务中携带的数据源列表,向所述开发环境管理平台中的数据库操作模块发送测试数据备份请求;基于执行结果更新所述待处理环境的版本信息,完成业务处理请求的步骤,包括:第一保存模块,用于控制所述开发环境管理平台中的数据库操作模块响应所述测试数据备份请求,执行测试数据备份操作,将备份文件保存至数据资源库中;第一更新模块,用于控制所述任务处理模块登记创建的目标版本的数据资源,并更新所述测试环境的版本信息,完成版本创建任务。Optionally, the data processing device includes: a first generating module, which is used to generate a data task for the environment to be processed based on the environment information of the environment to be processed if the environment to be processed is a test environment and the type of the business processing request is to create a test environment version, including: generating a version creation task for the test environment based on the environment information of the test environment; controlling the task processing module to execute the data task and obtain an execution result, including: a first sending module, which is used to control the task processing module to send a test data backup request to the database operation module in the development environment management platform according to the data source list carried in the version creation task after receiving the version creation task; updating the version information of the environment to be processed based on the execution result to complete the business processing request, including: a first saving module, which is used to control the database operation module in the development environment management platform to respond to the test data backup request, perform a test data backup operation, and save the backup file to the data resource library; a first updating module, which is used to control the task processing module to register the data resources of the target version created, and update the version information of the test environment to complete the version creation task.

可选地,所述数据处理装置包括:第二生成模块,用于若所述待处理环境为测试环境且所述业务处理请求的类型为切换测试环境版本,则基于当前测试环境的环境信息和待切换测试环境的数据资源信息,生成与所述待切换测试环境对应的版本切换任务;第一提取模块,用于控制所述任务处理模块在接收版本切换任务后,根据所述数据资源信息,提取所述当前测试环境的被切换版本的数据资源,并向所述开发环境管理平台中的数据库操作模块发送测试数据还原请求,其中,所述测试数据还原请求携带有数据源列表和所述数据资源信息;第二更新模块,用于控制所述开发环境管理平台中的数据库操作模块响应所述测试数据还原请求,根据所述测试数据还原请求中的数据源列表和数据资源信息访问待切换数据源,执行测试数据还原操作,将数据还原结果返回所述任务处理模块,并更新所述待切换测试环境的版本信息,完成版本切换任务。Optionally, the data processing device includes: a second generation module, which is used to generate a version switching task corresponding to the test environment to be switched based on the environment information of the current test environment and the data resource information of the test environment to be switched if the environment to be processed is a test environment and the type of the business processing request is to switch the test environment version; a first extraction module, which is used to control the task processing module to extract the data resources of the switched version of the current test environment according to the data resource information after receiving the version switching task, and send a test data restoration request to the database operation module in the development environment management platform, wherein the test data restoration request carries a data source list and the data resource information; a second update module, which is used to control the database operation module in the development environment management platform to respond to the test data restoration request, access the data source to be switched according to the data source list and data resource information in the test data restoration request, perform a test data restoration operation, return the data restoration result to the task processing module, and update the version information of the test environment to be switched to complete the version switching task.

可选地,所述第一提取模块包括:第一提取子模块,用于根据所述数据资源信息,向所述开发环境管理平台中的数据资源管理模块发送资源提取请求,以提取出所述当前测试环境的被切换版本的数据资源。Optionally, the first extraction module includes: a first extraction submodule, configured to send a resource extraction request to a data resource management module in the development environment management platform according to the data resource information, so as to extract the switched version of the data resource of the current test environment.

可选地,所述数据处理装置还包括:第一导入模块,用于若所述待处理环境为测试环境,则在接收业务处理请求之后,向所述开发环境管理平台中的数据资源管理模块发送数据源导入请求,其中,所述数据源导入请求用于将所述测试环境的环境数据资源导入至数据资源库中。Optionally, the data processing device also includes: a first import module, which is used to send a data source import request to the data resource management module in the development environment management platform after receiving a business processing request if the environment to be processed is a test environment, wherein the data source import request is used to import the environmental data resources of the test environment into the data resource library.

可选地,所述数据处理装置包括:第一创建模块,用于若所述待处理环境为测试环境且所述业务处理请求的类型为生产数据还原,创建目标生产数据版本,并将所述目标生产数据版本与所述数据资源库中的环境数据资源建立关联关系;第二发送模块,用于基于所述目标生产数据版本的版本信息,向任务处理模块发送生产数据还原请求;第三更新模块,用于控制数据库操作模块响应所述生产数据还原请求,根据生产数据资源和所述版本信息访问数据源,执行生产数据还原现场操作,得到执行结果;将所述执行结果返回任务处理模块,并更新所述测试环境的版本信息,完成生产数据还原任务。Optionally, the data processing device includes: a first creation module, which is used to create a target production data version if the environment to be processed is a test environment and the type of the business processing request is production data restoration, and to establish an association relationship between the target production data version and the environmental data resource in the data resource library; a second sending module, which is used to send a production data restoration request to the task processing module based on the version information of the target production data version; a third update module, which is used to control the database operation module to respond to the production data restoration request, access the data source according to the production data resources and the version information, perform the production data restoration on-site operation, and obtain the execution result; return the execution result to the task processing module, and update the version information of the test environment to complete the production data restoration task.

可选地,所述控制单元包括:第三发送模块,用于控制所述任务处理模块在接收到所述数据任务后,将所述数据任务发送至任务缓冲池;第一执行模块,用于根据所述任务缓冲池的任务排队顺序,执行每个所述数据任务。Optionally, the control unit includes: a third sending module, used to control the task processing module to send the data task to the task buffer pool after receiving the data task; and a first execution module, used to execute each of the data tasks according to the task queuing order of the task buffer pool.

根据本发明实施例的另一方面,还提供了一种电子设备,包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行上述任意一项所述的数据处理方法。According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned data processing methods by executing the executable instructions.

根据本发明实施例的另一方面,还提供了一种计算机可读存储介质,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行上述任意一项所述的数据处理方法。According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the data processing methods described above.

本公开中,提供了支持多分支多版本多库的开发环境管理平台(或者测试数据环境管理平台),通过对各应用下多个分支多个版本涉及多数据库的环境对应的测试数据进行统一管理,适用于测试数据版本的制作和还原,以及应用内不同环境间版本切换等功能场景。此外,本公开还具有生产数据还原现场的功能。In the present disclosure, a development environment management platform (or test data environment management platform) supporting multiple branches, multiple versions and multiple libraries is provided. By uniformly managing the test data corresponding to the environments of multiple branches, multiple versions and multiple databases under each application, it is suitable for functional scenarios such as the production and restoration of test data versions, and the version switching between different environments within the application. In addition, the present disclosure also has the function of restoring production data on site.

在本公开中,接收业务处理请求,其中,业务处理请求携带有待处理环境的环境标识,响应业务处理请求,向环境管理模块查询待处理环境的环境信息,基于待处理环境的环境信息,生成待处理环境的数据任务,控制任务处理模块执行数据任务,得到执行结果,并基于执行结果更新待处理环境的版本信息,完成业务处理请求。在本申请中,利用开发环境管理平台,对待处理环境的环境信息进行统一管理(能够实现的管理内容包括但不限于:测试数据版本的制作和还原、应用内不同环境间版本切换、生产数据还原),适用于处理多环境下的业务,提高处理业务的效率,进而解决了相关技术中无法统一管理各类型测试坏境,导致处理业务的效率较低的技术问题。In the present disclosure, a business processing request is received, wherein the business processing request carries an environment identifier of an environment to be processed, a business processing request is responded to, the environment information of the environment to be processed is queried from the environment management module, a data task of the environment to be processed is generated based on the environment information of the environment to be processed, a task processing module is controlled to execute the data task, an execution result is obtained, and the version information of the environment to be processed is updated based on the execution result to complete the business processing request. In the present application, a development environment management platform is used to uniformly manage the environment information of the environment to be processed (the management content that can be realized includes but is not limited to: the production and restoration of test data versions, the version switching between different environments within the application, and the restoration of production data), which is suitable for processing businesses in multiple environments and improving the efficiency of processing businesses, thereby solving the technical problem that the related technology cannot uniformly manage various types of test environments, resulting in low efficiency in processing businesses.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

图1是根据本发明实施例的一种可选的数据处理方法的流程图;FIG1 is a flow chart of an optional data processing method according to an embodiment of the present invention;

图2是根据本发明实施例的一种可选的处理创建测试环境版本任务的示意图;FIG2 is a schematic diagram of an optional process for creating a test environment version task according to an embodiment of the present invention;

图3是根据本发明实施例的一种可选的处理切换测试环境版本任务的示意图;FIG3 is a schematic diagram of an optional task of processing switching test environment versions according to an embodiment of the present invention;

图4是根据本发明实施例的一种可选的处理生产数据还原任务的示意图;FIG4 is a schematic diagram of an optional processing production data restoration task according to an embodiment of the present invention;

图5是根据本发明实施例的一种可选的数据处理装置的示意图。FIG. 5 is a schematic diagram of an optional data processing device according to an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

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

为便于本领域技术人员理解本发明,下面对本发明各实施例中涉及的部分术语或名词做出解释:To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:

DevOps:一组过程,方法和系统的统称,用于促进开发(应用程序/软件工程)、技术运营和质量保障(QA)部门之间的沟通、协作与整合。DevOps: A collective name for a set of processes, methods, and systems that facilitate communication, collaboration, and integration between development (application/software engineering), technical operations, and quality assurance (QA) departments.

敏捷软件开发:一种能够应付快速变化需求的软件开发能力,注重程序员团队与业务专家之间的紧密协作、面对面沟通,频繁交付新的软件版本,紧凑而自我组织型的团队,能够很好的适应需求变化的代码编写和团队组织方法,也更注重软件开发过程中的作用。Agile software development: a software development capability that can cope with rapidly changing requirements, focusing on close collaboration and face-to-face communication between programmer teams and business experts, frequent delivery of new software versions, compact and self-organizing teams, code writing and team organization methods that can adapt well to changing requirements, and also pay more attention to the role of the software development process.

本发明下述各实施例可应用于各种复杂多变的测试环境的管理平台/系统/应用,或者处理复杂多变的测试环境下的业务的场景下,本发明通过支持多分支多版本多库的测试数据环境管理方法,能够对各应用下多个分支多个版本以及涉及多数据库的环境所对应的测试数据进行统一管理,适用于测试数据版本的制作和还原,以及相同应用内不同环境间版本切换等功能场景,同时,还具有生产数据还原现场的功能。The following embodiments of the present invention can be applied to management platforms/systems/applications of various complex and changeable test environments, or to scenarios of processing business under complex and changeable test environments. The present invention can uniformly manage the test data corresponding to multiple branches, multiple versions and environments involving multiple databases under each application by supporting a test data environment management method for multiple branches, multiple versions and multiple libraries. It is suitable for functional scenarios such as the production and restoration of test data versions, as well as version switching between different environments in the same application. At the same time, it also has the function of restoring production data on site.

实施例一Embodiment 1

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

图1是根据本发明实施例的一种可选的数据处理方法的流程图,如图1所示,该方法包括如下步骤:FIG. 1 is a flow chart of an optional data processing method according to an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:

步骤S102,接收业务处理请求,其中,业务处理请求携带有待处理环境的环境标识。Step S102: receiving a business processing request, wherein the business processing request carries an environment identifier of an environment to be processed.

步骤S104,响应业务处理请求,向环境管理模块查询待处理环境的环境信息。Step S104, responding to the business processing request, querying the environment management module for the environment information of the environment to be processed.

步骤S106,基于待处理环境的环境信息,生成待处理环境的数据任务。Step S106: Generate data tasks for the environment to be processed based on the environment information of the environment to be processed.

步骤S108,控制任务处理模块执行数据任务,得到执行结果,并基于执行结果更新待处理环境的版本信息,完成业务处理请求。Step S108, controlling the task processing module to execute the data task, obtaining the execution result, and updating the version information of the environment to be processed based on the execution result to complete the business processing request.

通过上述步骤,可以接收业务处理请求,其中,业务处理请求携带有待处理环境的环境标识,响应业务处理请求,向环境管理模块查询待处理环境的环境信息,基于待处理环境的环境信息,生成待处理环境的数据任务,控制任务处理模块执行数据任务,得到执行结果,并基于执行结果更新待处理环境的版本信息,完成业务处理请求。在本发明实施例中,利用开发环境管理平台,对待处理环境的环境信息进行统一管理,适用于处理多环境下的业务,提高处理业务的效率,进而解决了相关技术中无法统一管理各类型测试坏境,导致处理业务的效率较低的技术问题。Through the above steps, a business processing request can be received, wherein the business processing request carries the environment identifier of the environment to be processed, responds to the business processing request, queries the environment information of the environment to be processed from the environment management module, generates data tasks of the environment to be processed based on the environment information of the environment to be processed, controls the task processing module to execute the data tasks, obtains the execution result, and updates the version information of the environment to be processed based on the execution result to complete the business processing request. In an embodiment of the present invention, the development environment management platform is used to uniformly manage the environment information of the environment to be processed, which is suitable for processing businesses in multiple environments and improving the efficiency of processing businesses, thereby solving the technical problem that the related technology cannot uniformly manage various types of test environments, resulting in low efficiency in processing businesses.

下面结合上述各步骤对本发明实施例进行详细说明。The embodiment of the present invention is described in detail below in combination with the above steps.

本发明实施例应用于开发环境管理平台中的版本控制模块,其中,开发环境管理平台(或测试环境)的管理平台,包括:环境管理模块,用于管理测试环境或者生产的环境信息;版本控制模块,用于执行上述任意一项的数据处理方法;数据库操作模块,用于与测试环境对应的数据资源库的库操作,其中,库操作包括下述至少之一:数据资源库的库连接、数据备份、数据还原;任务处理模块,用于执行业务处理请求,并返回执行结果;数据资源管理模块,用于管理测试环境下各环境版本下的测试数据,并完成测试环境的版本切换任务。The embodiment of the present invention is applied to a version control module in a development environment management platform, wherein the management platform of the development environment management platform (or test environment) includes: an environment management module for managing environment information of a test environment or production; a version control module for executing any one of the above data processing methods; a database operation module for library operations of a data resource library corresponding to the test environment, wherein the library operations include at least one of the following: library connection, data backup, and data restoration of the data resource library; a task processing module for executing business processing requests and returning execution results; a data resource management module for managing test data under each environment version under the test environment and completing version switching tasks of the test environment.

可选的,任务处理模块包括:任务缓冲池,任务缓冲池用于调度待处理的多个数据任务。Optionally, the task processing module includes: a task buffer pool, which is used to schedule multiple data tasks to be processed.

步骤S102,接收业务处理请求,其中,业务处理请求携带有待处理环境的环境标识。Step S102: receiving a business processing request, wherein the business processing request carries an environment identifier of an environment to be processed.

在本发明实施例中,可通过版本控制模块接收业务处理请求,其中,版本控制模块是开发环境管理平台中的核心处理模块,负责对测试环境进行创建版本、版本切换等业务,业务处理请求携带有待处理环境的环境标识,其环境标识用于识别相应的环境信息。In an embodiment of the present invention, a business processing request can be received through a version control module, wherein the version control module is a core processing module in a development environment management platform, and is responsible for performing services such as creating versions and switching versions for a test environment. The business processing request carries an environment identifier of the environment to be processed, and the environment identifier is used to identify corresponding environment information.

可选的,待处理环境的环境类型包括:测试环境和生产环境,若待处理环境为测试环境,则待处理环境的环境信息包括:测试环境的源数据以及与测试环境对应的数据源列表,每个测试环境对应有至少一个环境版本,每个环境版本对应有数据源。Optionally, the environment types of the environment to be processed include: test environment and production environment. If the environment to be processed is a test environment, the environment information of the environment to be processed includes: source data of the test environment and a list of data sources corresponding to the test environment. Each test environment corresponds to at least one environment version, and each environment version corresponds to a data source.

在本发明实施例中,每个测试环境可具有多个环境版本,每个环境版本都对应有相应的数据源,而生产环境中的环境信息不能随意更改,可将生产环境的数据源还原/复制到测试环境中,以进行分析处理。In an embodiment of the present invention, each test environment may have multiple environment versions, each environment version corresponds to a corresponding data source, and the environmental information in the production environment cannot be changed at will. The data source of the production environment can be restored/copied to the test environment for analysis and processing.

可选的,业务处理请求的类型包括:创建测试环境版本、切换测试环境版本和生产数据还原。Optionally, the types of business processing requests include: creating a test environment version, switching a test environment version, and restoring production data.

在本发明实施例中,可以有创建测试环境版本、切换测试环境版本、生产数据还原现场三个业务使用场景(即业务处理请求的类型可以包括创建测试环境版本、切换测试环境版本和生产数据还原)。In an embodiment of the present invention, there may be three business usage scenarios: creating a test environment version, switching a test environment version, and restoring production data on site (i.e., the types of business processing requests may include creating a test environment version, switching a test environment version, and restoring production data).

步骤S104,响应业务处理请求,向环境管理模块查询待处理环境的环境信息。Step S104, responding to the business processing request, querying the environment management module for the environment information of the environment to be processed.

在本发明实施例中,可以根据待处理环境的不同类型,查询不同的环境信息,如果待处理环境为测试环境,则可以向环境管理模块查询当前测试环境源数据和测试环境对应的数据源列表,或者向环境管理模块查询当前测试环境源数据和测试环境对应的数据源列表,以及待切换测试环境的数据资源信息;如果待处理环境为生产环境,则向环境管理模块查询生产环境所对应的环境信息,其中,环境管理模块管理测试环境的相关信息,包括但不限于:每个环境对应的每个分支/版本,每个分支/版本对应的数据源等。In an embodiment of the present invention, different environmental information can be queried according to different types of environments to be processed. If the environment to be processed is a test environment, the environment management module can be queried for the current test environment source data and the data source list corresponding to the test environment, or the environment management module can be queried for the current test environment source data and the data source list corresponding to the test environment, as well as the data resource information of the test environment to be switched; if the environment to be processed is a production environment, the environment management module is queried for the environment information corresponding to the production environment, wherein the environment management module manages relevant information of the test environment, including but not limited to: each branch/version corresponding to each environment, the data source corresponding to each branch/version, etc.

步骤S106,基于待处理环境的环境信息,生成待处理环境的数据任务。Step S106: Generate data tasks for the environment to be processed based on the environment information of the environment to be processed.

在本发明实施例中,版本控制模块可基于测试环境信息或者待切换测试环境的数据资源信息(即基于待处理环境的环境信息),生成对应环境的创建版本异步任务或者生成对应环境的切换版本异步任务(即生成待处理环境的数据任务),也可基于生产环境所对应的环境信息,生成还原生产环境异步任务。In an embodiment of the present invention, the version control module can generate a create version asynchronous task for the corresponding environment or a switch version asynchronous task for the corresponding environment (i.e., generate a data task for the environment to be processed) based on the test environment information or the data resource information of the test environment to be switched (i.e., based on the environment information of the environment to be processed), and can also generate an asynchronous task to restore the production environment based on the environment information corresponding to the production environment.

步骤S108,控制任务处理模块执行数据任务,得到执行结果,并基于执行结果更新待处理环境的版本信息,完成业务处理请求。Step S108, controlling the task processing module to execute the data task, obtaining the execution result, and updating the version information of the environment to be processed based on the execution result to complete the business processing request.

在本发明实施例中,在版本控制模块生成数据任务(包括创建版本异步任务、切换版本异步任务或者还原生产环境异步任务等)后,可以将数据任务交给任务处理模块执行,并向前端返回请求结果(即得到执行结果),基于执行结果更新待处理环境的版本信息,完成业务处理请求(包括版本创建任务、版本切换任务或者生产数据还原现场任务等),其中,任务处理模块用于接收版本控制模块发送的创建版本、版本切换任务或者生产数据还原现场任务等,执行并返回执行结果。In an embodiment of the present invention, after the version control module generates a data task (including a version creation asynchronous task, a version switching asynchronous task, or a production environment restoration asynchronous task, etc.), the data task can be handed over to the task processing module for execution, and the request result (i.e., the execution result) is returned to the front end. The version information of the environment to be processed is updated based on the execution result to complete the business processing request (including a version creation task, a version switching task, or a production data restoration on-site task, etc.), wherein the task processing module is used to receive the version creation task, version switching task, or production data restoration on-site task, etc. sent by the version control module, execute and return the execution result.

1),处理创建测试环境版本任务1) Process the task of creating a test environment version

本发明实施例中,若待处理环境为测试环境且业务处理请求的类型为创建测试环境版本,则基于待处理环境的环境信息,生成待处理环境的数据任务的步骤,包括:基于测试环境的环境信息,生成测试环境的版本创建任务;控制任务处理模块执行数据任务,得到执行结果的步骤,包括:控制任务处理模块在接收版本创建任务后,根据版本创建任务中携带的数据源列表,向开发环境管理平台中的数据库操作模块发送测试数据备份请求;基于执行结果更新待处理环境的版本信息,完成业务处理请求的步骤,包括:控制开发环境管理平台中的数据库操作模块响应测试数据备份请求,执行测试数据备份操作,将备份文件保存至数据资源库中;控制任务处理模块登记创建的目标版本的数据资源,并更新测试环境的版本信息,完成版本创建任务。In an embodiment of the present invention, if the environment to be processed is a test environment and the type of the business processing request is to create a test environment version, then based on the environment information of the environment to be processed, a step of generating a data task for the environment to be processed includes: based on the environment information of the test environment, generating a version creation task for the test environment; controlling the task processing module to execute the data task and obtaining the execution result includes: after receiving the version creation task, the task processing module sends a test data backup request to the database operation module in the development environment management platform according to the data source list carried in the version creation task; updating the version information of the environment to be processed based on the execution result and completing the business processing request includes: controlling the database operation module in the development environment management platform to respond to the test data backup request, execute the test data backup operation, and save the backup file to the data resource library; controlling the task processing module to register the data resources of the created target version, and update the version information of the test environment to complete the version creation task.

在本发明实施例中,图2是根据本发明实施例的一种可选的处理创建测试环境版本任务的示意图,如图2所示,包括:环境管理模块、版本控制模块、数据库操作模块、任务处理模块以及数据资源管理模块,并具有查询环境信息,插入创建版本异步任务,执行测试数据备份操作,登记当前版本数据资源等四个步骤,具体步骤如下:In an embodiment of the present invention, FIG. 2 is a schematic diagram of an optional processing task of creating a test environment version according to an embodiment of the present invention. As shown in FIG. 2, it includes: an environment management module, a version control module, a database operation module, a task processing module, and a data resource management module, and has four steps of querying environment information, inserting a create version asynchronous task, executing a test data backup operation, and registering the current version data resource. The specific steps are as follows:

(1)查询环境信息(1) Query environmental information

版本控制模块接收创建测试环境版本请求后,向环境管理模块查询环境信息,包括:当前测试环境源数据和测试环境对应的数据源列表等。After receiving the request to create a test environment version, the version control module queries the environment management module for environment information, including: the current test environment source data and a data source list corresponding to the test environment.

(2)插入创建版本异步任务(2) Insert the create version asynchronous task

版本控制模块根据获得的测试环境信息,生成对应环境的创建版本异步任务(即生成测试环境的版本创建任务),并将该创建版本异步任务交给任务处理模块执行,并向前端返回请求结果。The version control module generates a version creation asynchronous task for the corresponding environment (i.e., generates a version creation task for the test environment) based on the obtained test environment information, and sends the version creation asynchronous task to the task processing module for execution, and returns the request result to the front end.

(3)执行测试数据备份操作(3) Perform test data backup operations

任务处理模块在接收创建版本任务(即版本创建任务)后,在缓冲中排队并开始执行后,根据版本创建任务中携带的环境数据源列表信息,向开发环境管理平台中的数据库操作模块发送执行测试数据备份操作请求,直到收到数据操作成功信息,其中,数据库操作模块负责测试环境对应的数据库操作,包括但不限于:测试数据库的连接、测试数据的备份、还原等功能。After receiving the version creation task (i.e., version creation task), the task processing module queues it in the buffer and starts executing it. Then, according to the environment data source list information carried in the version creation task, the task processing module sends a request to execute the test data backup operation to the database operation module in the development environment management platform until the data operation success information is received. Among them, the database operation module is responsible for the database operations corresponding to the test environment, including but not limited to: test database connection, test data backup, restore and other functions.

(4)登记当前版本数据资源(4) Register the current version of data resources

在执行测试数据备份操作后,将备份文件保存到数据资源库中,登记当前版本(即创建的目标版本)数据资源记录,并更新测试环境版本信息,完成版本创建任务。After executing the test data backup operation, the backup file is saved in the data resource library, the current version (ie, the created target version) data resource record is registered, and the test environment version information is updated to complete the version creation task.

2),处理切换测试环境版本任务2) Handle the task of switching the test environment version

本发明实施例中,若待处理环境为测试环境且业务处理请求的类型为切换测试环境版本,则基于待处理环境的环境信息,生成待处理环境的数据任务的步骤,包括:基于当前测试环境的环境信息和待切换测试环境的数据资源信息,生成与待切换测试环境对应的版本切换任务;控制任务处理模块执行数据任务,得到执行结果的步骤,包括:控制任务处理模块在接收版本切换任务后,根据数据资源信息,提取当前测试环境的被切换版本的数据资源,并向开发环境管理平台中的数据库操作模块发送测试数据还原请求,其中,测试数据还原请求携带有数据源列表和数据资源信息;基于执行结果更新待处理环境的版本信息,完成业务处理请求的步骤,包括:控制开发环境管理平台中的数据库操作模块响应测试数据还原请求,根据测试数据还原请求中的数据源列表和数据资源信息访问待切换数据源,执行测试数据还原操作,将数据还原结果返回任务处理模块,并更新待切换测试环境的版本信息,完成版本切换任务。In an embodiment of the present invention, if the environment to be processed is a test environment and the type of the business processing request is to switch the test environment version, then based on the environment information of the environment to be processed, a step of generating a data task for the environment to be processed includes: based on the environment information of the current test environment and the data resource information of the test environment to be switched, generating a version switching task corresponding to the test environment to be switched; controlling the task processing module to execute the data task and obtaining the execution result includes: after receiving the version switching task, the task processing module extracts the data resource of the switched version of the current test environment according to the data resource information, and sends a test data restoration request to the database operation module in the development environment management platform, wherein the test data restoration request carries a data source list and data resource information; updating the version information of the environment to be processed based on the execution result and completing the business processing request includes: controlling the database operation module in the development environment management platform to respond to the test data restoration request, accessing the data source to be switched according to the data source list and data resource information in the test data restoration request, executing the test data restoration operation, returning the data restoration result to the task processing module, and updating the version information of the test environment to be switched to complete the version switching task.

另一种可选的,根据数据资源信息,提取当前测试环境的被切换版本的数据资源的步骤,包括:根据数据资源信息,向开发环境管理平台中的数据资源管理模块发送资源提取请求,以提取出当前测试环境的被切换版本的数据资源。Another optional step of extracting the switched version of data resources of the current test environment based on the data resource information includes: sending a resource extraction request to the data resource management module in the development environment management platform based on the data resource information to extract the switched version of data resources of the current test environment.

在本发明实施例中,图3是根据本发明实施例的一种可选的处理切换测试环境版本任务的示意图,如图3所示,包括:环境管理模块、版本控制模块、数据库操作模块、任务处理模块以及数据资源管理模块,并具有查询环境信息,插入切换版本异步任务,取出当前版本数据资源,执行测试数据还原操作等四个步骤,具体步骤如下:In an embodiment of the present invention, FIG3 is a schematic diagram of an optional processing task of switching test environment versions according to an embodiment of the present invention. As shown in FIG3, it includes: an environment management module, a version control module, a database operation module, a task processing module, and a data resource management module, and has four steps of querying environment information, inserting a switching version asynchronous task, taking out the current version data resource, and performing a test data restoration operation. The specific steps are as follows:

(1)查询环境信息(1) Query environmental information

版本控制模块接收切换测试环境版本请求后,向环境管理模块查询环境信息,包括:当前测试环境源数据和测试环境对应的数据源列表,以及待切换测试环境的数据资源信息等。After receiving the request to switch the test environment version, the version control module queries the environment management module for environment information, including: the current test environment source data and the data source list corresponding to the test environment, as well as the data resource information of the test environment to be switched.

(2)插入切换版本异步任务(2) Insert the asynchronous task of switching versions

版本控制模块根据获得的测试环境信息和数据资源信息(即当前测试环境的环境信息和待切换测试环境的数据资源信息),生成对应环境的切换版本异步任务(即生成与待切换测试环境对应的版本切换任务),并将该切换版本异步任务交给任务处理模块执行,并向前端返回请求结果。The version control module generates a version switching asynchronous task for the corresponding environment (i.e., generates a version switching task corresponding to the test environment to be switched) based on the obtained test environment information and data resource information (i.e., the environment information of the current test environment and the data resource information of the test environment to be switched), and hands the version switching asynchronous task to the task processing module for execution, and returns the request result to the front end.

(3)取出当前版本数据资源(3) Get the current version of the data resource

任务处理模块接收切换版本任务,在缓冲中排队并开始执行后,根据数据资源信息,向开发环境管理平台中的数据资源管理模块发送取出被切换版本(即当前版本)数据资源的请求,在取出当前测试环境的被切换版本的数据资源后,再向数据库操作模块发送执行测试数据还原操作(即测试数据还原请求),其中,测试数据还原请求携带有数据源列表和数据资源信息,数据资源管理模块可以将测试环境下各分支/版本下的测试数据以文件的形式管理,用于协助完成测试环境的版本切换。The task processing module receives the version switching task, queues it in the buffer and starts executing it. Then, based on the data resource information, it sends a request to the data resource management module in the development environment management platform to retrieve the data resources of the switched version (i.e., the current version). After retrieving the data resources of the switched version of the current test environment, it sends a request to the database operation module to perform a test data restoration operation (i.e., a test data restoration request). The test data restoration request carries a data source list and data resource information. The data resource management module can manage the test data under each branch/version under the test environment in the form of files to assist in completing the version switching of the test environment.

(4)执行测试数据还原操作(4) Perform test data restoration operations

数据库操作模块接收测试数据还原请求后,根据请求中数据源列表信息和数据资源信息访问待切换数据源,执行测试数据还原操作,将执行结果返回任务处理模块,并更新待切换测试环境版本信息,完成版本切换任务。After receiving the test data restoration request, the database operation module accesses the data source to be switched according to the data source list information and data resource information in the request, performs the test data restoration operation, returns the execution result to the task processing module, and updates the version information of the test environment to be switched to complete the version switching task.

3),处理生产数据还原任务3) Processing production data restoration tasks

本发明实施例中,若待处理环境为测试环境,则在接收业务处理请求之后,数据处理方法还包括:向开发环境管理平台中的数据资源管理模块发送数据源导入请求,其中,数据源导入请求用于将测试环境的环境数据资源导入至数据资源库中。In an embodiment of the present invention, if the environment to be processed is a test environment, then after receiving the business processing request, the data processing method also includes: sending a data source import request to a data resource management module in a development environment management platform, wherein the data source import request is used to import the environmental data resources of the test environment into a data resource library.

另一种可选的,若待处理环境为测试环境且业务处理请求的类型为生产数据还原,基于待处理环境的环境信息,生成待处理环境的数据任务的步骤,包括:创建目标生产数据版本,并将目标生产数据版本与数据资源库中的环境数据资源建立关联关系;基于目标生产数据版本的版本信息,向任务处理模块发送生产数据还原请求;基于执行结果更新待处理环境的版本信息,完成业务处理请求的步骤,包括:控制数据库操作模块响应生产数据还原请求,根据生产数据资源和版本信息访问数据源,执行生产数据还原现场操作,得到执行结果;将执行结果返回任务处理模块,并更新测试环境的版本信息,完成生产数据还原任务。Another optional step, if the environment to be processed is a test environment and the type of business processing request is production data restoration, based on the environmental information of the environment to be processed, the steps of generating a data task for the environment to be processed include: creating a target production data version, and establishing an association between the target production data version and the environmental data resources in the data resource library; based on the version information of the target production data version, sending a production data restoration request to the task processing module; updating the version information of the environment to be processed based on the execution result, and completing the steps of the business processing request include: controlling the database operation module to respond to the production data restoration request, accessing the data source according to the production data resources and version information, performing on-site production data restoration operations, and obtaining execution results; returning the execution results to the task processing module, and updating the version information of the test environment to complete the production data restoration task.

在本发明实施例中,图4是根据本发明实施例的一种可选的处理生产数据还原任务的示意图,如图4所示,包括:环境管理模块、版本控制模块、数据库操作模块、任务处理模块以及数据资源管理模块,并具有查询环境信息,导入生产数据资源,创建生产数据特别版本,插入还原生产环境异步任务,取出生产数据资源,执行生产数据还原现场操作等六个步骤,具体步骤如下:In an embodiment of the present invention, FIG4 is a schematic diagram of an optional processing production data restoration task according to an embodiment of the present invention. As shown in FIG4, it includes: an environment management module, a version control module, a database operation module, a task processing module and a data resource management module, and has six steps of querying environment information, importing production data resources, creating a special version of production data, inserting an asynchronous task to restore the production environment, taking out production data resources, and performing on-site operations for production data restoration. The specific steps are as follows:

(1)查询环境信息(1) Query environmental information

版本控制模块接收生产数据还原请求后,向环境管理模块查询生产环境所对应的环境信息。After receiving the production data restoration request, the version control module queries the environment management module for the environment information corresponding to the production environment.

(2)导入生产数据资源(2) Importing production data resources

由于不能直接操作生产环境的数据环境,可以由生产环境运维人员提前准备好生产环境的数据资源,可通过版本控制模块向数据资源管理模块发送导入生产数据源请求(即数据源导入请求),将准备好的数据资源导入至数据资源库中(即将生产环境的环境数据资源导入至数据资源库中)。Since the data environment of the production environment cannot be directly operated, the production environment operation and maintenance personnel can prepare the data resources of the production environment in advance. They can send an import production data source request (i.e., data source import request) to the data resource management module through the version control module, and import the prepared data resources into the data resource library (i.e., import the environmental data resources of the production environment into the data resource library).

(3)创建生产数据特别版本(3) Create a special version of production data

版本控制模块可创建生产数据特别版本(即创建目标生产数据版本),将该版本与之前的数据资源绑定(即将目标生产数据版本与数据资源库中的环境数据资源建立关联关系)。The version control module can create a special version of the production data (ie, create a target production data version), and bind the version to the previous data resource (ie, establish an association relationship between the target production data version and the environmental data resource in the data resource library).

(4)插入还原生产环境异步任务(4) Insert an asynchronous task to restore the production environment

版本控制模块基于携带生产数据特别版本信息(即目标生产数据版本的版本信息),向任务处理模块发送插入还原生产环境异步任务(即生产数据还原任务)。The version control module sends an asynchronous task for inserting and restoring the production environment (ie, a production data restoration task) to the task processing module based on the special version information of the production data (ie, the version information of the target production data version).

(5)取出生产数据资源(5) Extracting production data resources

任务处理模块接收生产环境还原任务,在缓冲中排队并开始执行后,向数据资源管理模块发送取出生产数据资源请求,获得生产数据资源(即读取数据资源管理模块中存储的数据资源)后,基于携带生产数据资源和生产数据特别版本信息向数据库操作模块发送执行生产数据还原现场操作请求(即生产数据还原请求)。The task processing module receives the production environment restoration task, queues it in the buffer and starts executing it, then sends a request to the data resource management module to retrieve the production data resources. After obtaining the production data resources (i.e., reading the data resources stored in the data resource management module), it sends a request to execute the production data restoration on-site operation (i.e., the production data restoration request) to the database operation module based on the production data resources and the special version information of the production data.

(6)执行生产数据还原现场操作(6) Perform on-site operations to restore production data

数据库操作模块接收生产数据还原请求后,根据生产数据资源和生产数据特别版本信息(即生产数据资源和目标生产数据版本的版本信息)访问数据源,执行生产数据还原现场操作,将执行结果返回任务处理模块,并更新测试环境版本信息,完成生产数据还原现场任务。After receiving the production data restoration request, the database operation module accesses the data source according to the production data resources and the special version information of the production data (i.e., the version information of the production data resources and the target production data version), performs the production data restoration on-site operation, returns the execution result to the task processing module, and updates the test environment version information to complete the production data restoration on-site task.

在本发明实施例中,另一种可选的,控制任务处理模块执行数据任务,得到执行结果的步骤,包括:控制任务处理模块在接收到数据任务后,将数据任务发送至任务缓冲池;根据任务缓冲池的任务排队顺序,执行每个数据任务。In an embodiment of the present invention, another optional step of controlling the task processing module to execute the data task and obtain the execution result includes: after receiving the data task, the control task processing module sends the data task to the task buffer pool; and executes each data task according to the task queuing order of the task buffer pool.

在本发明实施例中,任务处理模块内部有任务缓冲池,可以解决多任务调度情况,即任务处理模块在接收到数据任务后,将数据任务发送至任务缓冲池,根据任务缓冲池的任务排队顺序(例如,可以按照任务的时间顺序排序,也可按照预先设置的优先级进行排序等),执行每个数据任务。In an embodiment of the present invention, there is a task buffer pool inside the task processing module, which can solve the multi-task scheduling situation. That is, after receiving the data task, the task processing module sends the data task to the task buffer pool, and executes each data task according to the task queuing order of the task buffer pool (for example, it can be sorted according to the time order of the tasks, or it can be sorted according to a pre-set priority, etc.).

本发明实施例,基于灵活测试环境需求,提出一种支持多分支多版本多库的测试数据环境管理方法,能够对各应用下多个分支多个版本以及涉及多数据库的环境对应的测试数据进行统一管理,并具有以下有益效果:The embodiment of the present invention, based on the demand for a flexible test environment, proposes a test data environment management method that supports multiple branches, multiple versions, and multiple libraries, which can uniformly manage the test data corresponding to multiple branches, multiple versions, and environments involving multiple databases under each application, and has the following beneficial effects:

(1)能够支持复杂的测试环境需求,通过对测试环境有分支和版本的设定,测试环境可以在多个分支和版本之间切换,不仅支持多数据库组合的测试环境,而且可以完成整个数据库集群的测试环境切换;(1) It can support complex test environment requirements. By setting branches and versions for the test environment, the test environment can be switched between multiple branches and versions. It not only supports the test environment of multiple database combinations, but also can complete the test environment switching of the entire database cluster.

(2)具有生产数据还原现场功能,如果遇到生产问题,由于不能直接在生产环境进行测试,可以使用对应的测试环境作为模拟测试场景进行测试;(2) It has the function of restoring production data on site. If a production problem occurs, since it is not possible to test directly in the production environment, the corresponding test environment can be used as a simulated test scenario for testing;

(3)利用任务缓冲池设计,使平台/系统稳定可靠,可以有效避免高并发请求带来的负载压力。(3) The task buffer pool design makes the platform/system stable and reliable, which can effectively avoid the load pressure caused by high concurrent requests.

实施例二Embodiment 2

本实施例中提供的一种数据处理装置包含了多个实施单元,每个实施单元对应于上述实施例一中的各个实施步骤。A data processing device provided in this embodiment includes multiple implementation units, each implementation unit corresponds to each implementation step in the above-mentioned embodiment 1.

图5是根据本发明实施例的一种可选的数据处理装置的示意图,如图5所示,该处理装置可以包括:接收单元50,查询单元52,生成单元54,控制单元56,其中,FIG5 is a schematic diagram of an optional data processing device according to an embodiment of the present invention. As shown in FIG5 , the processing device may include: a receiving unit 50, a query unit 52, a generating unit 54, and a control unit 56, wherein:

接收单元50,用于接收业务处理请求,其中,业务处理请求携带有待处理环境的环境标识。The receiving unit 50 is configured to receive a service processing request, wherein the service processing request carries an environment identifier of an environment to be processed.

查询单元52,用于响应业务处理请求,向环境管理模块查询待处理环境的环境信息。The query unit 52 is used to respond to the business processing request and query the environment management module for the environment information of the environment to be processed.

生成单元54,用于基于待处理环境的环境信息,生成待处理环境的数据任务。The generating unit 54 is used to generate a data task for the environment to be processed based on the environment information of the environment to be processed.

控制单元56,用于控制任务处理模块执行数据任务,得到执行结果,并基于执行结果更新待处理环境的版本信息,完成业务处理请求。The control unit 56 is used to control the task processing module to execute the data task, obtain the execution result, and update the version information of the environment to be processed based on the execution result to complete the business processing request.

上述处理装置,可以通过接收单元50接收业务处理请求,其中,业务处理请求携带有待处理环境的环境标识,通过查询单元52响应业务处理请求,向环境管理模块查询待处理环境的环境信息,通过生成单元54基于待处理环境的环境信息,生成待处理环境的数据任务,通过控制单元56控制任务处理模块执行数据任务,得到执行结果,并基于执行结果更新待处理环境的版本信息,完成业务处理请求。在本发明实施例中,可通过对处理环境的环境信息进行统一管理,适用于处理多环境下的业务,提高处理业务的效率,进而解决了相关技术中无法统一管理各类型测试坏境,导致处理业务的效率较低的技术问题。The above-mentioned processing device can receive a business processing request through the receiving unit 50, wherein the business processing request carries the environment identifier of the environment to be processed, respond to the business processing request through the query unit 52, query the environment information of the environment to be processed from the environment management module, generate the data task of the environment to be processed based on the environment information of the environment to be processed through the generating unit 54, control the task processing module to execute the data task through the control unit 56, obtain the execution result, and update the version information of the environment to be processed based on the execution result to complete the business processing request. In the embodiment of the present invention, by uniformly managing the environment information of the processing environment, it is suitable for processing businesses in multiple environments, improving the efficiency of processing businesses, thereby solving the technical problem that the related technology cannot uniformly manage various types of test environments, resulting in low efficiency in processing businesses.

可选的,待处理环境的环境类型包括:测试环境和生产环境,若待处理环境为测试环境,则待处理环境的环境信息包括:测试环境的源数据以及与测试环境对应的数据源列表,每个测试环境对应有至少一个环境版本,每个环境版本对应有数据源。Optionally, the environment types of the environment to be processed include: test environment and production environment. If the environment to be processed is a test environment, the environment information of the environment to be processed includes: source data of the test environment and a list of data sources corresponding to the test environment. Each test environment corresponds to at least one environment version, and each environment version corresponds to a data source.

可选的,业务处理请求的类型包括:创建测试环境版本、切换测试环境版本和生产数据还原。Optionally, the types of business processing requests include: creating a test environment version, switching a test environment version, and restoring production data.

可选的,数据处理装置包括:第一生成模块,用于若待处理环境为测试环境且业务处理请求的类型为创建测试环境版本,则基于待处理环境的环境信息,生成待处理环境的数据任务的步骤,包括:基于测试环境的环境信息,生成测试环境的版本创建任务;控制任务处理模块执行数据任务,得到执行结果的步骤,包括:第一发送模块,用于控制任务处理模块在接收版本创建任务后,根据版本创建任务中携带的数据源列表,向开发环境管理平台中的数据库操作模块发送测试数据备份请求;基于执行结果更新待处理环境的版本信息,完成业务处理请求的步骤,包括:第一保存模块,用于控制开发环境管理平台中的数据库操作模块响应测试数据备份请求,执行测试数据备份操作,将备份文件保存至数据资源库中;第一更新模块,用于控制任务处理模块登记创建的目标版本的数据资源,并更新测试环境的版本信息,完成版本创建任务。Optionally, the data processing device includes: a first generating module, which is used to generate a data task for the environment to be processed based on the environmental information of the environment to be processed if the environment to be processed is a test environment and the type of the business processing request is to create a test environment version, including: generating a version creation task for the test environment based on the environmental information of the test environment; controlling the task processing module to execute the data task and obtain the execution result, including: a first sending module, which is used to control the task processing module to send a test data backup request to the database operation module in the development environment management platform according to the data source list carried in the version creation task after receiving the version creation task; updating the version information of the environment to be processed based on the execution result to complete the business processing request, including: a first saving module, which is used to control the database operation module in the development environment management platform to respond to the test data backup request, perform the test data backup operation, and save the backup file to the data resource library; a first updating module, which is used to control the task processing module to register the data resources of the target version created, and update the version information of the test environment to complete the version creation task.

可选的,数据处理装置包括:第二生成模块,用于若待处理环境为测试环境且业务处理请求的类型为切换测试环境版本,则基于当前测试环境的环境信息和待切换测试环境的数据资源信息,生成与待切换测试环境对应的版本切换任务;第一提取模块,用于控制任务处理模块在接收版本切换任务后,根据数据资源信息,提取当前测试环境的被切换版本的数据资源,并向开发环境管理平台中的数据库操作模块发送测试数据还原请求,其中,测试数据还原请求携带有数据源列表和数据资源信息;第二更新模块,用于控制开发环境管理平台中的数据库操作模块响应测试数据还原请求,根据测试数据还原请求中的数据源列表和数据资源信息访问待切换数据源,执行测试数据还原操作,将数据还原结果返回任务处理模块,并更新待切换测试环境的版本信息,完成版本切换任务。Optionally, the data processing device includes: a second generation module, which is used to generate a version switching task corresponding to the test environment to be switched based on the environment information of the current test environment and the data resource information of the test environment to be switched if the environment to be processed is a test environment and the type of business processing request is to switch the test environment version; a first extraction module, which is used to control the task processing module to extract the data resources of the switched version of the current test environment according to the data resource information after receiving the version switching task, and send a test data restoration request to the database operation module in the development environment management platform, wherein the test data restoration request carries a data source list and data resource information; a second update module, which is used to control the database operation module in the development environment management platform to respond to the test data restoration request, access the data source to be switched according to the data source list and data resource information in the test data restoration request, perform the test data restoration operation, return the data restoration result to the task processing module, and update the version information of the test environment to be switched to complete the version switching task.

可选的,第一提取模块包括:第一提取子模块,用于根据数据资源信息,向开发环境管理平台中的数据资源管理模块发送资源提取请求,以提取出当前测试环境的被切换版本的数据资源。Optionally, the first extraction module includes: a first extraction submodule, configured to send a resource extraction request to a data resource management module in the development environment management platform according to the data resource information, so as to extract the switched version of the data resource of the current test environment.

可选的,数据处理装置还包括:第一导入模块,用于若待处理环境为测试环境,则在接收业务处理请求之后,向开发环境管理平台中的数据资源管理模块发送数据源导入请求,其中,数据源导入请求用于将测试环境的环境数据资源导入至数据资源库中。Optionally, the data processing device also includes: a first import module, which is used to send a data source import request to the data resource management module in the development environment management platform after receiving the business processing request if the environment to be processed is a test environment, wherein the data source import request is used to import the environmental data resources of the test environment into the data resource library.

可选的,数据处理装置包括:第一创建模块,用于若待处理环境为测试环境且业务处理请求的类型为生产数据还原,创建目标生产数据版本,并将目标生产数据版本与数据资源库中的环境数据资源建立关联关系;第二发送模块,用于基于目标生产数据版本的版本信息,向任务处理模块发送生产数据还原请求;第三更新模块,用于控制数据库操作模块响应生产数据还原请求,根据生产数据资源和版本信息访问数据源,执行生产数据还原现场操作,得到执行结果;将执行结果返回任务处理模块,并更新测试环境的版本信息,完成生产数据还原任务。Optionally, the data processing device includes: a first creation module, which is used to create a target production data version and establish an association relationship between the target production data version and the environmental data resources in the data resource library if the environment to be processed is a test environment and the type of business processing request is production data restoration; a second sending module, which is used to send a production data restoration request to the task processing module based on the version information of the target production data version; a third update module, which is used to control the database operation module to respond to the production data restoration request, access the data source according to the production data resources and version information, perform the production data restoration on-site operation, and obtain the execution result; return the execution result to the task processing module, and update the version information of the test environment to complete the production data restoration task.

可选的,控制单元包括:第三发送模块,用于控制任务处理模块在接收到数据任务后,将数据任务发送至任务缓冲池;第一执行模块,用于根据任务缓冲池的任务排队顺序,执行每个数据任务。Optionally, the control unit includes: a third sending module, used to control the task processing module to send the data task to the task buffer pool after receiving the data task; and a first execution module, used to execute each data task according to the task queuing order of the task buffer pool.

上述的处理装置还可以包括处理器和存储器,上述接收单元50,查询单元52,生成单元54,控制单元56等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The above-mentioned processing device may also include a processor and a memory. The above-mentioned receiving unit 50, query unit 52, generation unit 54, control unit 56, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

上述处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来基于执行结果更新待处理环境的版本信息,完成业务处理请求。The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters are adjusted to update the version information of the environment to be processed based on the execution result to complete the business processing request.

上述存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.

本申请还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行初始化有如下方法步骤的程序:接收业务处理请求,其中,业务处理请求携带有待处理环境的环境标识,响应业务处理请求,向环境管理模块查询待处理环境的环境信息,基于待处理环境的环境信息,生成待处理环境的数据任务,控制任务处理模块执行数据任务,得到执行结果,并基于执行结果更新待处理环境的版本信息,完成业务处理请求。The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: receiving a business processing request, wherein the business processing request carries an environment identifier of the environment to be processed, responding to the business processing request, querying the environment management module for the environment information of the environment to be processed, generating a data task for the environment to be processed based on the environment information of the environment to be processed, controlling the task processing module to execute the data task, obtaining an execution result, and updating the version information of the environment to be processed based on the execution result, thereby completing the business processing request.

根据本发明实施例的另一方面,还提供了一种测试环境的管理平台,包括:环境管理模块,用于管理测试环境或者生产的环境信息;版本控制模块,用于执行上述任意一项的数据处理方法;数据库操作模块,用于与测试环境对应的数据资源库的库操作,其中,库操作包括下述至少之一:数据资源库的库连接、数据备份、数据还原;任务处理模块,用于执行业务处理请求,并返回执行结果;数据资源管理模块,用于管理测试环境下各环境版本下的测试数据,并完成测试环境的版本切换任务。According to another aspect of an embodiment of the present invention, a test environment management platform is also provided, including: an environment management module for managing environment information of a test environment or production; a version control module for executing any one of the above data processing methods; a database operation module for library operations of a data resource library corresponding to the test environment, wherein the library operations include at least one of the following: library connection, data backup, and data restoration of the data resource library; a task processing module for executing business processing requests and returning execution results; a data resource management module for managing test data under each environment version under the test environment and completing version switching tasks of the test environment.

可选的,任务处理模块包括:任务缓冲池,任务缓冲池用于调度待处理的多个数据任务。Optionally, the task processing module includes: a task buffer pool, which is used to schedule multiple data tasks to be processed.

根据本发明实施例的另一方面,还提供了一种电子设备,包括:处理器;以及存储器,用于存储处理器的可执行指令;其中,处理器配置为经由执行可执行指令来执行上述任意一项的数据处理方法。According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned data processing methods by executing the executable instructions.

根据本发明实施例的另一方面,还提供了一种计算机可读存储介质,计算机可读存储介质包括存储的计算机程序,其中,在计算机程序运行时控制计算机可读存储介质所在设备执行上述任意一项的数据处理方法。According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned data processing methods.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

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

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, 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, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims (13)

1.一种数据处理方法,其特征在于,应用于开发环境管理平台中的版本控制模块,所述开发环境管理平台还包括:环境管理模块和任务处理模块,所述数据处理方法包括:1. A data processing method, characterized in that it is applied to a version control module in a development environment management platform, wherein the development environment management platform further comprises: an environment management module and a task processing module, and the data processing method comprises: 通过所述版本控制模块接收业务处理请求,其中,所述业务处理请求携带有待处理环境的环境标识,所述业务处理请求的类型至少包括:创建测试环境版本;Receiving a business processing request through the version control module, wherein the business processing request carries an environment identifier of a to-be-processed environment, and the type of the business processing request at least includes: creating a test environment version; 响应所述业务处理请求,向所述环境管理模块查询所述待处理环境的环境信息;In response to the business processing request, query the environment management module for environment information of the environment to be processed; 基于所述待处理环境的环境信息,生成所述待处理环境的数据任务,包括:若所述待处理环境为测试环境且所述业务处理请求的类型为创建测试环境版本,基于所述测试环境的环境信息,生成所述测试环境的版本创建任务;Based on the environment information of the environment to be processed, generating a data task for the environment to be processed, including: if the environment to be processed is a test environment and the type of the business processing request is to create a test environment version, based on the environment information of the test environment, generating a version creation task for the test environment; 控制所述任务处理模块执行所述数据任务,得到执行结果,包括:控制所述任务处理模块在接收版本创建任务后,根据所述版本创建任务中携带的数据源列表,向所述开发环境管理平台中的数据库操作模块发送测试数据备份请求;Controlling the task processing module to execute the data task and obtain the execution result includes: controlling the task processing module to send a test data backup request to the database operation module in the development environment management platform according to the data source list carried in the version creation task after receiving the version creation task; 基于执行结果更新所述待处理环境的版本信息,完成业务处理请求,包括:控制所述开发环境管理平台中的数据库操作模块响应所述测试数据备份请求,执行测试数据备份操作,将备份文件保存至数据资源库中;控制所述任务处理模块登记创建的目标版本的数据资源,并更新所述测试环境的版本信息,完成版本创建任务。The version information of the environment to be processed is updated based on the execution result to complete the business processing request, including: controlling the database operation module in the development environment management platform to respond to the test data backup request, executing the test data backup operation, and saving the backup file to the data resource library; controlling the task processing module to register the data resources of the target version created, and updating the version information of the test environment to complete the version creation task. 2.根据权利要求1所述的方法,其特征在于,所述待处理环境的环境类型包括:测试环境和生产环境,若所述待处理环境为测试环境,则所述待处理环境的环境信息包括:测试环境的源数据以及与所述测试环境对应的数据源列表,每个所述测试环境对应有至少一个环境版本,每个环境版本对应有数据源。2. The method according to claim 1 is characterized in that the environment type of the environment to be processed includes: a test environment and a production environment. If the environment to be processed is a test environment, the environment information of the environment to be processed includes: source data of the test environment and a list of data sources corresponding to the test environment. Each of the test environments corresponds to at least one environment version, and each environment version corresponds to a data source. 3.根据权利要求1所述的方法,其特征在于,所述业务处理请求的类型还包括:切换测试环境版本和生产数据还原。3. The method according to claim 1 is characterized in that the types of business processing requests also include: switching test environment versions and restoring production data. 4.根据权利要求3所述的方法,其特征在于,若所述待处理环境为测试环境且所述业务处理请求的类型为切换测试环境版本,4. The method according to claim 3, characterized in that if the environment to be processed is a test environment and the type of the business processing request is to switch the test environment version, 则基于所述待处理环境的环境信息,生成所述待处理环境的数据任务的步骤,包括:基于当前测试环境的环境信息和待切换测试环境的数据资源信息,生成与所述待切换测试环境对应的版本切换任务;The step of generating a data task of the environment to be processed based on the environment information of the environment to be processed includes: generating a version switching task corresponding to the test environment to be switched based on the environment information of the current test environment and the data resource information of the test environment to be switched; 控制所述任务处理模块执行所述数据任务,得到执行结果的步骤,包括:控制所述任务处理模块在接收版本切换任务后,根据所述数据资源信息,提取所述当前测试环境的被切换版本的数据资源,并向所述开发环境管理平台中的数据库操作模块发送测试数据还原请求,其中,所述测试数据还原请求携带有数据源列表和所述数据资源信息;The step of controlling the task processing module to execute the data task and obtain the execution result includes: after receiving the version switching task, controlling the task processing module to extract the data resource of the switched version of the current test environment according to the data resource information, and sending a test data restoration request to the database operation module in the development environment management platform, wherein the test data restoration request carries a data source list and the data resource information; 基于执行结果更新所述待处理环境的版本信息,完成业务处理请求的步骤,包括:控制所述开发环境管理平台中的数据库操作模块响应所述测试数据还原请求,根据所述测试数据还原请求中的数据源列表和数据资源信息访问待切换数据源,执行测试数据还原操作,将数据还原结果返回所述任务处理模块,并更新所述待切换测试环境的版本信息,完成版本切换任务。The step of updating the version information of the environment to be processed based on the execution result and completing the business processing request includes: controlling the database operation module in the development environment management platform to respond to the test data restoration request, accessing the data source to be switched according to the data source list and data resource information in the test data restoration request, executing the test data restoration operation, returning the data restoration result to the task processing module, and updating the version information of the test environment to be switched to complete the version switching task. 5.根据权利要求4所述的方法,其特征在于,根据所述数据资源信息,提取所述当前测试环境的被切换版本的数据资源的步骤,包括:5. The method according to claim 4, characterized in that the step of extracting the switched version of the data resource of the current test environment according to the data resource information comprises: 根据所述数据资源信息,向所述开发环境管理平台中的数据资源管理模块发送资源提取请求,以提取出所述当前测试环境的被切换版本的数据资源。According to the data resource information, a resource extraction request is sent to the data resource management module in the development environment management platform to extract the switched version of the data resource of the current test environment. 6.根据权利要求3所述的方法,其特征在于,若所述待处理环境为测试环境,则在接收业务处理请求之后,所述数据处理方法还包括:6. The method according to claim 3, characterized in that if the environment to be processed is a test environment, then after receiving the business processing request, the data processing method further comprises: 向所述开发环境管理平台中的数据资源管理模块发送数据源导入请求,其中,所述数据源导入请求用于将所述测试环境的环境数据资源导入至数据资源库中。A data source import request is sent to a data resource management module in the development environment management platform, wherein the data source import request is used to import the environmental data resources of the test environment into a data resource library. 7.根据权利要求6所述的方法,其特征在于,若所述待处理环境为测试环境且所述业务处理请求的类型为生产数据还原,7. The method according to claim 6, characterized in that if the environment to be processed is a test environment and the type of the business processing request is production data restoration, 基于所述待处理环境的环境信息,生成所述待处理环境的数据任务的步骤,包括:创建目标生产数据版本,并将所述目标生产数据版本与所述数据资源库中的环境数据资源建立关联关系;基于所述目标生产数据版本的版本信息,向任务处理模块发送生产数据还原请求;The step of generating a data task for the environment to be processed based on the environment information of the environment to be processed includes: creating a target production data version, and establishing an association relationship between the target production data version and the environment data resource in the data resource library; sending a production data restoration request to a task processing module based on the version information of the target production data version; 基于执行结果更新所述待处理环境的版本信息,完成业务处理请求的步骤,包括:控制数据库操作模块响应所述生产数据还原请求,根据生产数据资源和所述版本信息访问数据源,执行生产数据还原现场操作,得到执行结果;将所述执行结果返回任务处理模块,并更新所述测试环境的版本信息,完成生产数据还原任务。The steps of updating the version information of the environment to be processed based on the execution result and completing the business processing request include: controlling the database operation module to respond to the production data restoration request, accessing the data source according to the production data resource and the version information, performing the production data restoration on-site operation, and obtaining the execution result; returning the execution result to the task processing module, and updating the version information of the test environment to complete the production data restoration task. 8.根据权利要求1所述的方法,其特征在于,控制所述任务处理模块执行所述数据任务,得到执行结果的步骤,包括:8. The method according to claim 1, characterized in that the step of controlling the task processing module to execute the data task and obtaining the execution result comprises: 控制所述任务处理模块在接收到所述数据任务后,将所述数据任务发送至任务缓冲池;Controlling the task processing module to send the data task to the task buffer pool after receiving the data task; 根据所述任务缓冲池的任务排队顺序,执行每个所述数据任务。Each of the data tasks is executed according to the task queuing order of the task buffer pool. 9.一种测试环境的管理平台,其特征在于,包括:9. A test environment management platform, characterized by comprising: 环境管理模块,用于管理测试环境或者生产的环境信息;The environment management module is used to manage the test environment or production environment information; 版本控制模块,用于执行权利要求1至7中任意一项所述的数据处理方法;A version control module, used to execute the data processing method according to any one of claims 1 to 7; 数据库操作模块,用于与所述测试环境对应的数据资源库的库操作,其中,所述库操作包括下述至少之一:数据资源库的库连接、数据备份、数据还原;A database operation module, used for library operation of a data resource library corresponding to the test environment, wherein the library operation includes at least one of the following: library connection, data backup, and data restoration of the data resource library; 任务处理模块,用于执行业务处理请求,并返回执行结果;The task processing module is used to execute business processing requests and return execution results; 数据资源管理模块,用于管理测试环境下各环境版本下的测试数据,并完成测试环境的版本切换任务。The data resource management module is used to manage the test data under each environment version in the test environment and complete the version switching task of the test environment. 10.根据权利要求9所述的管理平台,其特征在于,所述任务处理模块包括:任务缓冲池,所述任务缓冲池用于调度待处理的多个数据任务。10 . The management platform according to claim 9 , wherein the task processing module comprises: a task buffer pool, wherein the task buffer pool is used to schedule a plurality of data tasks to be processed. 11.一种数据处理装置,其特征在于,应用于开发环境管理平台中的版本控制模块,所述开发环境管理平台还包括:环境管理模块和任务处理模块,所述数据处理装置包括:11. A data processing device, characterized in that it is applied to a version control module in a development environment management platform, the development environment management platform further comprising: an environment management module and a task processing module, the data processing device comprising: 接收单元,用于接收业务处理请求,其中,所述业务处理请求携带有待处理环境的环境标识,所述业务处理请求的类型至少包括:创建测试环境版本;A receiving unit, configured to receive a business processing request, wherein the business processing request carries an environment identifier of an environment to be processed, and the type of the business processing request at least includes: creating a test environment version; 查询单元,用于响应所述业务处理请求,向所述环境管理模块查询所述待处理环境的环境信息;A query unit, configured to respond to the business processing request and query the environment management module for environment information of the environment to be processed; 生成单元,用于基于所述待处理环境的环境信息,生成所述待处理环境的数据任务,包括:若所述待处理环境为测试环境且所述业务处理请求的类型为创建测试环境版本,基于所述测试环境的环境信息,生成所述测试环境的版本创建任务;A generating unit, configured to generate a data task for the environment to be processed based on the environment information of the environment to be processed, including: if the environment to be processed is a test environment and the type of the business processing request is to create a test environment version, generating a version creation task for the test environment based on the environment information of the test environment; 控制单元,用于控制所述任务处理模块执行所述数据任务,得到执行结果,并基于执行结果更新所述待处理环境的版本信息,完成业务处理请求,包括:控制所述任务处理模块在接收版本创建任务后,根据所述版本创建任务中携带的数据源列表,向所述开发环境管理平台中的数据库操作模块发送测试数据备份请求;控制所述开发环境管理平台中的数据库操作模块响应所述测试数据备份请求,执行测试数据备份操作,将备份文件保存至数据资源库中;控制所述任务处理模块登记创建的目标版本的数据资源,并更新所述测试环境的版本信息,完成版本创建任务。A control unit, used to control the task processing module to execute the data task, obtain the execution result, and update the version information of the environment to be processed based on the execution result to complete the business processing request, including: controlling the task processing module to send a test data backup request to the database operation module in the development environment management platform according to the data source list carried in the version creation task after receiving the version creation task; controlling the database operation module in the development environment management platform to respond to the test data backup request, perform the test data backup operation, and save the backup file to the data resource library; controlling the task processing module to register the data resources of the created target version, and update the version information of the test environment to complete the version creation task. 12. 一种电子设备,其特征在于,包括:12. An electronic device, comprising: 处理器;以及Processor; and 存储器,用于存储所述处理器的可执行指令;A memory, configured to store executable instructions of the processor; 其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至8中任意一项所述的数据处理方法。The processor is configured to execute the data processing method according to any one of claims 1 to 8 by executing the executable instructions. 13.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的计算机程序,其中,在所述计算机程序运行时控制所述计算机可读存储介质所在设备执行权利要求1至8中任意一项所述的数据处理方法。13. A computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the data processing method described in any one of claims 1 to 8.
CN202111321832.XA 2021-11-09 2021-11-09 Data processing method and device, management platform of test environment and electronic equipment Active CN114020629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111321832.XA CN114020629B (en) 2021-11-09 2021-11-09 Data processing method and device, management platform of test environment and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111321832.XA CN114020629B (en) 2021-11-09 2021-11-09 Data processing method and device, management platform of test environment and electronic equipment

Publications (2)

Publication Number Publication Date
CN114020629A CN114020629A (en) 2022-02-08
CN114020629B true CN114020629B (en) 2024-08-20

Family

ID=80062744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111321832.XA Active CN114020629B (en) 2021-11-09 2021-11-09 Data processing method and device, management platform of test environment and electronic equipment

Country Status (1)

Country Link
CN (1) CN114020629B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913870A (en) * 2019-05-09 2020-11-10 腾讯科技(深圳)有限公司 A multi-environment management method, device, system, equipment and medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10216509B2 (en) * 2016-03-18 2019-02-26 TUPL, Inc. Continuous and automatic application development and deployment
CN111881016A (en) * 2020-06-19 2020-11-03 北京三快在线科技有限公司 Data processing system, method, equipment and readable storage medium
CN113420010B (en) * 2021-06-23 2023-05-26 中国建设银行股份有限公司 Database management method, device, electronic equipment and storage medium
CN113254356B (en) * 2021-07-16 2021-10-29 浩鲸云计算科技股份有限公司 Test environment management method based on Knative

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913870A (en) * 2019-05-09 2020-11-10 腾讯科技(深圳)有限公司 A multi-environment management method, device, system, equipment and medium

Also Published As

Publication number Publication date
CN114020629A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
JP7221975B2 (en) Transaction processing in a multi-master distributed data management system
US11249983B2 (en) Transaction change data forwarding
US8417991B2 (en) Mitigating reduction in availability level during maintenance of nodes in a cluster
US10802766B2 (en) Database with NVDIMM as persistent storage
CN110309218B (en) Data exchange system and data writing method
CN109918435A (en) A kind of processing method and system of business interface
CN111651296A (en) Intercept backup method, device, device and storage medium for data deletion operation
CN111767144A (en) Transaction routing determination method, device, equipment and system for transaction data
US7882232B2 (en) Rapid resource provisioning with automated throttling
CN113296891B (en) Platform-based multi-scenario knowledge graph processing method and device
CN111684437B (en) Staggered update key-value storage system ordered by time sequence
CN114281402A (en) A software version management method and device
CN100442236C (en) Method and system for use of MD4 checksum and link transactions across machines
CN113360558B (en) Data processing method, data processing device, electronic equipment and storage medium
CN114020629B (en) Data processing method and device, management platform of test environment and electronic equipment
CN118069750A (en) Data processing method and device
US8850418B2 (en) System and method for business function reversibility
CN111930720A (en) Data tilt processing method, system, electronic device and medium
AU2021268828B2 (en) Secure data replication in distributed data storage environments
CN113590033A (en) Information synchronization method and device of super-fusion system
CN114064783A (en) Method and device for importing data, electronic equipment and storage medium
CN114116030A (en) Operating system running method and device, electronic equipment and storage medium
JP2000020374A (en) Replication control system
CN113254483B (en) Request processing method and device, electronic equipment and storage medium
CN115600567B (en) Report export method and device

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