Instance-based data automatic upgrading method, device and equipment

CN115878158BActive Publication Date: 2026-09-22BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211666164.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-09-22
Estimated Expiration
2042-12-23

AI Technical Summary

Benefits of technology

[0014]根据本公开的第五方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序,所述计算机程序存储在可读存储介质中,电子设备的至少一个处理器可以从所述可读存储介质读取所述计算机程序,所述至少一个处理器执行所述计算机程序使得电子设备执行第一方面所述的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878158B_ABST
    Figure CN115878158B_ABST
Patent Text Reader

Abstract

The present disclosure provides an instance-based data automatic upgrading method, device and equipment, and relates to the technical field of cloud services. The specific implementation scheme is: obtaining a current data version of application business data indicated by an upgrading request; repeating the following steps until the application business data is upgraded to a to-be-upgraded data version: upgrading the application business data from the current data version to an i-th preset data version based on an instance; determining that the i-th preset data version is a new current data version, and writing the i-th preset data version into a preset field in a preset database based on the instance; and determining that the value of i is increased by 1. The present disclosure provides a chain-type layer-by-layer upgrading manner. If a new data version needs to be introduced, only a processing logic between a data version and the new data version needs to be provided, thereby reducing the development cost of the data version. The data upgrading demand between any two data versions is supported, and the data version upgrading capability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of cloud service technology, and in particular to a method, apparatus and device for automatic data upgrade based on instances. Background Technology

[0002] Applications contain application business data, which is stored on the server side. Applications are typically delivered as instances on various private servers. Upgrading an application involves not only upgrading the application program but also upgrading the application business data. Currently, there is an urgent need for a solution that can automatically upgrade application business data. Summary of the Invention

[0003] This disclosure provides an instance-based automatic data upgrade method, apparatus, and device for automatically upgrading application business data.

[0004] According to a first aspect of this disclosure, an instance-based automatic data upgrade method is provided, comprising:

[0005] In response to an upgrade request, the current data version of the application service data indicated by the upgrade request is obtained; wherein, the upgrade request is used to indicate an upgrade of the application service data, and the upgrade request includes the data version of the application service data to be upgraded;

[0006] Repeat the following steps until the application business data is upgraded from the current data version to the data version to be upgraded: upgrade the application business data from the current data version to the i-th preset data version based on the instance; determine the i-th preset data version as the new current data version, and write the i-th preset data version into a preset field in a preset database based on the instance, wherein the preset field is used to record the data version of the application business data; determine the value of i plus 1, where i is a positive integer greater than or equal to 1.

[0007] According to a second aspect of this disclosure, an instance-based automatic data upgrade apparatus is provided, comprising:

[0008] An acquisition unit is configured to, in response to an upgrade request, acquire the current data version of the application service data indicated by the upgrade request; wherein the upgrade request is used to indicate an upgrade of the application service data, and the upgrade request includes the data version of the application service data to be upgraded;

[0009] Repeat the upgrade unit and the first determination unit until the application service data is upgraded from the current data version to the data version to be upgraded:

[0010] The upgrade unit is used to upgrade the application business data from the current data version to the i-th preset data version based on the instance;

[0011] The first determining unit is used to determine that the i-th preset data version is the new current data version, and write the i-th preset data version into a preset field in the preset database based on the instance, wherein the preset field is used to record the data version of the application business data; and to determine that the value of i is incremented by 1, wherein i is a positive integer greater than or equal to 1.

[0012] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.

[0013] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the above-described method.

[0014] According to a fifth aspect of this disclosure, a computer program product is provided, the computer program product comprising: a computer program stored in a readable storage medium, wherein at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the method described in the first aspect.

[0015] According to the scheme disclosed herein, in response to an upgrade request, the current data version of the application business data indicated by the upgrade request is obtained; the upgrade request includes the data version of the application business data to be upgraded. Then, the following steps are repeated until the application business data is upgraded from the current data version to the data version to be upgraded: the application business data is upgraded from the current data version to the i-th preset data version based on the instance; the i-th preset data version is determined as the new current data version, and the i-th preset data version is written to a preset field in the preset database based on the instance; the value of i is incremented by 1. Thus, in the scenario of upgrading application business data based on the instance, the automatic upgrade of application business data is completed based on the instance. Furthermore, through the above repeated steps, a chain-like layer-by-layer upgrade method can be provided; if a new data version of the application business data under the instance needs to be introduced, only the processing logic between the data version and the new data version needs to be provided, reducing the development cost of the data version of the application business data. Moreover, since the chain-like layer-by-layer upgrade method can support the data upgrade requirements between any two data versions, the data version upgrade capability of application business data is improved.

[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0017] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0018] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;

[0019] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure;

[0020] Figure 3 This is a schematic diagram of the processor provided in the embodiments of this disclosure. Figure 1 ;

[0021] Figure 4 This is a schematic diagram of the processor provided in the embodiments of this disclosure. Figure 2 ;

[0022] Figure 5 This is a schematic diagram according to the third embodiment of the present disclosure;

[0023] Figure 6 This is a schematic diagram according to the fourth embodiment of the present disclosure;

[0024] Figure 7 This is a schematic diagram according to the fifth embodiment of the present disclosure;

[0025] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0026] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0027] The application contains application business data. The application itself is delivered as instances to each private device, essentially deploying the application on each independent device. The application business data is stored on a server (i.e., the server-side). Upgrading the application involves not only upgrading the application's program on the private device but also upgrading the application business data on the server.

[0028] For example, an application (APP) is an instance, and the data generated based on the APP is application business data. This application business data is stored on the server; the server also...

[0029] It can have different software versions of the application. The app is deployed on various independent private devices. When updating the application, it is necessary to update the application's software version and application business data on the server.

[0030] For example, a chat application can be deployed on multiple independent private devices. The data and documents generated by the chat application constitute application business data; this data is stored on a server, which may also contain the chat application's software version. When updating the chat application, both the application business data and the software version on the server need to be updated.

[0031] 0. Among them, the software version update of the application and the application business data update of the application are two...

[0032] These are two independent processes.

[0033] When upgrading application business data, if there are multiple instances of the same application, each instance is deployed on a corresponding independent device. In this case, there are multiple instances.

[0034] Based on the application's business data, it can be seen that in a multi-instance scenario, the same application business data is stored on the server. Therefore, the application's business data is upgraded on the server side.

[0035] At the higher levels, it is necessary to ensure data consistency and compatibility; furthermore, it is also necessary to ensure data idempotency.

[0036] In one example, when upgrading application business data, a manual upgrade process can be performed.

[0037] The system can provide data upgrade tools and upgrade documentation, allowing users to manually upgrade application business data on the server using the data upgrade tools based on the operation instructions in the upgrade documentation.

[0038] However, the above process requires manual intervention for upgrades, which is inefficient and prone to errors.

[0039] One example demonstrates an automatic upgrade method. It can automatically upgrade the current version of application business data to the version to be upgraded.

[0040] 5. However, automatic retrying is not supported in the above process. If the upgrade fails, manual intervention is required.

[0041] For example, when network instability occurs, upgrades may fail, and automatic retrying is not possible. Furthermore, simultaneous startup of multiple instances for upgrades is not supported.

[0042] This disclosure provides an instance-based automatic data upgrade method, apparatus, and device, applied in the field of cloud service technology, to achieve the purpose of automatically upgrading application business data.

[0043] To help readers gain a deeper understanding of the implementation principles of this disclosure, the following will be discussed in conjunction with... Figures 2-4 right Figure 1 The illustrated embodiments are further refined.

[0044] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure, as shown below. Figure 1 As shown, an instance-based automatic data upgrade method is provided, which includes:

[0045] S101. In response to the upgrade request, obtain the current data version of the application business data indicated by the upgrade request; wherein, the upgrade request is used to indicate the upgrade of the application business data, and the upgrade request includes the data version of the application business data to be upgraded.

[0046] For example, the executing entity of this embodiment can be an electronic device, a terminal device, a server, or other apparatus or device capable of executing this embodiment, and there is no limitation thereto. In this embodiment, the executing entity is described as an electronic device.

[0047] For the same application, there are multiple instances, each deployed on a corresponding independent private device. The application business data generated by each instance of the application is stored on the server (i.e., the server-side). Furthermore, in this case, each instance of the application corresponds to the same application business data. Therefore, in the case of multiple instances, the same application business data is stored on the server.

[0048] For example, consider a chat application that can be deployed as instances on multiple independent private devices. The data and documents generated by the chat application constitute application business data; this data is stored on a server, which may also contain versions of the chat application. Therefore, for this chat application, the application business data generated by the instances on each private device is the same set of application business data.

[0049] An electronic device receives an upgrade request, which instructs that application business data be upgraded, and includes the version of the application business data to be upgraded. The electronic device can be a device on which an instance of the application is deployed.

[0050] In one example, a user interacts with an electronic device to input an upgrade command; the electronic device then generates an upgrade request based on the user's action. Alternatively, another device may send an upgrade request to the electronic device.

[0051] Then, based on the upgrade request, the electronic device obtains the current data version of the application service data indicated in the upgrade request.

[0052] In one example, the upgrade request includes the current version of the application business data. Alternatively, the application business data is stored in a pre-set database on the server, and the server's pre-set database also stores the current version of the application business data; thus, after receiving the upgrade request, the electronic device retrieves the current version of the application business data indicated by the upgrade request from the server's pre-set database.

[0053] S102. Repeat the following steps until the application business data is upgraded from the current data version to the version to be upgraded.

[0054] Upgrade data version: Based on the instance, upgrade the application business data from the current data version to the i-th preset data version; determine the i-th preset data version as the new current data version, and write the i-th preset data version into the preset field in the preset database based on the instance, where the preset field is used to record the data version of the application business data; determine the value of i plus 1, where i is a positive integer greater than or equal to 1.

[0055] For example, the electronic device obtains the current data version of the application business data, and the upgrade request includes the data version of the application business data to be upgraded; thus, the electronic device performs version upgrade processing on the application business data in the server.

[0056] The application corresponding to the application business data is deployed as an instance on a private device. The electronic device running the instance upgrades the application business data from the current data version to the i-th preset data version.

[0057] Furthermore, the electronic device determines that the i-th preset data version is the new current data version. Based on the instance, the electronic device writes the i-th preset data version into a preset field in the server's preset database; thus, the server updates the current data version of the application business data to the i-th preset data version, and the server records the updated data version of the application business data. The value of i is incremented by 1 to obtain i+1.

[0058] Then, the electronic device upgrades the application service data from the current data version to the (0i+1)th preset data version, and the electronic device determines that the (i+1)th preset data version is new.

[0059] The electronic device, based on the instance, writes the (i+1)th preset data version into a preset field in the server's preset database; thus, the server updates the current data version of the application business data to the (i+1)th preset data version again, and the server records...

[0060] The application business data is updated to the new version. Then, the value of `i` is incremented by 1 to get `i+2.5`, and so on, until the application business data is upgraded to the version to be upgraded. Furthermore, the electronic device needs to write the version to be upgraded into a preset field in the server's preset database; thus, the server updates the current version of the application business data to the version to be upgraded.

[0061] For example, for application A, various instances of application A are deployed on multiple private devices 0. The application business data generated by each instance of application A is stored in a pre-defined database on the server. The pre-defined database on the server has a pre-defined field that records the current data version V1 of the application business data of application A.

[0062] After receiving the upgrade request, the electronic device retrieves the current data version V1 of the application business data of application A from the server's preset database; the upgrade request includes the data version V4 of the application business data of application A to be upgraded.

[0063] Then, the electronic device runs an instance to upgrade the application business data of application A from the current data version V1 to the first preset data version V2; the electronic device determines the first preset data version V2 as the new current data version, and writes the first preset data version V2 into the preset field of the preset database based on the instance; thus, the preset field in the preset database records the current data version V2 of the application business data of application A.

[0064] Then, the electronic device upgrades the application business data of application A from the current data version V2 to the second preset data version V3 based on the instance. The electronic device determines the second preset data version V3 as the new current data version and writes the preset data version V3 into the preset field in the preset database based on the instance. Thus, the preset field in the preset database records the current data version V3 of the application business data of application A.

[0065] Then, the electronic device upgrades the application business data of application A from the current data version V3 to the third preset data version V4 based on the instance. The electronic device determines the third preset data version V4 as the new current data version and writes the third preset data version V4 into the preset field of the preset database based on the instance. Thus, the preset field in the preset database records the current data version V4 of the application business data of application A.

[0066] Therefore, based on the instance, the electronic device upgrades the application business data of application A to the data version V4 to be upgraded. Furthermore, the current data version V4 of application A's application business data is recorded in a preset field of the server's preset database. This completes the data upgrade of application A2's application business data.

[0067] In this embodiment, in response to an upgrade request, the current data version of the application business data indicated by the upgrade request is obtained; the upgrade request includes the data version of the application business data to be upgraded. Then, the following steps are repeated until the application business data is upgraded from the current data version to the data version to be upgraded: the application business data is upgraded from the current data version to the i-th preset data version based on the instance; the i-th preset data version is determined as the new current data version, and the i-th preset data version is written to a preset field in the preset database based on the instance; the value of i is incremented by 1. Thus, in the scenario of upgrading application business data based on the instance, the automatic upgrade of application business data is completed based on the instance. Furthermore, through the above repeated steps, a chain-like layer-by-layer upgrade method can be provided; if a new data version of the application business data under the instance needs to be introduced, only the processing logic between the data version and the new data version needs to be provided, reducing the development cost of application business data data versions. Moreover, since the chain-like layer-by-layer upgrade method can support data upgrade requirements between any two data versions, the data version upgrade capability of application business data is improved.

[0068] Figure 2 This is a schematic diagram based on the second embodiment of the present disclosure, as shown below. Figure 2 As shown, an instance-based automatic data upgrade method is provided, which includes:

[0069] S201. In response to the upgrade request, run the instance and perform lock-grabbing processing based on the lock-grabbing mechanism. The upgrade request indicates that application business data needs to be upgraded, and includes the version of the application business data to be upgraded.

[0070] In one example, the device corresponding to the running instance has a priority; step S201 includes: in response to the upgrade request, the running instance performs a lock-grabbing process based on the priority of the device of the running instance and a lock-grabbing mechanism.

[0071] In one example, the priority is determined based on a preset relationship, which is used to indicate the relationship between the device's performance parameters, the device's processing capability information, and the device's priority; where the performance parameters characterize the device's performance, and the processing capability information characterizes the device's processing capability.

[0072] For example, the executing entity of this embodiment can be an electronic device, a terminal device, a server, or other apparatus or device capable of executing this embodiment, and there is no limitation thereto. In this embodiment, the executing entity is described as an electronic device.

[0073] For the same application, there are multiple instances, each deployed on a corresponding independent private device. Application business data generated by each instance of the application is stored on a server (i.e., the server-side). Furthermore, in this case, each instance of the application corresponds to the same application business data. It can be seen that in the case of multiple instances, the same application business data is stored on the server. This embodiment addresses the scenario of multiple instances under the same application.

[0074] For example, consider a chat application that can be deployed as instances on multiple independent private devices. The data and documents generated by the chat application constitute application business data; this data is stored on a server, which may also contain versions of the chat application. Therefore, for this chat application, the application business data generated by the instances on each private device is the same set of application business data.

[0075] Each electronic device that has deployed the instance receives an upgrade request, which instructs that the application's business data be upgraded, and includes the version of the application business data to be upgraded.

[0076] In one example, the user operates the control device and inputs an upgrade command; the control device generates an upgrade request based on the upgrade command; the control device sends the upgrade request to each electronic device on which the instance is deployed.

[0077] In this step, each instance of the application is deployed on a corresponding private device. These private devices can be referred to as electronic devices. For the same application, the electronic device deploying an instance of that application can receive an upgrade request. For example, instance 1 of application A is deployed on electronic device a, instance 2 of application A is deployed on electronic device b, and instance 1 of application A is deployed on electronic device c; electronic devices a, b, and c each receive the same upgrade request. This upgrade request instructs for upgrading the application business data of application A, and the upgrade request includes the version of the application business data to be upgraded.

[0078] After each electronic device with an instance receives an upgrade request, it runs the instance it was deployed on, and then attempts to acquire the lock using a lock-grabbing mechanism. Since only one instance can hold a lock at a time, only one instance of each deployed electronic device can successfully acquire the lock. The electronic device that successfully acquires the lock then performs the application data upgrade based on its instance. Other electronic devices that fail to acquire the lock cannot perform the application data upgrade.

[0079] This allows each instance to select one instance to perform the application business data upgrade process based on the lock-grabbing mechanism.

[0080] In one example, each electronic device deployed in the instance has its own priority. The priority is pre-configured for each electronic device. For each electronic device, its priority can be determined based on the relationship between its performance parameters, processing power information, and priority; and then this priority can be written into each electronic device.

[0081] The device's performance parameters include: parameters of the device's central processing unit (CPU), data storage capacity, etc. The device's processing capacity information includes: data transmission capacity, data processing capacity, etc. The stronger the device's performance parameters, the higher its priority. The stronger the device's processing capacity, the higher its priority.

[0082] This allows for the configuration of priorities for electronic devices, enabling them to compete for locks based on priority. This ensures that high-performance, high-processing-capability electronic devices successfully acquire locks, facilitating the rapid processing of application business data and accelerating application business data upgrades.

[0083] S202. If the lock acquisition is successful, obtain the current data version of the application service data indicated by the upgrade request.

[0084] For example, since multiple electronic devices compete for the lock based on their respective instances, one instance of an electronic device successfully acquires the lock. The electronic device that successfully acquires the lock then performs the upgrade processing of the application service data indicated by the upgrade request.

[0085] It is known that the electronic device that successfully acquires the lock needs to execute step S202. This successfully acquired electronic device is also a device that has deployed the application instance.

[0086] By improving the lock-grabbing mechanism described above, it is ensured that only one instance (i.e., the electronic device running the instance) performs subsequent upgrade processing at the same time, thereby ensuring that only one instance (i.e., the electronic device running the instance) performs upgrade processing on application business data at the same time, and that only one instance (i.e., the electronic device running the instance) modifies the data version in the preset database at the same time.

[0087] Therefore, the electronic device that successfully snatches the lock obtains the current data version of the application service data indicated in the upgrade request based on the upgrade request.

[0088] In one example, the upgrade request includes the current version of the application business data. Alternatively, the application business data is stored in a pre-set database on the server, and the server's pre-set database also stores the current version of the application business data; thus, the electronic device that successfully acquires the lock can obtain the current version of the application business data indicated by the upgrade request from the server's pre-set database.

[0089] S203. If it is determined that the current data version of the application business data is the data version to be upgraded, then it is determined that no upgrade processing is required for the application business data.

[0090] For example, after step S202, before upgrading the application service data, the electronic device that successfully grabbed the lock first needs to determine whether the current data version of the obtained application service data is the data version to be upgraded indicated by the upgrade request.

[0091] If an electronic device that successfully acquires the lock determines that the current version of the application service data it has obtained is the version of the data to be upgraded as indicated in the upgrade request, then the electronic device that successfully acquired the lock determines that the application service data is already the latest version and does not need to upgrade the application service data. Therefore, subsequent steps S205-S207, as well as steps S208 and S209, are no longer required.

[0092] At this point, the data version of the application business data is the same as the data version requested in the upgrade request. No processor matching or other operations are needed, thus saving signaling and data.

[0093] S204. If it is determined that the current data version of the application business data is not the data version to be upgraded, then proceed to step S205.

[0094] For example, after step S202, if the electronic device that successfully acquired the lock determines that the current data version of the obtained application service data is not the data version to be upgraded indicated by the upgrade request, then the electronic device that successfully acquired the lock determines that the application service data needs to be upgraded. Therefore, steps S205-S207 are executed, and steps S208 and S209 are performed depending on the execution status.

[0095] For example, for application A, various instances of application A are deployed on multiple electronic devices. The application business data generated by each instance of application A is stored in a pre-defined database on the server. This database contains a pre-defined field that records the current data version V1 of the application business data for application A. Each electronic device receives an upgrade request, which includes the data version V4 of the application business data to be upgraded. Each electronic device then competes for the upgrade.

[0096] Then, electronic device A successfully acquires the lock. Thus, electronic device A retrieves the current data version V1 of the application business data from the server's preset database.

[0097] Then, electronic device a determines that the current data version V1 is not the data version V4 to be upgraded, and thus electronic device a determines that the application business data of application A needs to be upgraded. The electronic device executes step S205.

[0098] Repeat steps S205-S207 until the application business data is upgraded from the current data version to the data version to be upgraded:

[0099] S205. Based on the instance, determine the i-th processor from the processor set that matches the current data version of the application business data; wherein, the processor set includes N processors, the i-th processor records the i-th initial data version and the i-th preset data version, the i-th processor includes the processing logic for upgrading from the i-th initial data version to the i-th preset data version, and N is a positive integer greater than or equal to 1; the initial data version in the processor that matches the current data version of the application business data is the same as the current data version of the application business data.

[0100] In one example, the preset data version recorded by the i-th processor in the processor set is the initial data version recorded by the (i+1)-th processor in the processor set; where N is a positive integer greater than 1, and i is a positive integer greater than or equal to 1 and less than or equal to N-1.

[0101] In one example, the processor's operating logic is idempotent.

[0102] In one example, the device corresponding to the running instance has a priority.

[0103] For example, a processor set is provided, which includes multiple processors, wherein the processor is a software layer and can also be referred to as a processing machine. Each processor stores a source data version and a target data version of the application business data. The "source data version" is referred to as the initial data version, and the "target data version" is referred to as the preset data version. That is, each processor records the initial data version and the preset data version.

[0104] Furthermore, each processor includes processing logic for upgrading the initial data version recorded by that processor to a preset data version. The i-th processor records the i-th initial data version and the i-th preset data version, and the i-th processor includes processing logic for upgrading from the i-th initial data version to the i-th preset data version.

[0105] In one example, Figure 3 This is a schematic diagram of the processor provided in the embodiments of this disclosure. Figure 1 ,like Figure 3As shown, N processors are provided, where N is a positive integer greater than 1. The preset data version recorded by the i-th processor is the initial data version recorded by the (i+1)-th processor in the processor set. That is, the target data version recorded by the i-th processor is the source data version recorded by the (i+1)-th processor in the processor set. Thus, the data versions in each processor form a ladder structure. For example, the first processor includes: the first initial data version, the first preset data version, and processing logic 1; processing logic 1 is the processing logic for upgrading from the first initial data version to the first preset data version. The second processor includes: the second initial data version, the second preset data version, and processing logic 2; processing logic 2 is the processing logic for upgrading from the second initial data version to the second preset data version. The i-th processor includes: the i-th initial data version, the i-th preset data version, and processing logic i; processing logic i is the processing logic for upgrading from the i-th initial data version to the i-th preset data version. The (i+1)th processor includes: the (i+1)th initial data version, the (i+1)th preset data version, and processing logic i+1; processing logic i+1 is the processing logic for upgrading from the (i+1)th initial data version to the (i+1)th preset data version. Similarly, the Nth processor includes: the Nth initial data version, the Nth preset data version, and processing logic N; processing logic N is the processing logic for upgrading from the Nth initial data version to the Nth preset data version.

[0106] Figure 4 This is a schematic diagram of the processor provided in the embodiments of this disclosure. Figure 2 ,like Figure 4 As shown, five processors are provided. The first processor records the first initial data version V1 and the first preset data version V2, and the first processor includes upgrades from the first initial data version V1.

[0107] The first processor records the second initial data version V2 and the second preset data version V3, and the second processor includes processing logic 2 for upgrading from the second initial data version V2 to the second preset data version V3; the second processor records the second initial data version V3 and the third preset data version V4, and the third processor includes processing logic 3 for upgrading from the third initial data version V3 to the third preset data version V4; the fourth processor records the fourth initial data version V4 and the fourth preset data version V5, and the fourth processor includes processing logic 4 for upgrading from the fourth initial data version V4 to the fourth preset data version V5; the fifth processor records...

[0108] The fifth initial data version V5 and the fifth preset data version V6 were recorded. Furthermore, the fifth processor includes processing logic 5 for upgrading from the fifth initial data version V5 to the fifth preset data version V6. Therefore, the preset data version recorded by the i-th processor is the same as the initial data version recorded by the (i+1)-th processor.

[0109] The database storing application business data and the aforementioned processor set can be deployed separately to...

[0110] In different devices. Alternatively, the database storing application business data and the aforementioned set of processors can be deployed on the same device.

[0111] The electronic device that successfully acquires the lock runs an instance, and based on the instance, the processor that matches the current data version of the application business data is determined from the processor set; the initial data version recorded by the processor that matches the current data version of the application business data is the current data version of the application business data.

[0112] 5S206. Based on instance, determine the i-th data version that matches the current data version of the application business data.

[0113] The processing logic recorded by the processor upgrades the application business data from the current data version to the i-th preset data version recorded by the i-th processor.

[0114] For example, after step S206, the electronic device that successfully snatched the lock runs based on the instance.

[0115] The processing logic recorded by the i-th processor, which matches the current data version of the application business data, will then upgrade the application business data from the current data version to the i-th preset data version recorded by the i-th processor, which matches the current data version of the application business data.

[0116] S207. Determine the i-th preset data version as the new current data version, and write the i-th preset data version into the preset field in the preset database based on the instance. The preset field is used to record the data version of the application business data. Determine the value of i plus 1, where i is a positive integer greater than or equal to 1.

[0117] For example, after step S207, the electronic device that successfully grabs the lock writes the i-th preset data version recorded by the i-th processor that matches the current data version of the application business data into the preset field of the server's preset database based on the instance; thereby changing the data version recorded in the preset field of the preset database to the i-th preset data version recorded by the i-th processor that matches the current data version of the application business data.

[0118] Furthermore, the electronic device that successfully acquires the lock determines, based on the instance, the i-th preset data version recorded by the i-th processor that matches the current data version of the application service data, and sets this as the new current data version; it then increments the value of i by 1. This updates the current data version indicated by the upgrade request. The electronic device that successfully acquires the lock then repeats steps S205-S207 until the application service data is upgraded from the current data version indicated by the upgrade request to the data version to be upgraded. The operating logic of the aforementioned processor is idempotent.

[0119] Once an electronic device that successfully acquires the lock determines that its application business data will be upgraded to the version to be upgraded, it will release the lock based on the instance, and the upgrade process will be complete.

[0120] By recording the i-th initial data version and the i-th preset data version in the i-th processor, and recording the processing logic for upgrading from the i-th initial data version to the i-th preset data version, a chain-like, layer-by-layer upgrade of application business data can be performed based on each processor. Adjacent data versions correspond to a processor used for version upgrades. If a new data version needs to be introduced, only a processor needs to be provided, reducing the development cost of data versions. Furthermore, due to the chain-like, layer-by-layer upgrade method, it can support data upgrade requirements between any two data versions, thus improving data version upgrade capabilities.

[0121] During the above process, electronic devices that successfully acquire the lock have priority, allowing them to allocate resources based on this priority and upgrade application service data as quickly as possible.

[0122] For example, for application A, various instances of application A are deployed on multiple electronic devices. The application business data generated by each instance of application A is stored in a pre-defined database on the server. This database contains a pre-defined field that records the current data version V1 of the application business data for application A. Each electronic device receives an upgrade request, which includes the data version V4 of the application business data to be upgraded. Each instance of the electronic device then competes for the upgrade.

[0123] Then, the instance of electronic device a successfully acquires the lock. Thus, the instance of electronic device a retrieves the current data version V1 of the application business data from the server's preset database.

[0124] Then, the instance of electronic device a determines that the current data version V1 is not the data version V4 to be upgraded, and thus the instance of electronic device a determines that the application business data of application A needs to be upgraded.

[0125] Thus, an instance of electronic device a, based on Figure 4 The set of processors shown is used to determine the first processor. Based on the processing logic recorded by the first processor, the instance of electronic device a upgrades the application business data from the current data version V1 to a preset data version V2. The instance of electronic device a determines the preset data version V2 as the new current data version and writes the preset data version V2 into a preset field in the preset database.

[0126] Then, an instance of electronic device a, based on Figure 4 The set of processors shown is used to determine the second processor. Based on the processing logic recorded by the second processor, the instance of electronic device a upgrades the application business data from the current data version V2 to the preset data version V3. The instance of electronic device a determines the preset data version V3 as the new current data version and writes the preset data version V3 into a preset field in the preset database.

[0127] Then, an instance of electronic device a, based on Figure 4 The set of processors shown is used to identify the third processor. Based on the processing logic recorded by the third processor, an instance of electronic device a upgrades the application business data from the current data version V3 to a preset data version V4. The instance of electronic device a determines that the preset data version V4 is the new current data version and writes the preset data version V4 into a preset field in the preset database. At this point, the instance of electronic device a has determined that the application business data has been upgraded to the data version V4 to be upgraded.

[0128] Through steps S205-S207, a contention-based lock-grabbing process is implemented across multiple instances, ensuring that only one instance performs the data upgrade operation when multiple instances are running simultaneously. This guarantees data upgrade security; furthermore, the upgrade process is automated and requires no manual intervention.

[0129] Electronic devices that successfully acquire a lock can upgrade their application data to the desired version within the instance through a gradual upgrade process, based on the data version and processing logic within the processor. This gradual upgrade approach ensures that if a new data version needs to be introduced into the application data of the instance, only the processor needs to be provided, reducing the development cost of data versions. Furthermore, it supports data upgrade requirements between any two data versions, thus improving the data version upgrade capabilities of the application data within the instance.

[0130] S208. If it is determined that the application business data has not been upgraded from the current data version to the data version to be upgraded, the lock is released, and the running instance in step S201 is executed again, and lock acquisition is performed based on the lock acquisition mechanism.

[0131] For example, during the implementation of steps S205-S207, external interference or other interference occurs, causing the application service data to fail to be upgraded to the version to be upgraded. Therefore, the electronic device that successfully seized the lock did not upgrade its application service data to the version to be upgraded.

[0132] The electronic device that successfully acquires the lock determines that it needs to release the lock based on the instance it is running.

[0133] Then, the lock acquisition process in step S201 is executed again. During this second lock acquisition, another electronic device that has deployed an instance may have successfully acquired the lock. The electronic device that successfully acquired the lock again runs the instance and executes steps S202-S207.

[0134] If an electronic device that successfully acquires the lock again fails to upgrade its application business data to the version to be upgraded, the electronic device that successfully acquires the lock again will release the lock based on the instance.

[0135] Then, the lock-grabbing process in step S201 is executed again. This process continues until the application business data is upgraded to the version to be upgraded; or until manual intervention is received.

[0136] The above process completes the retry of upgrading application service data based on the instance; this solution supports multiple retries. By releasing the lock, other electronic devices that have deployed the instance can try to acquire the lock again to upgrade the application service data under the instance, that is, to perform retry processing.

[0137] Because the operating logic of each processor is idempotent, idempotency and reentrancy can be guaranteed after retries (i.e., multiple operations will yield consistent results). Furthermore, the retry process ensures the automated upgrading of application business data within the instance.

[0138] S209. If it is determined that the upgrade of the application business data has failed, the data version of the application business data will be rolled back to the specified data version.

[0139] In one example, step S209 includes the following implementation methods:

[0140] In the first implementation of step S209, the specified data version is the current data version indicated by the upgrade request. If it is determined that the upgrade of the application business data fails, the data version of the application business data is rolled back to the current data version indicated by the upgrade request, and the data version recorded in the preset field in the preset database is modified to the current data version indicated by the upgrade request.

[0141] In the second implementation of step S209, if it is determined that the upgrade of the application business data has failed, the application business data is rolled back to the current data version indicated by the upgrade request. Based on the instance, the application business data is upgraded from the current data version to the specified data version; and the data version recorded in the preset field in the preset database is modified to the specified data version.

[0142] For example, after step S208, if the application business data still fails to be upgraded to the version to be upgraded after multiple retries, the upgrade of the application business data is determined to have failed. Since the upgrade of application business data is done incrementally (e.g., the chain-like layer-by-layer upgrade method described above), when the upgrade fails, the application business data may be at a certain data version, but that data version may be problematic or incorrect; therefore, it is necessary to roll back the application business data version to a specified data version. This prevents the application business data from being at a problematic or incorrect data version when the upgrade fails.

[0143] In one example, if the application data fails to be upgraded to the requested version after multiple retries, the upgrade is considered a failure. Each electronic device that deployed the instance can then attempt to acquire the lock again. The successfully acquired device can roll back the application data to its initial current data version (i.e., the version indicated in the upgrade request). Furthermore, the successfully acquired device will modify the data version recorded in a preset field in the preset database to the initial current data version (i.e., the version indicated in the upgrade request).

[0144] For example, for application A, various instances of application A are deployed on multiple electronic devices. The application business data generated by each instance of application A is stored in a pre-defined database on the server. This database contains a pre-defined field that records the current data version V1 of the application business data for application A. Each electronic device receives an upgrade request, which includes the data version V10 of the application business data to be upgraded.

[0145] Each instance of an electronic device is locked. Then the above steps are performed.

[0146] During the upgrade process, the application business data was upgraded from data version V1 to data version V8. However, after multiple retries, the application business data still failed to be upgraded to the required data version V10, indicating that the upgrade of the application business data failed. Each electronic device with deployed instances can then attempt to acquire the lock again; electronic device b successfully acquired the lock.

[0147] Electronic device b that successfully acquires the lock is matched with a processor, which then processes the application business data from data version V8 to data version V7. Electronic device b that successfully acquires the lock is matched with a processor, which then processes the application business data from data version V7 to data version V6. This process continues until the application business data is rolled back to data version V1.

[0148] Therefore, if the application business data fails to be upgraded to the version to be upgraded after multiple retries, the application business data under the instance is rolled back to the initial current data version (i.e., the current data version indicated by the upgrade request). This ensures that when the upgrade of application business data fails, the application business data is not located on a problematic or incorrect data version.

[0149] In another example, if the application business data is still not upgraded to the version to be upgraded after multiple retries, it is determined that the upgrade of the application business data under the instance has failed.

[0150] Since a specified data version has been configured by default or manually, each electronic device that has deployed the instance can generate a rollback request based on the default or manual configuration. This rollback request includes the specified data version. Alternatively, if another device receives a message indicating an upgrade failure, it generates a rollback request, which also includes the specified data version, and then sends the rollback request to each electronic device that has deployed the instance.

[0151] Each electronic device that has deployed the instance can then re-acquire the lock.

[0152] The electronic device that successfully acquires the lock can roll back the application business data to the initial current data version (i.e., the current data version indicated by the upgrade request). Furthermore, the electronic device that successfully acquires the lock will modify the data version recorded in the preset field of the preset database to the initial current data version (i.e., the current data version indicated by the upgrade request).

[0153] Then, based on the upgrade method described in steps S205-S207, the electronic device that successfully seized the lock upgrades the application business data from the current data version to the specified data version based on the instance. Simultaneously, during the upgrade process, the electronic device that successfully seized the lock modifies the data version recorded in the preset field of the preset database to the specified data version indicated by the rollback request.

[0154] For example, for application A, various instances of application A are deployed on multiple electronic devices. The application business data generated by each instance of application A is stored in a pre-defined database on the server. This database contains a pre-defined field that records the current data version V1 of the application business data for application A. Each electronic device receives an upgrade request, which includes the data version V10 of the application business data to be upgraded.

[0155] Each instance of an electronic device is locked. Then the above steps are performed.

[0156] If, after multiple retries, the application business data still fails to upgrade to the target data version V10 during the upgrade process, the upgrade is considered a failure. Furthermore, if the upgrade process initially upgraded the application business data from data version V1 to data version V9, but encountered an issue during the upgrade from V9 to V10, it's impossible to upgrade the application business data to data version V9. However, at this point, the logic of data version V9 is likely flawed.

[0157] A specified data version V7 is configured by default, or each electronic device that has deployed the instance has obtained the specified data version V7.

[0158] Then, each electronic device that has deployed the instance can try to acquire the lock again, and electronic device b successfully acquires the lock.

[0159] Electronic device b that successfully acquires the lock is matched with a processor, which then processes the application business data from data version V9 to data version V8. Electronic device b that successfully acquires the lock is matched with a processor, which then processes the application business data from data version V8 to data version V7. This process continues until the application business data is rolled back to data version V1.

[0160] Then, the successfully acquired electronic device b is matched with a processor, which then processes the application business data from data version V1 to data version V2. The successfully acquired electronic device b is matched with a processor, which then processes the application business data from data version V2 to data version V3. This process continues until the application business data is rolled back to the specified data version V7.

[0161] Because there are problems with the data or logic in data version V9, and data version V10 may also have problems, it is necessary to upgrade the application business data to the newer data version V7.

[0162] Therefore, if the application business data under the instance still fails to upgrade to the data version to be upgraded after multiple retries, the application business data is rolled back to the initial current data version (i.e., the current data version indicated by the upgrade request); then the application business data is upgraded to the specified data version. Thus, when the upgrade of application business data fails, the application business data is first rolled back to the initial current data version. Since the location of the problem is uncertain during the upgrade process, rolling back the application business data to the initial current data version first ensures that there are no data errors or upgrade errors during the upgrade process. Then, the application business data is upgraded to the specified data version, thus ensuring that the application business data can be upgraded to a slightly more recent data version. This ensures that the application business data is not located on a problematic or incorrect data version and, to a certain extent, upgrades the application business data.

[0163] It can also upgrade the application programs corresponding to the application business data.

[0164] In one example, the application program on an electronic device where the instance is deployed is upgraded. Then, when it is necessary to upgrade the application business data, the solution of this embodiment is executed. That is, the code configuration is upgraded first, and then the application business data is upgraded.

[0165] Upgrading the program on the electronic devices where the instances are deployed includes: centralizing the program code into a single device; issuing commands through this device to each electronic device where the instances are deployed, and then having each electronic device retrieve the program code from the device and execute it. This completes the program upgrade.

[0166] In this embodiment, the electronic device that successfully acquires the lock can upgrade the application business data under the instance to the data version to be upgraded through a step-by-step upgrade method, based on the data version and processing logic in the processor. This step-by-step upgrade method ensures that if a new data version needs to be introduced, only the processor needs to be provided, reducing the development cost of data versions. Furthermore, it supports data upgrade requirements between any two data versions, improving the data version upgrade capability of the application business data under the instance. This solution also supports multiple upgrade retries, ensuring automated upgrades of the application business data under the instance. By releasing the lock, other electronic devices deployed on the instance can attempt to acquire the lock again to upgrade the application business data, i.e., perform retry processing. Since the operating logic of each processor is idempotent, idempotency and reentrancy can be guaranteed after retries (i.e., multiple operations yield consistent results).

[0167] Figure 5 This is a schematic diagram based on the third embodiment of the present disclosure, as shown below. Figure 5As shown, the instance-based automatic data upgrade device 500 provided in this embodiment includes:

[0168] The acquisition unit 501 is used to acquire the current data version of the application business data indicated by the upgrade request in response to the upgrade request; wherein the upgrade request is used to indicate the upgrade of the application business data, and the upgrade request includes the data version of the application business data to be upgraded.

[0169] Repeat the upgrade unit 502 and the first determination unit 503 until the application business data is upgraded from the current data version to the data version to be upgraded.

[0170] Upgrade unit 502 is used to upgrade application business data from the current data version to the i-th preset data version based on the instance.

[0171] The first determining unit 503 is used to determine the i-th preset data version as the new current data version, and write the i-th preset data version into the preset field in the preset database based on the instance, wherein the preset field is used to record the data version of the application business data; and to determine the value of i plus 1, wherein i is a positive integer greater than or equal to 1.

[0172] The apparatus in this embodiment can execute the technical solutions in the above method. Its specific implementation process and technical principles are the same, and will not be repeated here.

[0173] Figure 6 This is a schematic diagram based on the fourth embodiment of the present disclosure, as shown below. Figure 6 As shown, the instance-based automatic data upgrade device 600 provided in this embodiment includes:

[0174] The acquisition unit 601 is used to acquire the current data version of the application business data indicated by the upgrade request in response to the upgrade request; wherein the upgrade request is used to indicate the upgrade of the application business data, and the upgrade request includes the data version of the application business data to be upgraded.

[0175] Repeat the upgrade unit 602 and the first determination unit 603 until the application business data is upgraded from the current data version to the data version to be upgraded.

[0176] Upgrade unit 602 is used to upgrade application business data from the current data version to the i-th preset data version based on the instance.

[0177] The first determining unit 603 is used to determine the i-th preset data version as the new current data version, and write the i-th preset data version into the preset field in the preset database based on the instance, wherein the preset field is used to record the data version of the application business data; and to determine the value of i plus 1, wherein i is a positive integer greater than or equal to 1.

[0178] In one example, upgrade unit 602 includes:

[0179] The determination module 6021 is used to determine, based on an instance, the i-th processor from the processor set that matches the current data version of the application business data; wherein, the processor set includes N processors, the i-th processor records the i-th initial data version and the i-th preset data version, the i-th processor includes processing logic to upgrade from the i-th initial data version to the i-th preset data version, and N is a positive integer greater than or equal to 1; the initial data version in the processor that matches the current data version of the application business data is the same as the current data version of the application business data.

[0180] Upgrade module 6022 is used to upgrade application business data from the current data version to the i-th preset data version recorded by the i-th processor based on the instance and the processing logic recorded by the i-th processor that matches the current data version of the application business data.

[0181] In one example, the preset data version recorded by the i-th processor in the processor set is the initial data version recorded by the (i+1)-th processor in the processor set.

[0182] In one example, the processor's operating logic is idempotent.

[0183] In one example, the device corresponding to the running instance has a priority.

[0184] In one example, the apparatus provided in this embodiment further includes:

[0185] The lock-grabbing unit 604 is used to run an instance and perform lock-grabbing processing based on the lock-grabbing mechanism before the acquisition unit 601 acquires the current data version of the application service data indicated by the upgrade request.

[0186] The second determining unit 605 is used to execute the acquiring unit 601 if it is determined that the lock grabbing was successful.

[0187] In one example, the lock-grabbing unit 604 is specifically used to: perform lock-grabbing processing based on the priority of the running instance and the lock-grabbing mechanism.

[0188] In one example, the priority is determined based on a preset relationship, which is used to indicate the relationship between the device's performance parameters, the device's processing capability information, and the device's priority; where the performance parameters characterize the device's performance, and the processing capability information characterizes the device's processing capability.

[0189] In one example, the apparatus provided in this embodiment further includes:

[0190] Release unit 606 is used to release the lock if it is determined that the application business data has not been upgraded from the current data version to the data version to be upgraded;

[0191] The retry unit 607 is used to execute the running instance again and to execute the lock-grabbing unit 604.

[0192] In one example, the apparatus provided in this embodiment further includes:

[0193] The third determining unit 608 is used to execute the upgrading unit 602 if, after the obtaining unit 601 obtains the current data version of the application service data indicated by the upgrade request, it determines that the current data version of the application service data is not the data version to be upgraded.

[0194] The fourth determining unit 609 is used to determine that if the current data version of the application business data is determined to be the data version to be upgraded, then no upgrade processing is required for the application business data.

[0195] In one example, the apparatus provided in this embodiment further includes:

[0196] Rollback unit 610 is used to roll back the data version of the application business data to a specified data version if it is determined that the upgrade of the application business data has failed.

[0197] In one example, the specified data version is the current data version indicated by the upgrade request; the rollback unit 610 is specifically used to: roll back the data version of the application business data to the current data version indicated by the upgrade request, and modify the data version recorded in the preset field in the preset database to the current data version indicated by the upgrade request.

[0198] Alternatively, in one example, rollback unit 610 is specifically used to: roll back application business data to the current data version indicated by the upgrade request; upgrade application business data from the current data version to the specified data version based on the instance; and modify the data version recorded in the preset field in the preset database to the specified data version.

[0199] The apparatus in this embodiment can execute the technical solutions in the above method. Its specific implementation process and technical principles are the same, and will not be repeated here.

[0200] Figure 7 This is a schematic diagram based on the fifth embodiment of the present disclosure, as shown below. Figure 7 As shown, the electronic device 700 in this embodiment may include a processor 701 and a memory 702.

[0201] Memory 702 is used to store programs. Memory 702 may include volatile memory, such as random-access memory (RAM), such as static random-access memory (SRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.; memory may also include non-volatile memory, such as flash memory. Memory 702 is used to store computer programs (such as application programs, functional modules, etc. that implement the above methods), computer instructions, etc. The computer programs, computer instructions, etc., can be partitioned and stored in one or more memories 702. Furthermore, the computer programs, computer instructions, data, etc., can be accessed by processor 701.

[0202] The aforementioned computer programs and instructions can be stored in one or more partitions of memory 702. Furthermore, the aforementioned computer programs and instructions can be invoked by processor 701.

[0203] The processor 701 is configured to execute the computer program stored in the memory 702 to implement the various steps in the methods described in the above embodiments.

[0204] For details, please refer to the relevant descriptions in the preceding method embodiments.

[0205] The processor 701 and the memory 702 can be independent structures or integrated structures. When the processor 701 and the memory 702 are independent structures, the memory 702 and the processor 701 can be coupled together via bus 703.

[0206] The electronic device in this embodiment can execute the technical solution in the above method. Its specific implementation process and technical principle are the same, and will not be repeated here.

[0207] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0208] According to embodiments of this disclosure, this disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the scheme provided in any of the above embodiments.

[0209] According to embodiments of this disclosure, this disclosure also provides a computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the scheme provided in any of the above embodiments.

[0210] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0211] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0212] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0213] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the instance-based automatic data upgrade method. For example, in some embodiments, the instance-based automatic data upgrade method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the instance-based automatic data upgrade method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the instance-based automatic data upgrade method by any other suitable means (e.g., by means of firmware).

[0214] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0215] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0216] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0217] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0218] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0219] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0220] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0221] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An instance-based automatic data upgrade method, comprising: In response to an upgrade request, the current data version of the application service data indicated by the upgrade request is obtained; wherein, the upgrade request is used to indicate an upgrade of the application service data, and the upgrade request includes the data version of the application service data to be upgraded; Repeat the following steps until the application business data is upgraded from the current data version to the data version to be upgraded: upgrade the application business data from the current data version to the i-th preset data version based on the instance; determine the i-th preset data version as the new current data version, and write the i-th preset data version into a preset field in a preset database based on the instance, wherein the preset field is used to record the data version of the application business data; determine the value of i plus 1, where i is a positive integer greater than or equal to 1; Upgrading the application business data from the current data version to the i-th preset data version based on the instance includes: Based on the instance, determine the i-th processor from the processor set that matches the current data version of the application service data; wherein, the processor set includes N processors, the i-th processor records the i-th initial data version and the i-th preset data version, the i-th processor includes processing logic to upgrade from the i-th initial data version to the i-th preset data version, and N is a positive integer greater than or equal to 1; the initial data version in the processor that matches the current data version of the application service data is the same as the current data version of the application service data; Based on the example, according to the processing logic recorded by the i-th processor that matches the current data version of the application service data, the application service data is upgraded from the current data version to the i-th preset data version recorded by the i-th processor.

2. The method according to claim 1, wherein, The preset data version recorded by the i-th processor in the processor set is the initial data version recorded by the (i+1)-th processor in the processor set.

3. The method according to claim 1 or 2, wherein, The processor's operating logic is idempotent.

4. The method according to claim 1 or 2, obtaining the current data version of the application service data indicated by the upgrade request includes: Run the instance and perform lock-grabbing processing based on the lock-grabbing mechanism; If the lock acquisition is successful, obtain the current data version of the application service data indicated by the upgrade request.

5. The method according to claim 4, wherein, The device running the instance has priority; the locking process is based on a locking mechanism, including: Lock-taking is performed based on the priority of the device running the instance and a lock-taking mechanism.

6. The method according to claim 5, wherein, The priority is determined based on a preset relationship, which is used to indicate the relationship between the device's performance parameters, the device's processing capability information, and the device's priority; wherein, the performance parameters characterize the device's performance, and the processing capability information characterizes the device's processing capability.

7. The method according to claim 4, further comprising: If it is determined that the application service data has not been upgraded from the current data version to the data version to be upgraded, the lock is released, and the running instance is executed again, and the lock-grabbing process is performed based on the lock-grabbing mechanism.

8. The method according to any one of claims 1-2 and 5-7, further comprising: If it is determined that the upgrade of the application business data has failed, the data version of the application business data will be rolled back to the specified data version.

9. The method according to claim 8, wherein, Rolling back the data version of the application service data to a specified data version includes: Roll back the application service data to the current data version indicated by the upgrade request; Based on the instance, the application business data is upgraded from the current data version to the specified data version; and the data version recorded in the preset field in the preset database is modified to the specified data version.

10. An instance-based automatic data upgrade device, comprising: An acquisition unit is configured to, in response to an upgrade request, acquire the current data version of the application service data indicated by the upgrade request; wherein the upgrade request is used to indicate an upgrade of the application service data, and the upgrade request includes the data version of the application service data to be upgraded; Repeat the upgrade unit and the first determination unit until the application service data is upgraded from the current data version to the data version to be upgraded: The upgrade unit is used to upgrade the application business data from the current data version to the i-th preset data version based on the instance; The first determining unit is used to determine that the i-th preset data version is the new current data version, and write the i-th preset data version into a preset field in the preset database based on the instance, wherein the preset field is used to record the data version of the application business data; and to determine that the value of i is incremented by 1, wherein i is a positive integer greater than or equal to 1; The upgrade unit includes: The determining module is used to determine, based on an instance, the i-th processor from the processor set that matches the current data version of the application service data; wherein, the processor set includes N processors, the i-th processor records the i-th initial data version and the i-th preset data version, the i-th processor includes processing logic to upgrade from the i-th initial data version to the i-th preset data version, and N is a positive integer greater than or equal to 1; the initial data version in the processor that matches the current data version of the application service data is the same as the current data version of the application service data; The upgrade module is used to upgrade the application service data from the current data version to the i-th preset data version recorded by the i-th processor based on the processing logic recorded by the i-th processor that matches the current data version of the application service data.

11. The apparatus according to claim 10, wherein, The preset data version recorded by the i-th processor in the processor set is the initial data version recorded by the (i+1)-th processor in the processor set.

12. The apparatus according to claim 10 or 11, wherein, The processor's operating logic is idempotent.

13. The apparatus according to claim 10 or 11, further comprising: The lock-grabbing unit is used to run an instance and perform lock-grabbing processing based on the lock-grabbing mechanism before the acquisition unit obtains the current data version of the application service data indicated by the upgrade request. The second determining unit is used to execute the acquiring unit if it is determined that the lock grabbing was successful.

14. The apparatus according to claim 13, wherein, The device corresponding to the instance has priority; the lock-grabbing unit is specifically used for: Lock-grabbing is performed based on the priority of the device running the instance, using a lock-grabbing mechanism.

15. The apparatus according to claim 14, wherein, The priority is determined based on a preset relationship, which is used to indicate the relationship between the device's performance parameters, the device's processing capability information, and the device's priority; wherein, the performance parameters characterize the device's performance, and the processing capability information characterizes the device's processing capability.

16. The apparatus of claim 13, further comprising: The release unit is used to release the lock if it is determined that the application service data has not been upgraded from the current data version to the data version to be upgraded; The retry unit is used to execute the running instance again and to execute the lock-grabbing unit.

17. The apparatus according to any one of claims 10-11, 14-16, further comprising: The rollback unit is used to roll back the data version of the application service data to a specified data version if it is determined that the upgrade of the application service data has failed.

18. The apparatus according to claim 17, wherein, The rollback unit is specifically used for: Roll back the application service data to the current data version indicated by the upgrade request; Based on the instance, the application business data is upgraded from the current data version to the specified data version; and the data version recorded in the preset field in the preset database is modified to the specified data version.

19. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-9.

21. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Method and device for controlling version change of database

    CN111708764A

  • Timing task processing method and device, computer equipment and storage medium

    CN113806056A

  • Component upgrading method and device for collaborative project and electronic equipment

    CN114594986A