WO2022241947A1 - 一种对应用程序的数据处理方法、装置、设备及存储介质 - Google Patents

一种对应用程序的数据处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022241947A1
WO2022241947A1 PCT/CN2021/108730 CN2021108730W WO2022241947A1 WO 2022241947 A1 WO2022241947 A1 WO 2022241947A1 CN 2021108730 W CN2021108730 W CN 2021108730W WO 2022241947 A1 WO2022241947 A1 WO 2022241947A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
sub
service
database file
services
Prior art date
Application number
PCT/CN2021/108730
Other languages
English (en)
French (fr)
Inventor
马一炜
Original Assignee
腾讯云计算(北京)有限责任公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯云计算(北京)有限责任公司 filed Critical 腾讯云计算(北京)有限责任公司
Publication of WO2022241947A1 publication Critical patent/WO2022241947A1/zh
Priority to US18/299,381 priority Critical patent/US20230289165A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Definitions

  • the present application relates to the field of application programs, and in particular to a data processing method, device, device and storage medium for application programs.
  • each application usually includes multiple sub-services. When adjusting the application, each sub-service needs to be adjusted one by one, which is inefficient.
  • Embodiments of the present application provide a data processing method, device, device, and storage medium for application programs, which can better improve the efficiency of application program adjustment.
  • an embodiment of the present application provides a data processing method for an application program, the method is executed by a computer device, and the method includes:
  • P is a positive integer, and P is less than or equal to N;
  • the data information of the P adjusted sub-services is stored in the database to obtain the adjusted target application program.
  • the embodiment of the present application also provides a data processing device for application programs, including:
  • the acquiring unit is configured to acquire a software installation package of the target application in response to an adjustment instruction of the target application, the adjustment instruction carries a target version identifier, the target application includes N sub-services, and the software installation package includes N database file sets corresponding one-to-one to the N sub-services, the N database file sets are obtained from N images corresponding to the N sub-services one-to-one, and N is a positive integer;
  • a processing unit configured to adjust the P sub-services in the N sub-services to the version indicated by the target version identifier according to the P database file sets in the N database file sets, and obtain P adjusted
  • the data information of the sub-services, P is a positive integer, and P is less than or equal to N; and the data information of the P adjusted sub-services is stored in the database to obtain the adjusted target application program.
  • an embodiment of the present application also provides a computer device, including: a storage device and a processor; a computer program is stored in the storage device; and the processor executes the computer program to implement the above data processing method for the application program.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above data processing method for the application program is implemented .
  • the present application provides a computer program product or computer program, the computer program product or computer program comprising computer instructions stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above data processing method for the application program.
  • the software installation package of the target application program in response to the adjustment instruction of the target application program, the software installation package of the target application program is obtained, and the software installation package includes N database file sets corresponding to N sub-services one-to-one, and the N database file sets It is obtained from N images corresponding to N sub-services one-to-one.
  • the P database file sets in the N database file sets adjust the corresponding P sub-services to the version indicated by the target version identifier, and obtain The data information of the P adjusted sub-services is stored in the database to obtain the adjusted target application program. It can be seen that multiple sub-services in the application program can be adjusted in batches through the collection of N database files obtained from N mirror images, thereby improving the efficiency of application program adjustment.
  • FIG. 1 is a scene diagram of data processing of an application program provided by an embodiment of the present application
  • FIG. 2 is an architecture diagram of data processing of an application program provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a data processing method for an application program provided by an embodiment of the present application
  • FIG. 4 is a schematic flowchart of another data processing method for an application program provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of upgrading all sub-services of the target application program to the version indicated by the target version identifier provided by the embodiment of the present application;
  • FIG. 6 is a schematic diagram of rolling back all sub-services of the target application to the version indicated by the target version identifier provided by the embodiment of the present application;
  • FIG. 7 is a flow chart of data processing for an application program provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a data processing device for application programs provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • FIG. 1 is a scene diagram of data processing of an application program provided by an embodiment of the present application.
  • a scenario of data processing for an application program may include a terminal device 101 and a server 102 .
  • the terminal device 101 is a device used by a user.
  • the quantity of terminal equipment 101 can be one or more, and the form of terminal equipment 101 is only for example, and terminal equipment 101 can include but not limited to: smart mobile phone (such as Android mobile phone, iOS mobile phone etc.), tablet computer, portable personal computer, Mobile Internet devices (Mobile Internet Devices, MID) and other equipment; terminal equipment is often equipped with a display device, the display device can also be a display, a display screen, a touch screen, etc., and the touch screen can also be a touch screen, a touch panel, etc.
  • smart mobile phone such as Android mobile phone, iOS mobile phone etc.
  • tablet computer portable personal computer
  • Mobile Internet devices Mobile Internet Devices, MID
  • terminal equipment is often equipped with a display device, the display device can also be a display, a display screen, a touch screen, etc., and the touch screen can also be a touch screen, a touch panel, etc.
  • the application examples are not limited.
  • the server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for basic cloud computing services such as middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and big data and artificial intelligence platforms.
  • the server 102 can also be a network node in the blockchain network.
  • the terminal device 101 and the server 102 may be connected directly or indirectly through wired or wireless communication, which is not limited in this application.
  • a user (such as a developer) can send an adjustment instruction to the server 102 through the terminal device 101, so that the server 102 can adjust (such as upgrade or rollback) the target application program deployed in the server 102 according to the adjustment instruction. ).
  • the scenario diagram of data processing of the application program shown in FIG. 1 may only include the terminal device 101.
  • the user may input an adjustment instruction in the terminal device 101, so that the terminal device 101
  • the adjustment instruction adjusts the sub-services in the target application program in the terminal device; for example, the user clicks the "upgrade" button of the application program A to upgrade the application program A during the process of using the computer.
  • FIG. 2 is an architecture diagram of data processing for an application program provided by an embodiment of the present application.
  • the method of the embodiment of the present application is applied to the management terminal, which is a computer device, such as the terminal device used by some users mentioned above, or some server with special functions.
  • the method includes the following steps:
  • the computer device acquires the software installation package of the target application program in response to an adjustment instruction of the target application program (for example, the computer device detects an adjustment instruction input by a user).
  • the adjustment instruction carries the target version identification (that is, the version of the target application program needs to be adjusted to the version indicated by the target version identification through the software installation package), and the target application program includes N sub-services (such as verification sub-service, payment sub-service, multimedia Rendering sub-services, etc.),
  • the software installation package includes N database file sets corresponding to the N sub-services one-to-one, and the N database file sets are obtained from the N images corresponding to the N sub-services one-to-one, and N is positive integer.
  • Mirror image is similar to file compression package. It makes a specific series of files (such as database files) into a single file in a certain format for subsequent use.
  • the installation package of the target application can be obtained by packaging N images corresponding to N sub-services in the target application and related configuration files through an automated assembly line, and the images are developed and provided by developers.
  • the computer device obtains the target image corresponding to the target sub-service in the N sub-services of the target application; creates the target container based on the target image, and extracts the database file from the target image through the target container to obtain the database of the target sub-service A file collection; after the N database file collections of the N sub-services are obtained according to the above operations, the N database file collections are packaged to obtain the software installation package of the target application program.
  • the function of the container is to obtain the database file contained in the image from the image.
  • the software installation package is sent from the target computer device to the computer device; the target computer device is used to obtain the target image corresponding to the target sub-service in the N sub-services; the target container is created based on the target image, and the database file is extracted from the target image through the target container , to obtain the database file set of the target sub-service, the database file set of the target sub-service includes: database files of different versions under the target sub-service, and the database files in the database file set of the target sub-service are named according to the version identifier to which the database file belongs
  • the software installation package of the target application is generated according to the database file set of the target sub-service.
  • the computer device executing the data processing method for the application program is the first computer device
  • the computer device generating the installation package of the target application program may be the first computer device or the second computing device.
  • the first computer device may be a terminal and the second computer device may be a server.
  • the first computer device and the second computer device refer to different operating environments.
  • Each mirror image includes at least one database file, and the identifier of each database file carries the version identifier (such as the version number) corresponding to the database file.
  • each database file needs to be processed according to the preset grammatical rules. Named and stored in the specified path, so that the computer device can identify and obtain the corresponding database file when adjusting the target application program according to the software installation package of the target application program.
  • the computer device adjusts all sub-services (N sub-services) of the target application program according to the collection of N database files (such as upgrading to the target version, or rolling back to the target version);
  • P ⁇ N that is, the computer device adjusts the P sub-services in the target application program according to the P database file sets; for example, the computer device adjusts the P sub-services corresponding to the payment function in the target application program according to the software installation package of the target application program.
  • the process that the computer device adjusts the target application program according to the software installation package of the target application program includes: database file collection (that is, reading the database file required for adjustment from the software installation package of the target application program); Service initialization information management (such as configuring relevant parameters before adjusting the sub-service); sub-service data adjustment (that is, adjusting the data of the sub-service to be adjusted according to the database file corresponding to the sub-service to be adjusted); database initialization adapter (That is, according to the type of the database file, determine the matching initialization adapter).
  • the computer device After the computer device performs batch adjustment on P sub-services according to the software installation package of the target application program, it stores the adjusted sub-services in the database to obtain the adjusted target application program.
  • the adjusted sub-service carries the adjusted database version identifier of the sub-service.
  • the software installation package of the target application program in response to the adjustment instruction of the target application program, the software installation package of the target application program is obtained, and the software installation package includes N database file sets corresponding to N sub-services one-to-one, and the N database file sets It is obtained from N images corresponding to N sub-services one-to-one.
  • the P database file sets in the N database file sets adjust the corresponding P sub-services to the version indicated by the target version identifier, and obtain The data information of the P adjusted sub-services is stored in the database to obtain the adjusted target application program. It can be seen that multiple sub-services in the application program can be adjusted in batches through the collection of N database files obtained from N mirror images, thereby improving the efficiency of application program adjustment.
  • FIG. 3 is a schematic flowchart of a data processing method for an application program provided by an embodiment of the present application.
  • the method in the embodiment of the present application is applied to a computer device, which may be, for example, a terminal device used by some users mentioned above, or a server with special functions.
  • the method includes the following steps.
  • S201 Obtain a software installation package of the target application program in response to an adjustment instruction of the target application program.
  • the adjustment instruction carries a target version identifier
  • the target version identifier is used to indicate the version to which the target application needs to be adjusted; for example, the target version identifier is used to indicate the version to which the target application needs to be upgraded, or, the target version identifier Used to indicate the version that the target application needs to roll back to.
  • the terminal device will upgrade the target application program to version 3.0.1 according to the adjustment instruction;
  • the current version of the application program is identified as 4.1.1, and the target version identification carried in the adjustment instruction is 3.0.1, then the terminal device rolls back the target application program to version 3.0.1 according to the adjustment instruction.
  • the target application program includes N sub-services, and the N sub-services can be divided into M sub-service sets according to division rules (for example, according to the function of each sub-service), M, N is a positive integer, and M is less than or equal to N.
  • the software installation package of the target application program includes N database file sets corresponding to N sub-services one-to-one.
  • the N database file sets are obtained from N mirror images corresponding to N sub-services one-to-one.
  • Each mirror image can be It includes one or more database files, and the identifier of each database file carries the corresponding version identifier (such as the version number) of the database file.
  • the database file is used to describe the operation content such as detailed table creation of the sub-service initialization database.
  • each database file needs to be named according to preset grammar rules and stored in a specified path, so that the computer device can recognize and obtain the target application program when adjusting the target application program according to the software installation package corresponding database file.
  • S202 According to the P database file sets in the N database file sets, adjust the P sub-services in the N sub-services to the version indicated by the target version identifier, and obtain the data information of the P adjusted sub-services, where P is positive Integer, and P is less than or equal to N.
  • the computer device determines the P sub-services to be adjusted from the N sub-services according to the screening rules, and the screening rules can be formulated by the user according to the actual situation; for example, if the user needs to adjust the entire target application program, then The filtering rules can be formulated as all selections; for another example, if the user needs to adjust some sub-services in the target application, the filtering rules can be formulated according to the identification of the sub-services to be adjusted (such as the name and identification number of the sub-services, etc.) .
  • the computer device After determining the P sub-services to be adjusted, the computer device obtains the set of database files corresponding to each of the P sub-services from the software installation package of the target application program; wherein, the set of database files corresponding to each sub-service includes the sub-service Download at least one version of the database file, and each database file is named according to the version identifier to which the database file belongs.
  • the computer device obtains the target image corresponding to the target sub-service in the N sub-services of the target application; creates a target container based on the target image, and extracts the database file from the target image through the target container to obtain the target sub-service A database file set; after the N database file sets of the N sub-services are obtained according to the above operations, the N database file sets are packaged to obtain a software installation package of the target application program.
  • sub-service 1 corresponds to mirror image A
  • mirror image A includes database files from version identification 1.0.0 to version identification 4.3.1
  • the computer device creates container A based on image A, and uses container A from image A Extract (copy) the database files from version identification 1.0.0 to version identification 4.3.1, obtain the database file collection of sub-service 1, after obtaining the database file collection of all sub-services of the target application program, computer equipment will these database files
  • the collection is packaged to obtain the software installation package of the target application.
  • the computer device deletes the created target container to reduce unnecessary resource occupation.
  • the computer device After obtaining the database file sets corresponding to each of the P sub-services from the software installation package, the computer device adjusts the P sub-services according to the database file sets corresponding to each of the P sub-services, and obtains P adjusted Data information of subservices.
  • the computer device determines the matching adapter according to the type of the database file in the database file set corresponding to the target sub-service, and invokes the adapter to execute the database file in the database file set corresponding to the target sub-service to obtain Data information of the adjusted target sub-service.
  • the computer equipment first screens out the database files that meet the conditions from the database file collection according to the current version number and the target version number of the target sub-service, and calls the adapter to execute the database files that meet the conditions in the order of the target to update the target
  • the sub-service is adjusted to obtain the adjusted data information of the target sub-service; for example, if the current version identification of the target sub-service is 2.1.1, and the target version identification is 3.0.1, then the computer device collects Filter out the database files from this identification 2.1.2 to version identification 3.0.1, and call the adapter to execute the database files from this identification 2.1.2 to version identification 3.0.1 in order from small to large; another example, set the target The current version ID of the sub-service is 2.1.1, and the target version ID is 1.0.1, then the computer equipment filters out the database files from the ID 1.0.1 to the version ID 2.1.0 from the database file collection corresponding to the target sub-service, Invoke the adapter to execute the database files from the identification 2.1.0 to the version identification 1.0.1 in descending order.
  • S203 Store the data information of the P adjusted sub-services in a database to obtain an adjusted target application program.
  • the data information of N sub-services of the target application program is stored in the database, and the data information of each sub-service carries the current version identifier of the sub-service.
  • the computer device adjusts the sub-service according to the software installation package of the target application program, the current version identifier of the sub-service will also be updated to the adjusted version identifier, so that the next time the sub-service needs to be adjusted, the computer The device can acquire the current version identifier of the sub-service from the database.
  • the software installation package of the target application program in response to the adjustment instruction of the target application program, the software installation package of the target application program is obtained, and the software installation package includes N database file sets corresponding to N sub-services one-to-one, and the N database file sets It is obtained from N images corresponding to N sub-services one-to-one.
  • the P database file sets in the N database file sets adjust the corresponding P sub-services to the version indicated by the target version identifier, and obtain The data information of the P adjusted sub-services is stored in the database to obtain the adjusted target application program. It can be seen that by mirroring each sub-service, N database file sets corresponding to N sub-services can be obtained. Based on these N database file sets, multiple sub-services in the application can be adjusted in batches, thereby improving the performance of the application. Adjusted efficiency.
  • FIG. 4 is a schematic flow chart of another data processing method for an application program provided by an embodiment of the present application.
  • the method in the embodiment of the present application is applied to a computer device, which may be, for example, a terminal device used by some users mentioned above, or a server with special functions.
  • the method includes the following steps.
  • S301 Obtain a software installation package of the target application program in response to an adjustment instruction of the target application program.
  • the target application program includes N sub-services, and the software installation package of the target application program includes N database file sets corresponding to the N sub-services one-to-one.
  • the set of database files corresponding to the target sub-service may include one or more (that is, database files of different versions under the target sub-service) database files, and each database file is named according to the version identifier to which the database file belongs.
  • the process for the computer device to obtain the software installation package of the target application program includes: obtaining a target image corresponding to the target sub-service in the N sub-services; creating a target container based on the target image, and using the target container to extract Extract the database file to obtain the database file collection of the target sub-service.
  • the computer device creates a target container, and copies the database files in the target image to the target container to obtain a set of database files of the target sub-service. After obtaining N sets of database files corresponding to each of the N sub-services, the computer device packages the N sets of database files into a software installation package of the target application program.
  • each mirror image may include multiple database files (such as a database file for upgrading and a database file for rolling back) that adjust strategies (such as upgrading or rolling back);
  • the database file for adjusting the policy is added to the same database file set, and N database file sets corresponding to each of the N sub-services are obtained.
  • N sub-services belong to M service types, M is a positive integer, and M is less than or equal to N; the software installation package of the target application is to classify and package N database file sets according to M service types obtained after. That is to say, when the software installation package of the target application program packs the N database file collections, it will preprocess the N database file collections (such as classifying or sorting in advance), compared to directly N database file sets are stored in a folder, and preprocessing the N database file sets can enable the computer device to obtain the required database more efficiently when adjusting the target application program according to the software installation package of the target application program Document collection.
  • each sub-service in the target application is deployed according to the sorting rules during deployment, or each sub-service corresponds to a serial number; then when the software installation package of the target application is packaged During the process, the database file collection can be sorted and packaged according to the sorting rules or serial numbers; it is understandable that the computer device can quickly obtain the required database file collection from the software installation package of the target application program according to the sorting rules or serial numbers, without The database file collection in the software installation package of the target application program is traversed and searched each time the database file collection needs to be obtained, which improves the adjustment efficiency of the target application program and effectively saves computer resources.
  • the database files belonging to different functions are stored in different directories, so that the computer equipment performs the target application program according to the software installation package of the target application program. Quickly obtain the required database files when making adjustments.
  • the software installation package corresponding to the target application program is pre-packaged and placed on the computer device (such as stored in the memory) before the adjustment instruction is executed;
  • the computer device such as stored in the memory
  • it is necessary to upgrade application 1 from version 1.0 to version 2.1, before inputting the adjustment command it is necessary to package the database file collection of each sub-service in application 1 from version 1.0 to version 2.1 through the pipeline, and package the obtained software
  • the installation package is placed on the computer device.
  • S302 Determine P sub-services to be adjusted from the N sub-services according to the screening rule.
  • the screening rules can be formulated by the user according to the actual situation; for example, if the user needs to adjust the entire target application, the screening rules can be formulated as all selected (that is, the target application is fully adjusted (all sub-services); and For example, if the user needs to adjust some sub-services in the target application program, he can formulate screening rules according to the identification of the sub-services to be adjusted (such as the name and identification number of the sub-service, etc.) subservices, or only adjust subservices whose id is less than the target id).
  • S303 According to the type of the database file in the database file set corresponding to the target sub-service, determine an adapter matching the database file set corresponding to the target sub-service.
  • the target sub-service may be any one of the P sub-services to be adjusted determined from the N sub-services according to the screening rule.
  • the type of database file can include but not limited to: MySQL type, TDSQL type.
  • the computer device can appropriately modify the file identifier (such as the file name) of the database file. For example, if in the MySQL database, the file ID of the initialization database file is "init_x.x.x.sql", then in order to adapt to the TDSQL database, the device can change the file ID of the initialization database file to "tdsql_init_x.x.x.sql". .
  • the computer device can find all the database files under the type of the database file according to the above grammatical rules, and according to these database files Make adjustments to the target application.
  • S304 Adjust the target sub-service through an adapter matching the database file set corresponding to the target sub-service, and obtain adjusted data information of the target sub-service.
  • the computer device determines the version identification interval according to the current version identification and the target version identification of the target sub-service; for example, if the current version identification of sub-service 1 is 2.1.1, and the target version identification is 3.0.1, Then the computer device determines the version identification interval as 2.1.2 to 3.0.1 according to the current version identification 2.1.1 of sub-service 1 and the target version identification 3.0.1; similarly, set the current version identification of sub-service 1 as 2.1. 1.
  • the target version identifier is 1.2.1, then the computer device determines the version identifier interval as 1.2.1 to 2.1.0 according to the current version identifier 2.1.1 and the target version identifier 1.2.1 of the sub-service 1.
  • the adapter After determining the version identification interval, intelligently call the adapter matching the database file set corresponding to the target sub-service, execute at least one database file in the database file set corresponding to the target sub-service, and obtain the adjusted data information of the target sub-service, at least one
  • the version identifier of the database file belongs to the version identifier range; for example, if the version identifier range is 1.2.1 to 2.1.0, the database file set corresponding to the target sub-service includes: the database file whose version identifier is 1.0.1, and whose version identifier is 1.3 .1 database file, the database file whose version ID is 2.0.1, the database file whose version ID is 2.1.2, and the database file whose version ID is 3.2.1; then the smart call matches the database file set corresponding to the target sub-service
  • the adapter executes the database file whose version ID is 1.3.1 and the database file whose version ID is 2.0.1, and obtains the adjusted data information of the target sub-service.
  • the database file set corresponding to the target sub-service includes a plurality of database files belonging to the version identification interval; the computer device calls the adapter that matches the database file set corresponding to the target sub-service, and sequentially executes the to-be-executed files according to the target order Database file to obtain the adjusted data information of the target sub-service;
  • the database file to be executed includes the database file belonging to the version identification interval in the database file set corresponding to the target sub-service; the target order is determined according to the adjustment strategy of the target sub-service, and the adjustment strategy of the target sub-service is based on the current The version ID and the target version ID are determined.
  • the adjustment strategy includes upgrade and rollback. If the current version identifier of the target sub-service is smaller than the target version identifier, the computer device will adjust the strategy to upgrade, and the target sequence corresponding to the upgrade is from small to large (from old version to new version). version); if the current version identifier of the target sub-service is greater than the target version identifier, the computer device will adjust the strategy to rollback, and the target sequence corresponding to the rollback is from large to small (from new version to old version). In practical applications, drop or delete statements are not allowed in the database file used for upgrading.
  • the computer equipment determines the adjustment policy of the target sub-service as upgrading; Output the database files from this identification 2.1.2 to version identification 3.0.1, and call the adapter to execute the database files from this identification 2.1.2 to version identification 3.0.1 in order from small to large; another example, set the target sub-service
  • the current version ID is 2.1.1, and the target version ID is 1.0.1
  • the computer device determines the adjustment policy of the target sub-service as rollback; the computer device filters out the target sub-service from the database file collection corresponding to the ID 1.0 .1 to version ID 2.1.0, the call adapter executes the database files from this ID 2.1.0 to version ID 1.0.1 in descending order.
  • the identifier of each database file carries an adjustment type field; the computer device determines the adjustment strategy according to the current version identifier and the target version identifier of the target sub-service. Specifically, the computer device determines the target field according to the current version identifier and the target version identifier of the target sub-service, and the target field is used to indicate the adjustment policy. Specifically, if the current version identifier of the target sub-service is smaller than the target version identifier, the computer device determines the first field (such as the "init" field) as the target field; if the current version identifier of the target sub-service is greater than the target version identifier, the computer The device determines the second field (such as the "undo" field) as the target field.
  • the first field and the second field in this application are for example only, and do not constitute an actual limitation of this application. For example, the first field can also be “create", and the second field can also be “delete ".
  • the target field is "init”
  • the database files included in the database file set corresponding to sub-service 1 are: init_1.0.1.sql, init_1.2.3.sql, init_2.0.1.sql, init_3.0.1.sql, undo_1. 0.2.sql, undo_1.3.1.sql, undo_2.2.3.sql, undo_3.1.3.sql; then the computer device determines the database files init_1.2.3.sql and init_2.0.1.sql as database files to be executed.
  • the computer device invokes an adapter matching the set of database files corresponding to the target sub-service, executes the database file to be executed, and obtains the adjusted data information of the target sub-service.
  • the database file will be stored in the specified directory of the mirror; for example, the database file will be stored in /usr/local/ services/sql directory, and the file suffix name of the database file is unified as ".sql".
  • the stability of the target application program during the adjustment process can be improved by standardizing the identification (such as naming) of the database file.
  • the database file for upgrading may be named: init_version number.sql; for example, init_2.5.0.sql.
  • the database file used for rollback can be named: undo_version number.sql; for example, undo_2.5.0.sql.
  • file naming is just a way to facilitate cognition and use, and the scheme is not limited to one naming method. For example, you can also use create_x.sql, delete_x.sql for naming.
  • FIG. 5 is a schematic diagram of upgrading all sub-services of a target application to a version indicated by a target version identifier according to an embodiment of the present application. If a certain version has already been deployed in the computer device, and the target version identifier carried in the adjustment command is greater than the deployed version (that is, the current version), it can be upgraded as shown in Figure 5: the computer device finds the corresponding sub-service The database file collection, the database file collection of the target sub-service includes all the database files carrying the "init" field between the deployment version of the target sub-service and the target version, and then the computer device calls the adapter that matches the type of the database file , according to the serial number of the version identification of the database file, execute all the database files carrying the "init" field between the deployment version of the target sub-service and the target version in the database file set of the target sub-service in ascending order, and obtain the target sub-service Adjusted data information.
  • the adjustment instruction indicates to adjust the target application program from version 1.0.0 to version 2.0.0
  • the target application program includes sub-service A and sub-service B
  • in the database file set corresponding to sub-service A the adjustment type field
  • the data files that are "init” and whose version identification belongs to the version identification interval 1.0.0 to 2.0.0 are: init_1.0.1.sql, init_1.5.1.sql and init_1.5.3.sql three database files, which are called by computer equipment and The adapter that matches the type of the database file will upgrade sub-service A to the version indicated by the target version identifier in the order of init_1.0.1.sql—>init_1.5.1.sql—>init_1.5.3.sql;
  • the adjustment type field is "init"
  • the data files whose version identification belongs to the version identification interval 1.0.0 to 2.0.0 are: init_1.0.1.sql, init_1.5.1.sql and init_1.
  • the computer equipment calls the adapter that matches the type of the database file, and upgrades sub-service B to The version indicated by the target version identifier, similarly, the computer device can upgrade all sub-services in the containers of each sub-service to the version indicated by the target version identifier.
  • FIG. 6 is a schematic diagram of rolling back all sub-services of a target application program to a version indicated by a target version identifier according to an embodiment of the present application. If a certain version has already been deployed in the computer device, and the target version identifier carried in the adjustment command is smaller than the deployment version (that is, the current version), it can be rolled back as shown in Figure 6: the computer device finds the corresponding The database file collection of the target sub-service includes all the database files carrying the "undo" field between the deployment version of the target sub-service and the target version, and then the computer device calls the database file that matches the type of the database file.
  • the adapter executes all the database files carrying the "undo" field between the deployment version of the target sub-service and the target version in the database file set of the target sub-service in descending order according to the serial number of the version identification of the database file, and obtains the target The adjusted data information of the sub-service.
  • the adjustment instruction indicates to adjust the target application program from version 2.0.0 to version 1.0.0
  • the target application program includes sub-service A and sub-service B
  • the database file set corresponding to sub-service A the adjustment type field
  • the data files that are "undo" and whose version identification belongs to the version identification interval 1.0.0 to 2.0.0 are: three database files: undo_1.0.1.sql, undo_1.5.1.sql and undo_1.5.3.sql, which are called by computer equipment and The adapter whose database file type matches will roll back sub-service A to the version indicated by the target version identifier in the order of undo_1.5.3.sql—>init_1.5.1.sql—>init_1.0.1.sql; similarly,
  • the data files whose adjustment type field is "undo” and whose version identifier belongs to the version identifier range 1.0.0 to 2.0.0 are: undo_1.0.1.sql, undo_1.5.1.s
  • the user can specify the sub-services that need to be adjusted by configuring the identification (such as name) of the sub-service and the version identification (such as the version number) of the sub-service. service, the computer device will adjust the sub-service specified by the user independently according to the above-mentioned adjustment strategy, without affecting other sub-services.
  • the data information of each sub-service carries the current version identifier; further, in response to the successful adjustment of the P sub-services; replace the current version identifiers of the P sub-services with the target version identifier , to obtain the data information of P adjusted sub-services; for example, in the data information of sub-service 1 before adjustment, the version identifier is 1.2.1, and the target version identifier is 2.0.1, then in response to the successful adjustment of sub-service 1, the computer The device updates the version identifier in the data information of sub-service 1 to 2.0.1.
  • step S305 Store the data information of the P adjusted sub-services in the database to obtain the adjusted target application program.
  • step S305 Store the data information of the P adjusted sub-services in the database to obtain the adjusted target application program.
  • step S305 For a specific implementation manner of step S305, reference may be made to the implementation manner of step S203 in FIG. 3 , which will not be repeated here.
  • FIG. 7 is a flow chart of data processing for an application program provided by an embodiment of the present application.
  • Step 801 the computer device decompresses the software installation package of the target application program, and splits to obtain each sub-program in the target application program.
  • the database file collection of the service, the database file collection of each sub-service in the target application program is obtained from the image of each sub-service in the target application program by creating a container, and the computer device traverses the database files in each database file collection according to the adjustment instructions, To get a database file that meets the requirements.
  • Step 802 the computer device selects an initialization adapter matching the type of the database file according to the type of the database file. Different database files correspond to different adapters (such as MySQL adapter and TDSQL adapter). In addition, the computer device will also perform some related adaptation operations (such as syntax conversion) according to the type of the database file.
  • Step 803 the computer device calls the initialization adapter to execute the database files in the database file collection of each sub-service in the container according to the size of the version number sequence (execute in ascending order when upgrading, and execute in ascending order when rolling back) small order); in some embodiments, the database files in the database file collection are obtained by filtering according to the filtering rules specified by the user.
  • each sub-service will store the currently deployed version number in the database, and when the computer device detects that the adjustment is successful, update the currently deployed version number to the version number indicated by the target version identifier, so that the subsequent When adjusting the target application program, compare it with the version number carried in the adjustment command.
  • the computer device obtains the database file set corresponding to each sub-service from the image corresponding to each sub-service in the target application program by creating a container, so that each sub-service can only operate its own
  • the database and table, and different sub-services do not interfere with each other, so as to facilitate batch adjustment of multiple sub-services in the target application (that is, centralized management of the database, which can be upgraded or rolled back in batches); through the software installation package
  • Preprocessing naming and sorting
  • the database file collection during the packaging process can further improve the efficiency of target application adjustment; by selecting different adapters, it can adapt to different types of database files, which improves the universality.
  • sub-service developers only need to provide the service container image according to the specification without providing additional content.
  • the container image itself is what is required for containerized deployment, with low transformation costs and low intrusion.
  • FIG. 8 is a schematic structural diagram of a data processing device for application programs provided by an embodiment of the present application.
  • the device can be mounted on the terminal device 101 or the server 102 shown in FIG. 1 .
  • the data processing apparatus for application programs shown in FIG. 8 may be used to execute some or all of the functions in the method embodiments described above in FIG. 3 and FIG. 4 . Among them, the detailed description of each unit is as follows:
  • the acquiring unit 601 is configured to acquire a software installation package of the target application in response to an adjustment instruction of the target application, the adjustment instruction carries a target version identifier, the target application includes N sub-services, and the software installation package includes a one-to-one correspondence with the N sub-services N database file collections, N database file collections are obtained from N mirrors corresponding to N sub-services one by one, and N is a positive integer;
  • the processing unit 602 is configured to adjust the P sub-services in the N sub-services to the version indicated by the target version identifier according to the P database file sets in the N database file sets, and obtain the data information of the P adjusted sub-services , P is a positive integer, and P is less than or equal to N; and used for storing the data information of the P adjusted sub-services in the database to obtain the adjusted target application program.
  • processing unit 602 is specifically configured to:
  • the target sub-service is determined from the N sub-services according to the screening rules to be adjusted. Any sub-service in the service; adjust the target sub-service through an adapter that matches the database file set corresponding to the target sub-service, and obtain the adjusted data information of the target sub-service; repeat this step, and convert the N sub-services
  • the P sub-services of are adjusted to the version indicated by the target version identifier.
  • each image includes at least one database file, and each database file in the at least one database file carries an identifier of a corresponding database; the processing unit 602 is specifically configured to:
  • the adapter that matches the database file set corresponding to the target sub-service, execute at least one database file in the database file set corresponding to the target sub-service, and obtain the adjusted data information of the target sub-service.
  • the version identifier of at least one database file belongs to the version identifier interval.
  • the database file set corresponding to the target sub-service includes multiple database files belonging to the version identification interval; the processing unit 602 is specifically configured to:
  • the database file to be executed includes the database file belonging to the version identification interval in the database file set corresponding to the target sub-service; the target order is determined according to the adjustment strategy of the target sub-service, and the adjustment strategy of the target sub-service is based on the current The version ID and the target version ID are determined.
  • the identifier of each database file carries an adjustment type field; the processing unit 602 is specifically configured to:
  • the database file to be executed is filtered out from the set of database files corresponding to the target sub-service through the adjustment strategy, and the adjustment type field of the database file to be executed matches the adjustment strategy.
  • the data information of each sub-service carries a current version identifier; the processing unit 602 is specifically configured to:
  • the obtaining unit 601 is configured to: obtain a target image corresponding to a target sub-service among the N sub-services; create a target container based on the target image, and use the target container to obtain Extract the database file from the image to obtain the database file set of the target sub-service, the database file set of the target sub-service includes: database files of different versions under the target sub-service, the database file set of the target sub-service The database file is named according to the version identification of the database file; according to the database file set of the target sub-service, the software installation package of the target application is generated;
  • the software installation package is sent by the target computer device to the computer device; the target computer device is used to obtain a target image corresponding to the target sub-service in the N sub-services; create a target container based on the target image, and Extract the database file from the target image by the target container to obtain the database file set of the target sub-service, the database file set of the target sub-service includes: database files of different versions under the target sub-service, so The database files in the database file set of the target sub-service are named according to the version identifier to which the database file belongs; according to the database file set of the target sub-service, the software installation package of the target application program is generated.
  • N sub-services belong to M service types, M is a positive integer, and M is less than or equal to N; the software installation package of the target application is obtained after classifying and encapsulating N database file sets according to M service types of.
  • step S201 shown in FIG. 3 may be executed by the acquiring unit 601 shown in FIG. 8
  • steps S202 and S203 may be executed by the processing unit 602 shown in FIG. 8
  • step S301 shown in FIG. 4 can be executed by the acquiring unit 601 shown in FIG. 8
  • steps S302 to S305 can be executed by the processing unit 602 shown in FIG. 8 .
  • Each unit in the data processing device for the application program shown in Figure 8 can be respectively or all combined into one or several other units to form, or one (some) units can also be split into functionally more It is composed of multiple small units, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above units are divided based on logical functions.
  • the functions of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit.
  • the data processing apparatus for application programs may also include other units.
  • these functions may also be implemented with the assistance of other units, and may be implemented cooperatively by multiple units.
  • a general-purpose computing device such as a computer including processing elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM) and storage elements.
  • CPU central processing unit
  • RAM random access storage medium
  • ROM read-only storage medium
  • Run the computer program (including program code) that can execute the steps involved in the corresponding methods as shown in Figure 3 and Figure 4, to construct the data processing device for the application program as shown in Figure 8, and to realize the present invention
  • the computer program can be recorded on, for example, a computer-readable recording medium, loaded into the above-mentioned computing device via the computer-readable recording medium, and executed therein.
  • FIG. 9 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the computer device includes at least a processor 701 , a communication interface 702 and a memory 703 .
  • the processor 701, the communication interface 702, and the memory 703 may be connected through a bus or in other ways.
  • the processor 701 or central processing unit (Central Processing Unit, CPU)
  • CPU Central Processing Unit
  • the CPU can use It is used to analyze the power-on/off instructions sent by the user to the terminal, and control the terminal to perform power-on/off operations; another example: the CPU can transmit various interactive data between internal structures of the terminal, and so on.
  • the communication interface 702 can optionally include standard wired interfaces and wireless interfaces (such as WI-FI, mobile communication interfaces, etc.), which can be used to send and receive data under the control of the processor 701; the communication interface 702 can also be used for internal data transfer of the terminal transmission and interaction.
  • the memory 703 (Memory) is a storage device in the terminal, and is used to store programs and data.
  • the memory 703 here may include not only a built-in memory of the terminal, but also an extended memory supported by the terminal.
  • the memory 703 provides storage space, which stores the operating system of the terminal, which may include but not limited to: Android system, iOS system, Windows Phone system, etc., which is not limited in this application.
  • the processor 701 executes the following operations by running the executable program code in the memory 703:
  • the software installation package of the target application program is obtained through the communication interface 702, the adjustment instruction carries the target version identifier, the target application program includes N sub-services, and the software installation package includes N sub-services corresponding one-to-one.
  • database file collections, N database file collections are obtained from N mirrors corresponding to N sub-services one-to-one, and N is a positive integer;
  • P sub-services in the N sub-services are adjusted to the version indicated by the target version identifier, and the data information of the P adjusted sub-services is obtained, and P is a positive integer.
  • P is less than or equal to N;
  • a specific embodiment for the processor 701 to acquire the software installation package of the target application program is as follows:
  • the database file set of the target sub-service includes: database files of different versions under the target sub-service, and the target sub-service
  • the database files in the database file collection are named according to the version identifier to which the database file belongs;
  • a software installation package of the target application is generated.
  • the processor 701 adjusts the P sub-services in the N sub-services to the version indicated by the target version identifier according to the P database file sets in the N database file sets.
  • the specific embodiment is as follows:
  • the target sub-service is determined from the N sub-services according to the screening rules to be adjusted. any sub-service in the service;
  • the target sub-service is adjusted through an adapter matching the database file set corresponding to the target sub-service, and the adjusted data information of the target sub-service is obtained.
  • each image includes at least one database file, and each database file in the at least one database file carries the identifier of the corresponding database; the processor 701 compares the database file set corresponding to the target sub-service
  • the matching adapter adjusts the target sub-service, and the specific embodiment of obtaining the adjusted data information of the target sub-service is as follows:
  • the adapter that matches the database file set corresponding to the target sub-service, execute at least one database file in the database file set corresponding to the target sub-service, and obtain the adjusted data information of the target sub-service.
  • the version identifier of at least one database file belongs to the version identifier interval.
  • the database file set corresponding to the target sub-service includes a plurality of database files belonging to the version identification interval; the processor 701 invokes an adapter matching the database file set corresponding to the target sub-service, and executes the target sub-service.
  • At least one database file in the database file set corresponding to the service, the specific embodiment of obtaining the adjusted data information of the target sub-service is as follows:
  • the target order is determined according to the adjustment policy of the target sub-service, and the adjustment policy of the target sub-service is determined according to the current version identifier and the target version identifier of the target sub-service.
  • the identifier of each database file carries an adjustment type field; the processor 701 invokes the adapter matching the database file set corresponding to the target sub-service, and executes the database file set corresponding to the target sub-service.
  • the specific embodiment of obtaining the adjusted data information of the target sub-service is as follows:
  • the data information of each sub-service carries the current version identifier; the processor 701 converts the N sub-services according to the P database file sets in the N database file sets
  • the P sub-services are adjusted to the version indicated by the target version identifier, and the specific embodiment of obtaining the data information of the P adjusted sub-services is as follows:
  • the current version identifiers of the P sub-services are replaced with the target version identifiers to obtain the data information of the P adjusted sub-services.
  • N sub-services belong to M service types, M is a positive integer, and M is less than or equal to N; the software installation package of the target application classifies N database file collections according to M service types obtained after packaging.
  • the problem-solving principle and beneficial effect of the computer equipment provided in the embodiment of the application are similar to the problem-solving principle and beneficial effect of the data processing method of the application program in the method embodiment of the application. Please refer to the implementation of the method The principles and beneficial effects are described briefly and will not be repeated here.
  • the embodiment of the present application also provides a computer-readable storage medium, one or more instructions are stored in the computer-readable storage medium, and one or more instructions are suitable for being loaded by a processor and executing the application program of the above method embodiment data processing method.
  • the embodiment of the present application also provides a computer program product including instructions, which, when run on a computer, causes the computer to execute the data processing method for the application program in the above method embodiment.
  • the embodiment of the present application also provides a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned method for processing data of an application program.
  • the modules in the device of the embodiment of the present application can be combined, divided and deleted according to actual needs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例公开了一种对应用程序的数据处理方法、装置、设备及存储介质。该方法由计算机设备执行,其中方法包括: 响应于目标应用程序的调整指令,获取目标应用程序的软件安装包,该软件安装包包括与N个子服务一一对应的N个数据库文件集合,这N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,根据N个数据库文件集合中的P个数据库文件集合,将与之对应的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。该方法可以提高应用程序调整的效率。

Description

一种对应用程序的数据处理方法、装置、设备及存储介质
本申请要求于2021年05月21日提交的申请号为202110562863.8、发明名称为“一种对应用程序的数据处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及应用程序领域,具体涉及一种对应用程序的数据处理方法、装置、设备及存储介质。
背景技术
随着计算机技术的不断发展,网络中涌现出海量的应用程序。在实际应用中,各个应用程序随着时间的推移往往需要进行调整(如更新,或者回滚)来适应当前的需求,例如,开发人员在对程序漏洞进行修复后,需要对程序进行更新;又例如,新版本程序出现重大错误时,需要回滚到上一版本。实践发现,每个应用程序通常包括多个子服务,在对应用程序进行调整时,需要对每个子服务进行逐一调整,效率较低。
发明内容
本申请实施例提供了一种对应用程序的数据处理方法、装置、设备及存储介质,能够较好地提高应用程序调整的效率。
一方面,本申请实施例提供了一种对应用程序的数据处理方法,所述方法由计算机设备执行,所述方法包括:
响应于目标应用程序的调整指令,获取所述目标应用程序的软件安装包,所述调整指令携带目标版本标识,所述目标应用程序包括N个子服务,所述软件安装包包括与所述N个子服务一一对应的N个数据库文件集合,所述N个数据库文件集合是从与所述N个子服务一一对应的N个镜像中获取的,N为正整数;
根据所述N个数据库文件集合中的P个数据库文件集合,将所述N个子服务中的P个子服务调整至所述目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N;
将所述P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。
另一方面,本申请实施例还提供了一种对应用程序的数据处理装置,包括:
获取单元,用于响应于目标应用程序的调整指令,获取所述目标应用程序的软件安装包,所述调整指令携带目标版本标识,所述目标应用程序包括N个子服务,所述软件安装包包括与所述N个子服务一一对应的N个数据库文件集合,所述N个数据库文件集合是从与所述N个子服务一一对应的N个镜像中获 取的,N为正整数;
处理单元,用于根据所述N个数据库文件集合中的P个数据库文件集合,将所述N个子服务中的P个子服务调整至所述目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N;以及用于将所述P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。
相应地,本申请实施例还提供了一种计算机设备,包括:存储装置和处理器;所述存储装置中存储有计算机程序;处理器,执行计算机程序,实现上述对应用程序的数据处理方法。
相应地,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时,上述对应用程序的数据处理方法被实现。
相应地,本申请提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述对应用程序的数据处理方法。
在本申请实施例中,响应于目标应用程序的调整指令,获取目标应用程序的软件安装包,该软件安装包包括与N个子服务一一对应的N个数据库文件集合,这N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,根据N个数据库文件集合中的P个数据库文件集合,将与之对应的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。可见,通过从N个镜像中获取的N个数据库文件集合可以对应用程序中的多个子服务进行批量调整,进而提高应用程序调整的效率。
附图说明
图1为本申请实施例提供的一种对应用程序的数据处理的场景图;
图2为本申请实施例提供的一种对应用程序的数据处理的架构图;
图3为本申请实施例提供的一种对应用程序的数据处理方法的流程示意图;
图4为本申请实施例提供的另一种对应用程序的数据处理方法的流程示意图;
图5为本申请实施例提供的一种将目标应用程序的所有子服务升级至目标版本标识所指示的版本的示意图;
图6为本申请实施例提供的一种将目标应用程序的所有子服务回滚至目标版本标识所指示的版本的示意图;
图7为本申请实施例提供的一种对应用程序的数据处理流程图;
图8为本申请实施例提供的一种对应用程序的数据处理装置的结构示意图;
图9为本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
请参阅图1,图1为本申请实施例提供的一种对应用程序的数据处理的场景图。如图1所示,对应用程序的数据处理的场景中可包括终端设备101和服务器102。其中,终端设备101是用户所使用的设备。终端设备101的数量可以为一个或多个,终端设备101的形态仅用于举例,终端设备101可以包括但不限于:智能手机(如Android手机、iOS手机等)、平板电脑、便携式个人计算机、移动互联网设备(Mobile Internet Devices,MID)等设备;终端设备往往配置有显示装置,显示装置也可为显示器、显示屏、触摸屏等等,触摸屏也可为触控屏、触控面板等等,本申请实施例不做限定。
服务器102可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式***,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。此外,服务器102还可以是区块链网络中的网络节点。终端设备101和服务器102可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。在一种实施方式中,用户(如开发人员)可以通过终端设备101向服务器102发送调整指令,以使服务器102根据该调整指令对服务器102中部署的目标应用程序进行调整(如升级或者回滚)。
需要说明的是,图1所示的应用程序的处理***中终端设备和服务器的数量仅为举例,例如,终端设备和服务器的数量可以为多个,本申请并不对终端设备和服务器的数量进行限定。
在一个实施例中,图1所示的对应用程序的数据处理的场景图中也可以只包括终端设备101,具体地,用户可以在终端设备101中输入调整指令,以使终端设备101根据该调整指令,对终端设备中的目标应用程序中的子服务进行调整;例如,用户在使用电脑的过程中,通过点击应用程序A的“升级”按钮,来对应用程序A进行升级。
再请参见图2,图2为本申请实施例提供的一种对应用程序的数据处理的架构图。本申请实施例的方法应用于管理端,管理端为计算机设备,该计算机设备例如可以是上述提及的某些用户所使用的终端设备,也可以是某些具有特殊功能的服务器。方法包括如下步骤:
(1)计算机设备(即管理端)响应于目标应用程序的调整指令(例如计算机设备检测到用户输入的调整指令),获取目标应用程序的软件安装包。
其中,调整指令携带目标版本标识(即需要通过软件安装包将目标应用程序的版本调整至目标版本标识所指示的版本),目标应用程序包括N个子服务(如验证子服务、支付子服务、多媒体渲染子服务等等),软件安装包包括与N个子服务一一对应的N个数据库文件集合,N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,N为正整数。镜像与文件压缩包类似,它 将特定的一系列文件(如数据库文件)按照一定的格式制作成单一的文件,以便于后续进行使用。
由图2可知,目标应用程序的安装包可以是由自动化的流水线,对目标应用程序中N个子服务对应的N个镜像以及相关配置文件进行打包后得到的,镜像是由开发人员开发提供的。在一个实施例中,计算机设备获取目标应用程序的N个子服务中目标子服务对应的目标镜像;基于目标镜像创建目标容器,并通过目标容器从目标镜像中提取数据库文件,得到目标子服务的数据库文件集合;在按照上述操作得到N个子服务的N个数据库文件集合后,将这N个数据库文件集合进行打包得到目标应用程序的软件安装包。其中,容器的作用在于从镜像中获取该镜像中包含的数据库文件。
软件安装包为目标计算机设备向计算机设备发送的;目标计算机设备用于获取与N个子服务中目标子服务对应的目标镜像;基于目标镜像创建目标容器,并通过目标容器从目标镜像中提取数据库文件,得到目标子服务的数据库文件集合,目标子服务的数据库文件集合包括:目标子服务下不同版本的数据库文件,目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;根据目标子服务的数据库文件集合,生成目标应用程序的软件安装包。
示例性的,假设执行对应用程序的数据处理方法的计算机设备为第一计算机设备,则生成目标应用程序的安装包的计算机是设备可以是第一计算机设备也可以是第二计算设备。例如,第一计算机设备可以是终端,第二计算机设备可以是服务器。示例性的,第一计算机设备和第二计算机设备是指不同的运行环境。
每个镜像中包括至少一个数据库文件,每个数据库文件的标识中携带有该数据库文件对应的版本标识(如版本号),在一个实施例中,每个数据库文件需要按照预设的语法规则进行命名并存储在指定路径中,以便于计算机设备在根据目标应用程序的软件安装包对目标应用程序进行调整时能够识别并获取对应的数据库文件。
(2)根据N个数据库文件集合中的P个数据库文件集合,将N个子服务中的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N。
当P=N时,即计算机设备根据N个数据库文件集合,对目标应用程序所有的子服务(N个子服务)进行调整(如升级至目标版本,或者回滚至目标版本);当P<N时,即计算机设备根据P个数据库文件集合对目标应用程序中的P个子服务进行调整;例如,计算机设备根据目标应用程序的软件安装包对目标应用程序中支付功能对应的P个子服务进行调整。
由图2可知,计算机设备根据目标应用程序的软件安装包对目标应用程序进行调整的过程包括:数据库文件采集(即从目标应用程序的软件安装包中读取调整所需的数据库文件);子服务初始化信息管理(如在对子服务进行调整前,对相关参数进行配置);子服务数据调整(即根据待调整子服务对应的数据库文 件对待调整子服务的数据进行调整);数据库初始化适配器(即根据数据库文件的类型,确定与之匹配的初始化适配器)。
(3)将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。
由图2可知,计算机设备在根据目标应用程序的软件安装包对P个子服务进行批量调整后,将调整后的子服务存储在数据库中,得到调整后的目标应用程序。在一种实施方式中,调整后的子服务中携带有该子服务调整后的数据库版本标识。
在本申请实施例中,响应于目标应用程序的调整指令,获取目标应用程序的软件安装包,该软件安装包包括与N个子服务一一对应的N个数据库文件集合,这N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,根据N个数据库文件集合中的P个数据库文件集合,将与之对应的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。可见,通过从N个镜像中获取的N个数据库文件集合可以对应用程序中的多个子服务进行批量调整,进而提高应用程序调整的效率。
请参阅图3,图3为本申请实施例提供的一种对应用程序的数据处理方法的流程示意图。本申请实施例的方法应用于计算机设备,该计算机设备例如可以是上述提及的某些用户所使用的终端设备,也可以是某些具有特殊功能的服务器。方法包括如下步骤。
S201:响应于目标应用程序的调整指令,获取目标应用程序的软件安装包。其中,调整指令携带目标版本标识,目标版本标识用于指示目标应用程序所需要调整至的版本;示例性的,目标版本标识用于指示目标应用程序所需要升级至的版本,或,目标版本标识用于指示目标应用程序所需要回滚至的版本。例如,设目标应用程序的当前版本标识为1.2.1,调整指令携带的目标版本标识为3.0.1,则终端设备根据该调整指令将目标应用程序升级至3.0.1版本;又例如,设目标应用程序的当前版本标识为4.1.1,调整指令携带的目标版本标识为3.0.1,则终端设备根据该调整指令将目标应用程序回滚至3.0.1版本。
目标应用程序包括N个子服务,这N个子服务可以按照划分规则(如按照各个子服务的功能进行划分)为M个子服务集合,M,N为正整数,且M小于等于N。目标应用程序的软件安装包中包括与N个子服务一一对应的N个数据库文件集合,这N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,每个镜像可以包括一个或多个数据库文件,每个数据库文件的标识中携带有该数据库文件对应的版本标识(如版本号),数据库文件用于描述子服务初始化数据库的详细建表等操作内容。
在一个实施例中,每个数据库文件需要按照预设的语法规则进行命名并存储在指定路径中,以便于计算机设备在根据目标应用程序的软件安装包对目标应用程序进行调整时能够识别并获取对应的数据库文件。
S202:根据N个数据库文件集合中的P个数据库文件集合,将N个子服务中的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N。
在一种实施方式中,计算机设备根据筛选规则从N个子服务中确定出待调整的P个子服务,筛选规则可以是用户根据实际情况制定的;例如,用户需要对整个目标应用程序进行调整,则可以将筛选规则制定为全选;又如,用户需要对目标应用程序中的部分子服务进行调整,则可以根据需要调整的子服务的标识(如子服务的名称、标识号等)制定筛选规则。
在确定出待调整的P个子服务之后,计算机设备从目标应用程序的软件安装包,获取P个子服务中各个子服务对应的数据库文件集合;其中,每个子服务对应的数据库文件集合包括该子服务下至少一个版本的数据库文件,每个数据库文件是根据该数据库文件所属的版本标识命名的。
在一种实施方式中,计算机设备获取目标应用程序的N个子服务中目标子服务对应的目标镜像;基于目标镜像创建目标容器,并通过目标容器从目标镜像中提取数据库文件,得到目标子服务的数据库文件集合;在按照上述操作得到N个子服务的N个数据库文件集合后,将这N个数据库文件集合进行打包得到目标应用程序的软件安装包。例如,子服务1与镜像A相对应,设镜像A中包括从版本标识1.0.0至版本标识4.3.1的数据库文件;则计算机设备基于镜像A创建容器A,并通过容器A从镜像A中提取(拷贝)出从版本标识1.0.0至版本标识4.3.1的数据库文件,得到子服务1的数据库文件集合,在得到目标应用程序所有子服务的数据库文件集合后,计算机设备将这些数据库文件集合进行打包得到目标应用程序的软件安装包。在一个实施例中,在从目标镜像中提取得到数据文件集合后,计算机设备会删除掉创建的目标容器,以降低不必要的资源占用。
在从软件安装包中获取P个子服务中各个子服务对应的数据库文件集合后,计算机设备根据P个子服务中各个子服务对应的数据库文件集合,对P个子服务进行调整,得到P个调整后的子服务的数据信息。在一种实施方式中,计算机设备根据目标子服务对应的数据库文件集合中数据库文件的类型,确定与之匹配的适配器,并调用该适配器执行目标子服务对应的数据库文件集合中的数据库文件,得到调整后的目标子服务的数据信息。在调整过程中,计算机设备首先根据目标子服务的当前版本号和目标版本号,从数据库文件集合中筛选出满足条件的数据库文件,并调用适配器按照目标顺序执行满足条件的数据库文件,来对目标子服务进行调整,得到目标子服务调整后的数据信息;例如,设目标子服务当前的版本标识为2.1.1,目标版本标识为3.0.1,则计算机设备从目标子服务对应的数据库文件集合中筛选出从本标识2.1.2至版本标识3.0.1的数据库文件,调用适配器按照从小到大的顺序依次执行从本标识2.1.2至版本标识3.0.1的数据库文件;又例如,设目标子服务当前的版本标识为2.1.1,目标版本标识为1.0.1,则计算机设备从目标子服务对应的数据库文件集合中筛选出从本标识1.0.1至版本标识2.1.0的数据库文件,调用适配器按照从大至小的顺序依 次执行从本标识2.1.0至版本标识1.0.1的数据库文件。
S203:将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。在一种实施方式中,数据库中存储有目标应用程序的N个子服务的数据信息,每个子服务的数据信息中携带有该子服务的当前版本标识。当计算机设备根据目标应用程序的软件安装包对子服务进行调整后,该子服务的当前版本标识也会随之更新至调整后的版本标识,以便于下次需要对子服务进行调整时,计算机设备可以从数据库中获取该子服务当前的版本标识。
在本申请实施例中,响应于目标应用程序的调整指令,获取目标应用程序的软件安装包,该软件安装包包括与N个子服务一一对应的N个数据库文件集合,这N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,根据N个数据库文件集合中的P个数据库文件集合,将与之对应的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。可见,通过与各个子服务对应镜像,可以得到与N个子服务一一对应的N个数据库文件集合,基于这N个数据库文件集合可以对应用程序中的多个子服务进行批量调整,进而提高应用程序调整的效率。
请参阅图4,图4为本申请实施例提供的另一种对应用程序的数据处理方法的流程示意图。本申请实施例的方法应用于计算机设备,该计算机设备例如可以是上述提及的某些用户所使用的终端设备,也可以是某些具有特殊功能的服务器。方法包括如下步骤。
S301:响应于目标应用程序的调整指令,获取目标应用程序的软件安装包。目标应用程序包括N个子服务,目标应用程序的软件安装包中包括与N个子服务一一对应的N个数据库文件集合。目标子服务对应的数据库文件集合中可以包括一个或多个(即包括目标子服务下不同版本的数据库文件)数据库文件,每个数据库文件是根据该数据库文件所属的版本标识命名的。
在一种实施方式中,计算机设备获取目标应用程序的软件安装包的过程包括:获取与N个子服务中目标子服务对应的目标镜像;基于目标镜像创建目标容器,并通过目标容器从目标镜像中提取数据库文件,得到目标子服务的数据库文件集合。在一个实施例中,计算机设备创建目标容器,并将目标镜像中的数据库文件拷贝至目标容器中,得到目标子服务的数据库文件集合。在得到N个子服务各自对应的N个数据库文件集合后,计算机设备将这N个数据库文件集合打包为目标应用程序的软件安装包。
具体地,每个镜像中可以包括多个调整策略(如升级,或者回滚)的数据库文件(如用于进行升级的数据库文件和用于进行回滚的数据库文件);计算机设备可以将多个调整策略的数据库文件添加在同一数据库文件集合中,得到N个子服务各自对应的N个数据库文件集合。也可以根据调整策略,将不同调整策略的数据库文件添加在不同的数据库文件集合中;例如,将用于进行升级的数据库文件添加在升级数据库文件集合中,将用于进行回滚的数据库文件添加 在回滚数据库文件集合中;进一步地,将N个子服务各自对应的N个升级数据库文件集合打包在升级软件安装包中,将N个子服务各自对应的N个回滚数据库文件集合打包在回滚软件安装包中。
在另一种实施方式中,N个子服务属于M个服务类型,M为正整数,且M小于等于N;目标应用程序的软件安装包是根据M个服务类型对N个数据库文件集合进行分类封装后得到的。也就是说,目标应用程序的软件安装包在对N个数据库文件集合进行打包的过程中,会对这N个数据库文件集合进行预处理(如预先进行分类,或者排序),相较于直接将N个数据库文件集合存放在一个文件夹中,对N个数据库文件集合进行预处理可以使得计算机设备在根据目标应用程序的软件安装包对目标应用程序进行调整时能更高效的获取所需的数据库文件集合。
在一个实施例中,设目标应用程序中的各个子服务在部署时是按照排序规则进行部署的,又或者各个子服务对应有一个序列号;则在对目标应用程序的软件安装包进行打包的过程中,可以按照排序规则或者序列号对数据库文件集合进行排序打包;可以理解的是,计算机设备可以根据排序规则或者序列号快速从目标应用程序的软件安装包获取所需的数据库文件集合,无需每次在需要获取数据库文件集合时对目标应用程序的软件安装包中的数据库文件集合进行遍历搜索,提高了目标应用程序的调整效率,同时也有效地节省了计算机资源。
在再一个实施例中,在对N个数据库文件集合进行打包的过程中,将属于不同功能的数据库文件存放在不同的目录下,使得计算机设备在根据目标应用程序的软件安装包对目标应用程序进行调整时能快速的获取所需的数据库文件。
需要说明的是,目标应用程序所对应的软件安装包是在执行调整指令前,预先完成打包并放置在计算机设备上的(如存储在存储器中);在一个实施例中,在需要将目标应用程序中的一个或多个子服务升级至更高版本时,需要预约通过流水线对升级所需要用到的数据库文件集合进行打包,并将打包得到的软件安装包放置在计算机设备上;例如,设用户需要将应用程序1从版本1.0升级至版本2.1,则在输入调整指令前,需要通过流水线对应用程序1中各个子服务从版本1.0至版本2.1的数据库文件集合进行打包,并将打包得到的软件安装包放置在计算机设备上。
S302:根据筛选规则从N个子服务中确定出待调整的P个子服务。筛选规则可以是用户根据实际情况制定的;例如,用户需要对整个目标应用程序进行调整,则可以将筛选规则制定为全选(即对目标应用程序进行全量(所有的子服务)调整);又如,用户需要对目标应用程序中的部分子服务进行调整,则可以根据需要调整的子服务的标识(如子服务的名称、标识号等)制定筛选规则(如只调整名称中携带目标字段的子服务,或者只调整标识号小于目标标识号的子服务)。
S303:根据目标子服务对应的数据库文件集合中数据库文件的类型,确定与目标子服务对应的数据库文件集合相匹配的适配器。目标子服务可以是根据筛选规则从N个子服务中确定出的待调整的P个子服务中的任一个子服务。数 据库文件的类型可以包括但不限于:MySQL类型,TDSQL类型。
在实际部署过程中,可能会遇到导入的数据库文件的类型不同而需要执行的数据库操作语句不同的情况。例如,MySQL数据库与TDSQL数据库存在一定的差异,针对数据库存在差异的场景,计算机设备可以将数据库文件的文件标识(如文件名)进行适当修改。例如,设在MySQL数据库中,初始化数据库文件的文件标识为“init_x.x.x.sql”,则为了适配TDSQL数据库,这能设备可以将初始化数据库文件的文件标识修改为“tdsql_init_x.x.x.sql”即可。用户在对目标应用程序进行调整时,指定目标应用程序的软件安装包中数据库文件的类型,计算机设备即可按照上述语法规则,找到该数据库文件的类型下所有的数据库文件,并根据这些数据库文件对目标应用程序进行调整。
S304:通过与目标子服务对应的数据库文件集合相匹配的适配器对目标子服务进行调整,得到目标子服务调整后的数据信息。
重复执行步骤303和步骤304,将N个子服务中的P个子服务调整至目标版本标识所指示的版本。
在一种实施方式中,计算机设备根据目标子服务的当前版本标识和目标版本标识,确定版本标识区间;例如,设子服务1的当前版本标识为2.1.1,目标版本标识为3.0.1,则计算机设备根据子服务1的当前版本标识2.1.1和目标版本标识3.0.1,将版本标识区间确定为2.1.2至3.0.1;同理,设子服务1的当前版本标识为2.1.1,目标版本标识为1.2.1,则计算机设备根据子服务1的当前版本标识2.1.1和目标版本标识1.2.1,将版本标识区间确定为1.2.1至2.1.0。
在确定版本标识区间后,智能调用与目标子服务对应的数据库文件集合相匹配的适配器,执行目标子服务对应的数据库文件集合中至少一个数据库文件,得到目标子服务调整后的数据信息,至少一个数据库文件的版本标识属于版本标识区间;例如,设版本标识区间为1.2.1至2.1.0,目标子服务对应的数据库文件集合中包括:版本标识为1.0.1的数据库文件,版本标识为1.3.1的数据库文件,版本标识为2.0.1的数据库文件,版本标识为2.1.2的数据库文件和版本标识为3.2.1的数据库文件;则智能调用与目标子服务对应的数据库文件集合相匹配的适配器,执行版本标识为1.3.1的数据库文件和版本标识为2.0.1的数据库文件,得到目标子服务调整后的数据信息。
在一个实施例中,目标子服务对应的数据库文件集合中包括多个属于版本标识区间的数据库文件;计算机设备调用与目标子服务对应的数据库文件集合相匹配的适配器,按照目标顺序依次执行待执行数据库文件,得到目标子服务调整后的数据信息;
其中,待执行数据库文件包括目标子服务对应的数据库文件集合中属于版本标识区间的数据库文件;目标顺序是根据目标子服务的调整策略确定的,目标子服务的调整策略是根据目标子服务的当前版本标识与目标版本标识确定的。
具体地,调整策略包括升级与回滚,若目标子服务的当前版本标识小于目标版本标识,则计算机设备将调整策略为升级,与升级对应的目标顺序为由小到大(由旧版本到新版本);若目标子服务的当前版本标识大于目标版本标识, 则计算机设备将调整策略为回滚,与回滚对应的目标顺序为由大到小(由新版本到旧版本)。在实际应用中,用于升级的数据库文件中不允许使用drop或delete语句。
例如,设目标子服务当前的版本标识为2.1.1,目标版本标识为3.0.1,则计算机设备将目标子服务的调整策略确定为升级;计算机设备从目标子服务对应的数据库文件集合中筛选出从本标识2.1.2至版本标识3.0.1的数据库文件,调用适配器按照从小到大的顺序依次执行从本标识2.1.2至版本标识3.0.1的数据库文件;又例如,设目标子服务当前的版本标识为2.1.1,目标版本标识为1.0.1,则计算机设备将目标子服务的调整策略确定为回滚;计算机设备从目标子服务对应的数据库文件集合中筛选出从本标识1.0.1至版本标识2.1.0的数据库文件,调用适配器按照从大至小的顺序依次执行从本标识2.1.0至版本标识1.0.1的数据库文件。
在另一个实施例中,每个数据库文件的标识中携带有调整类型字段;计算机设备根据目标子服务的当前版本标识和目标版本标识,确定调整策略。具体地,计算机设备根据目标子服务的当前版本标识和目标版本标识,确定目标字段,目标字段用于指示调整策略。具体地,若目标子服务的当前版本标识小于目标版本标识,则计算机设备将第一字段(如“init”字段)确定为目标字段;若目标子服务的当前版本标识大于目标版本标识,则计算机设备将第二字段(如“undo”字段)确定为目标字段。需要说明的是,本申请中的第一字段和第二字段仅用于举例,并不构成本申请的实际限定,例如,第一字段还可以是“create”,第二字段还可以是“delete”。
通过调整策略从目标子服务对应的数据库文件集合中,筛选出待执行数据库文件,待执行数据库文件的调整类型字段与调整策略相匹配;具体地,计算机设备根据目标字段从目标子服务对应的数据库文件集合中,筛选出文件标识中携带目标字段,且版本标识属于版本标识区间的数据库文件,并将这些数据库文件确定为待执行数据库文件;例如,设版本标识区间确定为1.2.1至2.1.0,目标字段为“init”,子服务1对应的数据库文件集合中包括的数据库文件为:init_1.0.1.sql、init_1.2.3.sql、init_2.0.1.sql、init_3.0.1.sql、undo_1.0.2.sql、undo_1.3.1.sql、undo_2.2.3.sql、undo_3.1.3.sql;则计算机设备将数据库文件init_1.2.3.sql和init_2.0.1.sql确定为待执行的数据库文件。
进一步地,计算机设备调用与目标子服务对应的数据库文件集合相匹配的适配器,执行待执行数据库文件,得到目标子服务调整后的数据信息。
在实际应用中,若计算机设备检测到当前存在对数据库进行调整的操作(如初始化数据库),则统一将数据库文件存放在镜像的指定目录中;例如,将数据库文件统一存放在/usr/local/services/sql目录下,并将数据库文件的文件后缀名统一为“.sql”。进一步地,可以通过对数据库文件的标识(如命名)进行规范,来提高目标应用程序在调整过程中的稳定性。在一个实施例中,用于进行升级的数据库文件可以命名为:init_版本号.sql;例如,init_2.5.0.sql。用于进行回滚的数据库文件可以命名为:undo_版本号.sql;例如,undo_2.5.0.sql。需要说明的 是,文件命名只是一种方便认知和使用的一种方式,该方案对于命名方式不限于一种。例如,还可以使用create_x.sql,delete_x.sql进行命名。
图5为本申请实施例提供的一种将目标应用程序的所有子服务升级至目标版本标识所指示的版本的示意图。若计算机设备中已经部署了某个版本,且调整指令中携带的目标版本的标识大于部署版本(即当前版本),则可以按照如图5所示的方式升级:计算机设备找到每个子服务对应的数据库文件集合,目标子服务的数据库文件集合中,包括了目标子服务的部署版本与目标版本之间所有的携带“init”字段的数据库文件,然后计算机设备调用与数据库文件的类型相匹配的适配器,按照数据库文件的版本标识的序号从小到大的顺序执行目标子服务的数据库文件集合中在目标子服务的部署版本与目标版本之间所有的携带“init”字段的数据库文件,得到目标子服务调整后的数据信息。
如图5所示,设调整指令指示将目标应用程序从1.0.0版本调整至2.0.0版本,目标应用程序包括子服务A和子服务B,子服务A对应的数据库文件集合中,调整类型字段为“init”,且版本标识属于版本标识区间1.0.0到2.0.0的数据文件为:init_1.0.1.sql、init_1.5.1.sql和init_1.5.3.sql三个数据库文件,计算机设备调用与数据库文件的类型相匹配的适配器,按照init_1.0.1.sql—>init_1.5.1.sql—>init_1.5.3.sql的顺序,将子服务A升级至目标版本标识所指示的版本;同理,子服务B对应的数据库文件集合中,调整类型字段为“init”,且版本标识属于版本标识区间1.0.0到2.0.0的数据文件为:init_1.0.1.sql、init_1.5.1.sql和init_1.8.0.sql三个数据库文件,计算机设备调用与数据库文件的类型相匹配的适配器,按照init_1.0.1.sql—>init_1.5.1.sql—>init_1.8.0.sql的顺序,将子服务B升级至目标版本标识所指示的版本,类似地,计算机设备可以在各个子服务的容器中将所有的子服务均升级至目标版本标识所指示的版本。
图6为本申请实施例提供的一种将目标应用程序的所有子服务回滚至目标版本标识所指示的版本的示意图。若计算机设备中已经部署了某个版本,且调整指令中携带的目标版本的标识小于部署版本(即当前版本),则可以按照如图6所示的方式回滚:计算机设备找到每个子服务对应的数据库文件集合,目标子服务的数据库文件集合中,包括了目标子服务的部署版本与目标版本之间所有的携带“undo”字段的数据库文件,然后计算机设备调用与数据库文件的类型相匹配的适配器,按照数据库文件的版本标识的序号从大到小的顺序执行目标子服务的数据库文件集合中在目标子服务的部署版本与目标版本之间所有的携带“undo”字段的数据库文件,得到目标子服务调整后的数据信息。
如图6所示,设调整指令指示将目标应用程序从2.0.0版本调整至1.0.0版本,目标应用程序包括子服务A和子服务B,子服务A对应的数据库文件集合中,调整类型字段为“undo”,且版本标识属于版本标识区间1.0.0到2.0.0的数据文件为:undo_1.0.1.sql、undo_1.5.1.sql和undo_1.5.3.sql三个数据库文件,计算机设备调用与数据库文件的类型相匹配的适配器,按照undo_1.5.3.sql—>init_1.5.1.sql—>init_1.0.1.sql的顺序,将子服务A回滚至目标 版本标识所指示的版本;同理,子服务B对应的数据库文件集合中,调整类型字段为“undo”,且版本标识属于版本标识区间1.0.0到2.0.0的数据文件为:undo_1.0.1.sql、undo_1.5.1.sql和undo_1.8.0.sql三个数据库文件,计算机设备调用与数据库文件的类型相匹配的适配器,按照undo_1.8.0.sql—>init_1.5.1.sql—>init_1.0.1.sql的顺序,将子服务B回滚至目标版本标识所指示的版本,类似地,计算机设备可以在各个子服务的容器中将所有的子服务均回滚至目标版本标识所指示的版本。
可以理解的是,对于目标应用程序中某些功能模块希望单独升级的场景,用户可以通过配置子服务的标识(如名称)与子服务的版本标识(如版本号)来指定需要进行调整的子服务,计算机设备会按照上述调整策略,对这用户所指定的子服务单独进行调整,而不影响其他子服务。
在一种实施方式中,P个子服务中,每个子服务的数据信息中均携带有当前版本标识;进一步地,响应于P个子服务调整成功;将P个子服务的当前版本标识替换为目标版本标识,得到P个调整后的子服务的数据信息;例如,子服务1调整前的数据信息中,版本标识为1.2.1,目标版本标识为2.0.1,则响应于子服务1调整成功,计算机设备将子服务1的数据信息中的版本标识更新为2.0.1。
S305:将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。步骤S305的具体实施方式可参考图3中步骤S203的实施方式,在此不再赘述。
图7为本申请实施例提供的一种对应用程序的数据处理流程图。下面结合图2和图7对本申请实施例提供的一种对应用程序的数据处理方法进行完整介绍:步骤801,计算机设备通过解压目标应用程序的软件安装包,拆分得到目标应用程序中每个子服务的数据库文件集合,目标应用程序中每个子服务的数据库文件集合是通过创建容器从目标应用程序中每个子服务的镜像中获取的,计算机设备根据调整指令遍历各个数据库文件集合中的数据库文件,以得到符合要求的数据库文件。步骤802,计算机设备根据数据库文件的类型选择与数据库文件的类型相匹配的初始化适配器。不同的数据库文件对应不同的适配器(例如MySQL适配器和TDSQL适配器),此外,计算机设备还会根据数据库文件的类型做一些相关的适配操作(如语法转换)。步骤803,计算机设备调用初始化适配器按照版本号序列大小,在容器中执行每个子服务的数据库文件集合中的数据库文件(在升级时按照由小到大的顺序执行,在回滚时按照由大到小的顺序执行);在一些实施例中,数据库文件集合中的数据库文件是根据用户指定的筛选规则筛选得到的。步骤804,每个子服务均会在数据库中存储当前已经部署的版本号,当计算机设备检测到调整成功时,将当前已经部署的版本号更新至目标版本标识所指示的版本号,以便于后续在对目标应用程序进行调整时,与调整指令中携带的版本号进行比对。
本申请实施例在图3实施例的基础上,计算机设备通过创建容器从目标应用程序中各个子服务对应的镜像中获取各个子服务对应的数据库文件集合,可以使得每个子服务均只操作自己的数据库与表,不同子服务均互不干涉,以便 于对目标应用程序中的多个子服务进行批量调整(即对数据库进行集中化管理,可以批量的升级或者回滚数据库);通过在软件安装包的打包过程中对数据库文件集合进行预处理(命名、排序),可以进一步提高目标应用程序调整的效率;通过选择不同的适配器,可以适配不同类型的数据库文件,提高了普适性。此外,子服务开发者只需按照规范提供服务容器镜像即可,无需提供额外的内容。而容器镜像本身就是容器化部署所需内容,改造成本低,侵入性低。
上述详细阐述了本申请实施例的方法,为了便于更好地实施本申请实施例的上述方案,相应地,下面提供了本申请实施例的装置。
请参见图8,图8为本申请实施例提供的一种对应用程序的数据处理装置的结构示意图,该装置可以搭载在图1所示的终端设备101,或者服务器102上。图8所示的对应用程序的数据处理装置可以用于执行上述图3和图4所描述的方法实施例中的部分或全部功能。其中,各个单元的详细描述如下:
获取单元601,用于响应于目标应用程序的调整指令,获取目标应用程序的软件安装包,调整指令携带目标版本标识,目标应用程序包括N个子服务,软件安装包包括与N个子服务一一对应的N个数据库文件集合,N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,N为正整数;
处理单元602,用于根据N个数据库文件集合中的P个数据库文件集合,将N个子服务中的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N;以及用于将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。
在一个实施例中,处理单元602,具体用于:
根据筛选规则从N个子服务中确定出待调整的P个子服务;
根据目标子服务对应的数据库文件集合中数据库文件的类型,确定与目标子服务对应的数据库文件集合相匹配的适配器,目标子服务是根据筛选规则从N个子服务中确定出的待调整的P个子服务中的任一个子服务;通过与目标子服务对应的数据库文件集合相匹配的适配器对目标子服务进行调整,得到目标子服务调整后的数据信息;重复本步骤,将所述N个子服务中的所述P个子服务调整至所述目标版本标识所指示的版本。
在一个实施例中,每个镜像中包括至少一个数据库文件,至少一个数据库文件中的各个数据库文件携带有对应的数据库的标识;处理单元602,具体用于:
根据目标子服务的当前版本标识和目标版本标识,确定版本标识区间;
调用与目标子服务对应的数据库文件集合相匹配的适配器,执行目标子服务对应的数据库文件集合中至少一个数据库文件,得到目标子服务调整后的数据信息,至少一个数据库文件的版本标识属于版本标识区间。
在一个实施例中,目标子服务对应的数据库文件集合中包括多个属于版本标识区间的数据库文件;处理单元602,具体用于:
调用与目标子服务对应的数据库文件集合相匹配的适配器,按照目标顺序依次执行待执行数据库文件,得到目标子服务调整后的数据信息;
其中,待执行数据库文件包括目标子服务对应的数据库文件集合中属于版本标识区间的数据库文件;目标顺序是根据目标子服务的调整策略确定的,目标子服务的调整策略是根据目标子服务的当前版本标识与目标版本标识确定的。
在一个实施例中,每个数据库文件的标识中携带有调整类型字段;处理单元602,具体用于:
根据目标子服务的当前版本标识和目标版本标识,确定调整策略;
通过调整策略从目标子服务对应的数据库文件集合中,筛选出待执行数据库文件,待执行数据库文件的调整类型字段与调整策略相匹配。
在一个实施例中,P个子服务中,每个子服务的数据信息中均携带有当前版本标识;处理单元602,具体用于:
响应于P个子服务调整成功;
将P个子服务的当前版本标识替换为目标版本标识。
在一个实施例中,所述获取单元601,用于:获取与所述N个子服务中目标子服务对应的目标镜像;基于所述目标镜像创建目标容器,并通过所述目标容器从所述目标镜像中提取数据库文件,得到所述目标子服务的数据库文件集合,所述目标子服务的数据库文件集合包括:所述目标子服务下不同版本的数据库文件,所述目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;根据所述目标子服务的数据库文件集合,生成所述目标应用程序的软件安装包;
或,
所述软件安装包为目标计算机设备向所述计算机设备发送的;所述目标计算机设备用于获取与所述N个子服务中目标子服务对应的目标镜像;基于所述目标镜像创建目标容器,并通过所述目标容器从所述目标镜像中提取数据库文件,得到所述目标子服务的数据库文件集合,所述目标子服务的数据库文件集合包括:所述目标子服务下不同版本的数据库文件,所述目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;根据所述目标子服务的数据库文件集合,生成所述目标应用程序的所述软件安装包。
在一个实施例中,N个子服务属于M个服务类型,M为正整数,且M小于等于N;目标应用程序的软件安装包是根据M个服务类型对N个数据库文件集合进行分类封装后得到的。
根据本申请的一个实施例,图3和图4所示的对应用程序的数据处理方法所涉及的部分步骤可由图8所示的对应用程序的数据处理装置中的各个单元来执行。例如,图3中所示的步骤S201可由图8所示的获取单元601执行,步骤S202和步骤S203可由图8所示的处理单元602执行。图4中所示的步骤S301可由图8所示的获取单元601执行,步骤S302-步骤S305可由图8所示的处理单元602执行。图8所示的对应用程序的数据处理装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实 际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,对应用程序的数据处理装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算装置上运行能够执行如图3和图4中所示的相应方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图8中所示的对应用程序的数据处理装置,以及来实现本申请实施例的对应用程序的数据处理方法。计算机程序可以记载于例如计算机可读记录介质上,并通过计算机可读记录介质装载于上述计算装置中,并在其中运行。
基于同一发明构思,本申请实施例中提供的对应用程序的数据处理装置解决问题的原理与有益效果与本申请方法实施例中对应用程序的数据处理装置解决问题的原理和有益效果相似,可以参见方法的实施的原理和有益效果,为简洁描述,在这里不再赘述。
请参阅图9,图9为本申请实施例提供的一种计算机设备的结构示意图,计算机设备至少包括处理器701、通信接口702和存储器703。其中,处理器701、通信接口702和存储器703可通过总线或其他方式连接。其中,处理器701(或称中央处理器(Central Processing Unit,CPU))是终端的计算核心以及控制核心,其可以解析终端内的各类指令以及处理终端的各类数据,例如:CPU可以用于解析用户向终端所发送的开关机指令,并控制终端进行开关机操作;再如:CPU可以在终端内部结构之间传输各类交互数据,等等。通信接口702可选的可以包括标准的有线接口、无线接口(如WI-FI、移动通信接口等),受处理器701的控制可以用于收发数据;通信接口702还可以用于终端内部数据的传输以及交互。存储器703(Memory)是终端中的记忆设备,用于存放程序和数据。可以理解的是,此处的存储器703既可以包括终端的内置存储器,当然也可以包括终端所支持的扩展存储器。存储器703提供存储空间,该存储空间存储了终端的操作***,可包括但不限于:Android***、iOS***、Windows Phone***等等,本申请对此并不作限定。
在本申请实施例中,处理器701通过运行存储器703中的可执行程序代码,用于执行如下操作:
响应于目标应用程序的调整指令,通过通信接口702获取目标应用程序的软件安装包,调整指令携带目标版本标识,目标应用程序包括N个子服务,软件安装包包括与N个子服务一一对应的N个数据库文件集合,N个数据库文件集合是从与N个子服务一一对应的N个镜像中获取的,N为正整数;
根据N个数据库文件集合中的P个数据库文件集合,将N个子服务中的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N;
将P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。
作为一种可选的实施例,处理器701获取目标应用程序的软件安装包的具体实施例为:
获取与N个子服务中目标子服务对应的目标镜像;
基于目标镜像创建目标容器,并通过目标容器从目标镜像中提取数据库文件,得到目标子服务的数据库文件集合,目标子服务的数据库文件集合包括:目标子服务下不同版本的数据库文件,目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;
根据目标子服务的数据库文件集合,生成目标应用程序的软件安装包。
作为一种可选的实施例,处理器701根据N个数据库文件集合中的P个数据库文件集合,将N个子服务中的P个子服务调整至目标版本标识所指示的版本的具体实施例为:
根据筛选规则从N个子服务中确定出待调整的P个子服务;
根据目标子服务对应的数据库文件集合中数据库文件的类型,确定与目标子服务对应的数据库文件集合相匹配的适配器,目标子服务是根据筛选规则从N个子服务中确定出的待调整的P个子服务中的任一个子服务;
通过与目标子服务对应的数据库文件集合相匹配的适配器对目标子服务进行调整,得到目标子服务调整后的数据信息。
作为一种可选的实施例,每个镜像中包括至少一个数据库文件,至少一个数据库文件中的各个数据库文件携带有对应的数据库的标识;处理器701通过与目标子服务对应的数据库文件集合相匹配的适配器对目标子服务进行调整,得到目标子服务调整后的数据信息的具体实施例为:
根据目标子服务的当前版本标识和目标版本标识,确定版本标识区间;
调用与目标子服务对应的数据库文件集合相匹配的适配器,执行目标子服务对应的数据库文件集合中至少一个数据库文件,得到目标子服务调整后的数据信息,至少一个数据库文件的版本标识属于版本标识区间。
作为一种可选的实施例,目标子服务对应的数据库文件集合中包括多个属于版本标识区间的数据库文件;处理器701调用与目标子服务对应的数据库文件集合相匹配的适配器,执行目标子服务对应的数据库文件集合中至少一个数据库文件,得到目标子服务调整后的数据信息的具体实施例为:
调用与目标子服务对应的数据库文件集合相匹配的适配器,按照目标顺序依次执行目标子服务对应的数据库文件集合中属于版本标识区间的数据库文件,得到目标子服务调整后的数据信息;
目标顺序是根据目标子服务的调整策略确定的,目标子服务的调整策略是根据目标子服务的当前版本标识与目标版本标识确定的。
作为一种可选的实施例,每个数据库文件的标识中携带有调整类型字段;处理器701调用与目标子服务对应的数据库文件集合相匹配的适配器,执行目标子服务对应的数据库文件集合中至少一个数据库文件,得到目标子服务调整 后的数据信息的具体实施例为:
根据目标子服务的当前版本标识和目标版本标识,确定调整策略;
通过调整策略从目标子服务对应的数据库文件集合中,筛选出待执行数据库文件,待执行数据库文件的调整类型字段与调整策略相匹配;
调用与目标子服务对应的数据库文件集合相匹配的适配器,执行待执行数据库文件,得到目标子服务调整后的数据信息。
作为一种可选的实施例,P个子服务中,每个子服务的数据信息中均携带有当前版本标识;处理器701根据N个数据库文件集合中的P个数据库文件集合,将N个子服务中的P个子服务调整至目标版本标识所指示的版本,得到P个调整后的子服务的数据信息的具体实施例为:
响应于P个子服务调整成功;
将P个子服务的当前版本标识替换为目标版本标识,得到P个调整后的子服务的数据信息。
作为一种可选的实施例,N个子服务属于M个服务类型,M为正整数,且M小于等于N;目标应用程序的软件安装包是根据M个服务类型对N个数据库文件集合进行分类封装后得到的。
基于同一发明构思,本申请实施例中提供的计算机设备解决问题的原理与有益效果与本申请方法实施例中对应用程序的数据处理方法解决问题的原理和有益效果相似,可以参见方法的实施的原理和有益效果,为简洁描述,在这里不再赘述。
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有一条或多条指令,一条或多条指令适于由处理器加载并执行上述方法实施例的对应用程序的数据处理方法。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,可读存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
本申请实施例还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述方法实施例的对应用程序的数据处理方法。
本申请实施例还提供一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述对应用程序的数据处理的方法。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。
本申请实施例装置中的模块可以根据实际需要进行合并、划分和删减。

Claims (18)

  1. 一种对应用程序的数据处理方法,所述方法由计算机设备执行,所述方法包括:
    响应于目标应用程序的调整指令,获取所述目标应用程序的软件安装包,所述调整指令携带目标版本标识,所述目标应用程序包括N个子服务,所述软件安装包包括与所述N个子服务一一对应的N个数据库文件集合,所述N个数据库文件集合是从与所述N个子服务一一对应的N个镜像中获取的,N为正整数;
    根据所述N个数据库文件集合中的P个数据库文件集合,将所述N个子服务中的P个子服务调整至所述目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N;
    将所述P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。
  2. 如权利要求1所述的方法,所述根据所述N个数据库文件集合中的P个数据库文件集合,将所述N个子服务中的P个子服务调整至所述目标版本标识所指示的版本,包括:
    根据筛选规则从N个子服务中确定出待调整的P个子服务;
    根据目标子服务对应的数据库文件集合中数据库文件的类型,确定与所述目标子服务对应的数据库文件集合相匹配的适配器,所述目标子服务是根据所述筛选规则从所述N个子服务中确定出的待调整的P个子服务中的任一个子服务;通过与所述目标子服务对应的数据库文件集合相匹配的适配器对所述目标子服务进行调整,得到所述目标子服务调整后的数据信息;
    重复本步骤,将所述N个子服务中的所述P个子服务调整至所述目标版本标识所指示的版本。
  3. 如权利要求2所述的方法,每个镜像中包括至少一个数据库文件,所述至少一个数据库文件中的各个数据库文件携带有对应的数据库的标识;所述通过与所述目标子服务对应的数据库文件集合相匹配的适配器对所述目标子服务进行调整,得到所述目标子服务调整后的数据信息,包括:
    根据所述目标子服务的当前版本标识和所述目标版本标识,确定版本标识区间;
    调用与所述目标子服务对应的数据库文件集合相匹配的适配器,执行所述目标子服务对应的数据库文件集合中至少一个数据库文件,得到所述目标子服务调整后的数据信息,所述至少一个数据库文件的版本标识属于所述版本标识区间。
  4. 如权利要求3所述的方法,所述目标子服务对应的数据库文件集合中包括 多个属于所述版本标识区间的数据库文件;
    所述调用与所述目标子服务对应的数据库文件集合相匹配的适配器,执行所述目标子服务对应的数据库文件集合中至少一个数据库文件,得到所述目标子服务调整后的数据信息,包括:
    调用与所述目标子服务对应的数据库文件集合相匹配的适配器,按照目标顺序依次执行待执行数据库文件,得到所述目标子服务调整后的数据信息;
    其中,所述待执行数据库文件包括所述目标子服务对应的数据库文件集合中属于所述版本标识区间的数据库文件;所述目标顺序是根据所述目标子服务的调整策略确定的,所述目标子服务的调整策略是根据所述目标子服务的当前版本标识与所述目标版本标识确定的。
  5. 如权利要求4所述的方法,每个数据库文件的标识中携带有调整类型字段;所述方法还包括:
    根据所述目标子服务的当前版本标识和所述目标版本标识,确定调整策略;
    通过所述调整策略从所述目标子服务对应的数据库文件集合中,筛选出所述待执行数据库文件,所述待执行数据库文件的调整类型字段与所述调整策略相匹配。
  6. 如权利要求1至5任一所述的方法,所述P个子服务中,每个子服务的数据信息中均携带有当前版本标识;
    所述方法还包括:
    响应于所述P个子服务调整成功;
    将所述P个子服务的当前版本标识替换为所述目标版本标识。
  7. 如权利要求1至5任一所述的方法,所述方法还包括:
    获取与所述N个子服务中目标子服务对应的目标镜像;基于所述目标镜像创建目标容器,并通过所述目标容器从所述目标镜像中提取数据库文件,得到所述目标子服务的数据库文件集合,所述目标子服务的数据库文件集合包括:所述目标子服务下不同版本的数据库文件,所述目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;根据所述目标子服务的数据库文件集合,生成所述目标应用程序的所述软件安装包;
    或,
    所述软件安装包为目标计算机设备向所述计算机设备发送的;所述目标计算机设备用于获取与所述N个子服务中目标子服务对应的目标镜像;基于所述目标镜像创建目标容器,并通过所述目标容器从所述目标镜像中提取数据库文件,得到所述目标子服务的数据库文件集合,所述目标子服务的数据库文件集合包括:所述目标子服务下不同版本的数据库文件,所述目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;根据所述目标子服务的数据库文件集合,生成所述目标应用程序的所述软件安装包。
  8. 如权利要求7所述的方法,所述N个子服务属于M个服务类型,M为正整数,且M小于等于N;所述目标应用程序的所述软件安装包是根据所述M个服务类型对所述N个数据库文件集合进行分类封装后得到的。
  9. 一种对应用程序的数据处理装置,包括:
    获取单元,用于响应于目标应用程序的调整指令,获取所述目标应用程序的软件安装包,所述调整指令携带目标版本标识,所述目标应用程序包括N个子服务,所述软件安装包包括与所述N个子服务一一对应的N个数据库文件集合,所述N个数据库文件集合是从与所述N个子服务一一对应的N个镜像中获取的,N为正整数;
    处理单元,用于根据所述N个数据库文件集合中的P个数据库文件集合,将所述N个子服务中的P个子服务调整至所述目标版本标识所指示的版本,得到P个调整后的子服务的数据信息,P为正整数,且P小于等于N;以及用于将所述P个调整后的子服务的数据信息存储至数据库中,得到调整后的目标应用程序。
  10. 如权利要求9所述的装置,所述处理单元,用于:
    根据筛选规则从N个子服务中确定出待调整的P个子服务;
    根据目标子服务对应的数据库文件集合中数据库文件的类型,确定与所述目标子服务对应的数据库文件集合相匹配的适配器,所述目标子服务是根据所述筛选规则从所述N个子服务中确定出的待调整的P个子服务中的任一个子服务;通过与所述目标子服务对应的数据库文件集合相匹配的适配器对所述目标子服务进行调整,得到所述目标子服务调整后的数据信息;重复本步骤,将所述N个子服务中的所述P个子服务调整至所述目标版本标识所指示的版本。
  11. 如权利要求10所述的装置,每个镜像中包括至少一个数据库文件,所述至少一个数据库文件中的各个数据库文件携带有对应的数据库的标识;所述处理单元,用于:
    根据所述目标子服务的当前版本标识和所述目标版本标识,确定版本标识区间;
    调用与所述目标子服务对应的数据库文件集合相匹配的适配器,执行所述目标子服务对应的数据库文件集合中至少一个数据库文件,得到所述目标子服务调整后的数据信息,所述至少一个数据库文件的版本标识属于所述版本标识区间。
  12. 如权利要求11所述的装置,所述目标子服务对应的数据库文件集合中包括多个属于所述版本标识区间的数据库文件;所述处理单元,用于:
    调用与所述目标子服务对应的数据库文件集合相匹配的适配器,按照目标 顺序依次执行待执行数据库文件,得到所述目标子服务调整后的数据信息;
    其中,所述待执行数据库文件包括所述目标子服务对应的数据库文件集合中属于所述版本标识区间的数据库文件;所述目标顺序是根据所述目标子服务的调整策略确定的,所述目标子服务的调整策略是根据所述目标子服务的当前版本标识与所述目标版本标识确定的。
  13. 如权利要求12所述的装置,每个数据库文件的标识中携带有调整类型字段;所述处理单元,用于:
    根据所述目标子服务的当前版本标识和所述目标版本标识,确定调整策略;
    通过所述调整策略从所述目标子服务对应的数据库文件集合中,筛选出所述待执行数据库文件,所述待执行数据库文件的调整类型字段与所述调整策略相匹配。
  14. 如权利要求9至13任一所述的装置,所述P个子服务中,每个子服务的数据信息中均携带有当前版本标识;所述处理单元,用于:
    响应于所述P个子服务调整成功;
    将所述P个子服务的当前版本标识替换为所述目标版本标识。
  15. 如权利要求9至13任一所述的装置,
    所述获取单元,用于:获取与所述N个子服务中目标子服务对应的目标镜像;基于所述目标镜像创建目标容器,并通过所述目标容器从所述目标镜像中提取数据库文件,得到所述目标子服务的数据库文件集合,所述目标子服务的数据库文件集合包括:所述目标子服务下不同版本的数据库文件,所述目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;根据所述目标子服务的数据库文件集合,生成所述目标应用程序的软件安装包;
    或,
    所述软件安装包为目标计算机设备向所述计算机设备发送的;所述目标计算机设备用于获取与所述N个子服务中目标子服务对应的目标镜像;基于所述目标镜像创建目标容器,并通过所述目标容器从所述目标镜像中提取数据库文件,得到所述目标子服务的数据库文件集合,所述目标子服务的数据库文件集合包括:所述目标子服务下不同版本的数据库文件,所述目标子服务的数据库文件集合中的数据库文件是根据该数据库文件所属的版本标识命名的;根据所述目标子服务的数据库文件集合,生成所述目标应用程序的所述软件安装包。
  16. 如权利要求15所述的装置,所述N个子服务属于M个服务类型,M为正整数,且M小于等于N;所述目标应用程序的所述软件安装包是根据所述M个服务类型对所述N个数据库文件集合进行分类封装后得到的。
  17. 一种计算机设备,包括:存储装置和处理器;
    所述存储装置中存储有计算机程序;
    处理器,执行所述计算机程序,实现如权利要求1-8任一项所述的对应用程序的数据处理方法。
  18. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时,如权利要求1-8任一项所述的对应用程序的数据处理方法被实现。
PCT/CN2021/108730 2021-02-05 2021-07-27 一种对应用程序的数据处理方法、装置、设备及存储介质 WO2022241947A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/299,381 US20230289165A1 (en) 2021-02-05 2023-04-12 Data processing method and apparatus for application, device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110562863.8 2021-02-05
CN202110562863.8A CN114675872A (zh) 2021-05-21 2021-05-21 一种对应用程序的数据处理方法、装置、设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/299,381 Continuation US20230289165A1 (en) 2021-02-05 2023-04-12 Data processing method and apparatus for application, device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022241947A1 true WO2022241947A1 (zh) 2022-11-24

Family

ID=82070556

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/108730 WO2022241947A1 (zh) 2021-02-05 2021-07-27 一种对应用程序的数据处理方法、装置、设备及存储介质

Country Status (3)

Country Link
US (1) US20230289165A1 (zh)
CN (1) CN114675872A (zh)
WO (1) WO2022241947A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560756B (zh) * 2023-07-12 2024-04-16 鹏城实验室 服务编排方法、电子设备、计算机可读存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023881A (zh) * 2010-12-14 2011-04-20 福建星网锐捷网络有限公司 一种软件升级方法、装置及嵌入式设备
CN110231948A (zh) * 2019-06-10 2019-09-13 腾讯科技(成都)有限公司 应用程序方法、装置、***、存储介质和计算机设备
CN111813601A (zh) * 2020-07-09 2020-10-23 中国工商银行股份有限公司 有状态分布式集群的微服务回滚方法及装置
CN111857762A (zh) * 2019-04-30 2020-10-30 戴尔产品有限公司 微服务更新***
US20210064360A1 (en) * 2019-08-27 2021-03-04 Sap Se Time-dependent activation of configuration content
CN112702373A (zh) * 2019-10-23 2021-04-23 中兴通讯股份有限公司 微服务升级文件发送方法、接收方法、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023881A (zh) * 2010-12-14 2011-04-20 福建星网锐捷网络有限公司 一种软件升级方法、装置及嵌入式设备
CN111857762A (zh) * 2019-04-30 2020-10-30 戴尔产品有限公司 微服务更新***
CN110231948A (zh) * 2019-06-10 2019-09-13 腾讯科技(成都)有限公司 应用程序方法、装置、***、存储介质和计算机设备
US20210064360A1 (en) * 2019-08-27 2021-03-04 Sap Se Time-dependent activation of configuration content
CN112702373A (zh) * 2019-10-23 2021-04-23 中兴通讯股份有限公司 微服务升级文件发送方法、接收方法、设备及存储介质
CN111813601A (zh) * 2020-07-09 2020-10-23 中国工商银行股份有限公司 有状态分布式集群的微服务回滚方法及装置

Also Published As

Publication number Publication date
CN114675872A (zh) 2022-06-28
US20230289165A1 (en) 2023-09-14

Similar Documents

Publication Publication Date Title
CN112000348B (zh) 服务灰度发布的控制方法、装置、计算机设备
US11032140B2 (en) Using a template to update a stack of resources
US11422853B2 (en) Dynamic tree determination for data processing
CN101719073B (zh) 一种基于智能客户端的按需下载实现方法
CN112532413B (zh) 基于微服务架构的业务支撑Saas***、方法、介质及设备
CN114073058B (zh) 基于网络的媒体处理(nbmp)的方法、设备以及计算机介质
CN111045683A (zh) 小程序代码编译方法、装置、设备及介质
CN109885332A (zh) 画质芯片软件升级方法、装置、显示设备及存储介质
CN112114849A (zh) 一种资源更新方法和装置
WO2022241947A1 (zh) 一种对应用程序的数据处理方法、装置、设备及存储介质
CN109408471B (zh) 一种基于匹配树的压缩包解压方法、装置及存储介质
CN110737458A (zh) 一种代码更新方法和相关装置
CN113596087A (zh) 应用升级方法、装置及计算机可读存储介质
CN113110851A (zh) 资源的加载方法、装置、电子设备和介质
CN110505289B (zh) 文件下载方法及装置、计算机可读介质、无线通信设备
CN108334374A (zh) 组件动态加载与执行的方法和装置
CN114564210A (zh) 一种副本部署方法、装置、***、电子设备及存储介质
CN113204558A (zh) 数据表结构自动更新方法和装置
US11017032B1 (en) Document recovery utilizing serialized data
Lee et al. An efficient application-device matching method for the mobile software ecosystem
CN104679782A (zh) 文件版本控制***及方法
US20240202207A1 (en) Distributed function data transformation system
WO2024001569A1 (zh) 网络配置方法、装置以及存储介质、电子装置
CN118092982B (zh) 一种云原生应用的多集群运维方法、设备及介质
CN116701234B (zh) 应用程序的调试方法、装置、计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21940396

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 19/01/2024)