CN109582330B - Data model upgrading method, device, equipment and readable storage medium - Google Patents

Data model upgrading method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN109582330B
CN109582330B CN201811152496.9A CN201811152496A CN109582330B CN 109582330 B CN109582330 B CN 109582330B CN 201811152496 A CN201811152496 A CN 201811152496A CN 109582330 B CN109582330 B CN 109582330B
Authority
CN
China
Prior art keywords
data model
state
server
account
upgrading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811152496.9A
Other languages
Chinese (zh)
Other versions
CN109582330A (en
Inventor
马聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201811152496.9A priority Critical patent/CN109582330B/en
Publication of CN109582330A publication Critical patent/CN109582330A/en
Application granted granted Critical
Publication of CN109582330B publication Critical patent/CN109582330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The embodiment of the disclosure provides a data model upgrading method, a device, equipment and a readable storage medium. The data model upgrading method comprises the following steps: detecting the current data model state of a server while executing business operation, wherein the current data model state is one of an old data model state which is not upgraded, a process state in the upgrading process and a new data model state which completes the upgrading process; when a first preset condition is detected, pushing a server of which the current data model state is in an old data model state to a process state; and performing data processing on the business operation by using a data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the account dimension, so that the upgrading complexity can be reduced, and the data model is upgraded according to the account dimension.

Description

Data model upgrading method, device, equipment and readable storage medium
Technical Field
The disclosed embodiments relate to the field of computer technologies, and in particular, to a data model upgrading method, apparatus, device, and readable storage medium.
Background
In the related art, for a complete set of distributed computer application systems, especially for high-availability systems such as financial security and account management which mainly use state data, changing a bottom layer data model is a difficult problem with high risk. Taking the accounting system as an example, the account balance and the state of the user change in real time, and from the aspect of DB, the data model change only relates to one layer of relational mapping table, so the change is very simple. However, for distributed applications with extremely high availability requirements, it is full of risks and challenges how to upgrade the billing data model on the premise that users do not perceive and the service is not damaged. If the application server does not understand the new data model consistently, the former operation of the user uses the old data model, and the latter operation uses the new data model, it is very likely to cause serious faults such as account loss.
Faced with such problems, the most common solution is to write-forbidding users in batches, according to the horizontal split dimension of the application underlying database. For example, routing prohibits 1% of users from doing everything in a process, depending on the application, followed by a data model upgrade. However, the write-forbidding process is harmful to user services in batches, and requires low-peak operation, which results in high labor cost investment. Moreover, after the upgrade is completed, application or sql check is required to ensure the integrity and correctness of the data model upgrade, which results in a long write-forbidding time and further increases the service loss. In addition, a new data model is switched in one step after the write prohibition is finished, and the risk is high.
Therefore, there is a need to provide a lossless, unattended solution for upgrading a data model without the perception of the user.
Disclosure of Invention
In view of this, a first aspect of the present disclosure provides a data model upgrading method, including:
detecting the current data model state of a server while executing business operation, wherein the current data model state is one of an old data model state which is not upgraded, a process state in the upgrading process and a new data model state which completes the upgrading process;
when a first preset condition is detected, pushing a server of which the current data model state is in an old data model state to a process state;
and according to the current data model state of the server, performing data processing on the business operation by using a data model corresponding to the current data model state, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the dimension of the account.
A second aspect of the present disclosure provides a data model upgrade apparatus, including:
the detection module is configured to detect a current data model state of the server while executing business operation, wherein the current data model state is one of an old data model state which is not upgraded, a process state in an upgrading process and a new data model state which completes the upgrading process;
the first pushing module is configured to push the server of which the current data model state is in the old data model state to the process state when a first preset condition is detected;
and the data processing module is configured to perform data processing on the business operation by using a data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the account dimension.
A third aspect of the present disclosure provides an electronic device comprising a memory and a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method of the first aspect.
A fourth aspect of the present disclosure provides a readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the method according to the first aspect.
In the embodiment of the disclosure, a current data model state of a server is detected while a business operation is executed, wherein the current data model state is one of an old data model state which is not upgraded, a process state which is in an upgrading process and a new data model state which completes the upgrading process; when a first preset condition is detected, pushing a server of which the current data model state is in an old data model state to a process state; and performing data processing on the business operation by using a data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the account dimension, so that the upgrading complexity can be reduced, and the data model is upgraded according to the account dimension. And the new data model is directly used for the incremental data, so that the consistency of the data model can be ensured in the process state. Moreover, according to the data model upgrading scheme disclosed by the embodiment of the disclosure, lossless, unattended, no-write prohibition and no-perception data model upgrading of a user can be realized, manual intervention is not needed in the upgrading process, the upgrading risk is low, and manpower is saved.
These and other aspects of the disclosure will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or technical solutions in the related art, the drawings needed to be used in the description of the exemplary embodiments or the related art will be briefly described below, and it is obvious that the drawings in the following description are some exemplary embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without inventive labor.
FIG. 1 illustrates a flow diagram of a data model upgrade method according to an embodiment of the present disclosure;
FIG. 2 shows a flowchart of an example of step S103 in a data model upgrade method according to an embodiment of the present disclosure;
FIG. 3 shows a flow diagram of a data model upgrade method according to another embodiment of the present disclosure;
FIG. 4 illustrates a flow diagram of a data model upgrade method according to another embodiment of the present disclosure;
FIG. 5 illustrates a flow diagram of a data model upgrade method according to another embodiment of the present disclosure;
FIG. 6 shows a block diagram of a data model upgrade apparatus according to an embodiment of the present disclosure;
fig. 7 shows a block diagram of an example of a data processing module 603 in a data model upgrade apparatus according to an embodiment of the present disclosure;
FIG. 8 shows a block diagram of a data model upgrade apparatus according to another embodiment of the present disclosure;
FIG. 9 shows a block diagram of a data model upgrade apparatus according to another embodiment of the present disclosure;
FIG. 10 shows a block diagram of a data model upgrade apparatus according to another embodiment of the present disclosure;
FIG. 11 illustrates a schematic diagram of the implementation of a data model upgrade scheme according to an embodiment of the present disclosure;
FIG. 12 illustrates a schematic diagram of an application scenario of a data model upgrade scheme according to an embodiment of the present disclosure;
FIG. 13 shows a block diagram of an apparatus according to an embodiment of the present disclosure;
FIG. 14 is a schematic block diagram of a computer system suitable for use in implementing a data model upgrade method according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those skilled in the art, the technical solutions of the exemplary embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the exemplary embodiments of the present disclosure.
In some of the flows described in the specification and claims of this disclosure and in the above-described figures, a number of operations are included that occur in a particular order, but it should be clearly understood that these operations may be performed out of order or in parallel as they occur herein, the order of the operations being 101, 102, etc. merely to distinguish between various operations, and the order of the operations by themselves does not represent any order of performance. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
Technical solutions in exemplary embodiments of the present disclosure will be described clearly and completely with reference to the accompanying drawings in the exemplary embodiments of the present disclosure, and it is apparent that the described exemplary embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure. .
FIG. 1 shows a flow diagram of a data model upgrade method according to an embodiment of the present disclosure. The method may comprise steps S101, S102 and S103.
In step S101, while performing the business operation, a current data model state of the server is detected, where the current data model state is one of an old data model state that is not upgraded, a process state that is in an upgrading process, and a new data model state that is completed in the upgrading process.
In step S102, when a first preset condition is detected, a server in which the current data model state is in the old data model state is pushed to the process state.
In step S103, according to the current data model state of the server, data processing is performed on the business operation by using the data model corresponding to the current data model state, wherein when the current data model state of the server is a process state, one of the new data model and the old data model is respectively applied to the business operation of the account according to the account dimension.
In the embodiment of the disclosure, a data model upgrading scheme of an old data model state (initial state) -a process state (process state) -a new data model state (final state) is provided, and a bottleneck that distributed system service expandability is limited by a data model is broken through. That is, the data model upgrade scheme according to embodiments of the present disclosure may be considered to be an upgrade scheme based on a state machine of "initial state-process state-final state".
In the embodiments of the present disclosure, although only the upgrading of the data processing model of the server is mentioned, those skilled in the art can understand that the data model upgrading scheme according to the embodiments of the present disclosure is equally applicable to the server cluster, whether centralized or distributed. Thus, in embodiments of the present disclosure, a server may refer to a cluster of servers.
According to the data model upgrading scheme, write forbidding is not needed, and therefore, the current data model state of the server can be detected to perform corresponding operation while business operation is performed.
In an embodiment according to the present disclosure, the first preset condition may be that a server in an old data model state is at a preset time point, a server in the old data model state is in a preset upgrade batch, the server receives an instruction for upgrade, and the like.
In an embodiment according to the present disclosure, the current data model state of the server may be one of an old data model state in which the upgrade is not performed, a process state in the upgrade process, and a new data model state in which the upgrade process is completed.
In the embodiment of the disclosure, a current data model state of a server is detected while a business operation is executed, wherein the current data model state is one of an old data model state which is not upgraded, a process state which is in an upgrading process and a new data model state which completes the upgrading process; when a first preset condition is detected, pushing a server of which the current data model state is in an old data model state to a process state; and performing data processing on the business operation by using a data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the account dimension, so that the upgrading complexity can be reduced, and the data model is upgraded according to the account dimension. And the new data model is directly used for the incremental data, so that the consistency of the data model can be ensured in the process state. Moreover, according to the data model upgrading scheme disclosed by the embodiment of the disclosure, lossless, unattended, no-write prohibition and no-perception data model upgrading of a user can be realized, manual intervention is not needed in the upgrading process, the upgrading risk is low, and manpower is saved.
In an embodiment according to the present disclosure, when the current data model state of the server is an old data model state, corresponding operations are performed only with the old data model, and when a first preset condition is detected, the server whose current data model state is in the old data model state is pushed to a process state. Therefore, the state in which the data model of the server is upgraded is the process state. And when the current data model state of the server is a process state, respectively applying one of a new data model and an old data model to the business operation of the account according to the account dimension. That is, when the current data model state of the server is a process state, an operation of switching to the new data model in one step is not performed on an account that is not upgraded, but one of the new data model and the old data model is applied for a different business operation. This avoids the risk of switching from the old data model to the new data model in one step and the user's apparent perception of the upgrade. And when the current data model state of the server is the new data model state, only adopting the new data model to perform corresponding operation.
In one embodiment of the present disclosure, step S103 includes: according to the process state of the server, aiming at whether the account number is upgraded or not, and at least one of the data type related to the business operation of the account number and the operation type of the business operation of the account number, one of a new data model and an old data model is applied to the business operation of the account number respectively.
FIG. 11 illustrates a schematic diagram of the implementation of a data model upgrade scheme according to an embodiment of the present disclosure.
As shown in fig. 11, when a business operation is processed in the server and the current data model state of the server is an old data model state (I state), the data of the business is operated according to the old data model in a unified manner. When a business operation is processed in the server and the current data model state of the server is a new data model state (S state), the data of the business is operated according to the new data model in a unified mode. When a business operation is processed in the server and the current data model state of the server is a process state (P state), one of a new data model and an old data model is respectively applied to the business operation of the account according to whether the account is upgraded or not, the data type related to the business operation of the account and the operation type of the business operation of the account.
Specifically, under the current condition that the current data model state of the server is the process state (P state), when the data of the service operation is the state type data, inserting the data according to the new data model for the operation of adding the state type data; for the operation of modifying the state type data, judging whether the account number corresponding to the operation is upgraded or not, if the operation is upgraded, updating the data according to the new data model, and if the operation is not upgraded, updating the data according to the old data model; for operations that query for state type data, the data is queried according to the old data model. In the embodiment of the present disclosure, the status data is stateful, multiple services depend on the stateful data, and the accuracy of the data, such as the account balance, needs to be ensured, and the original balance must be acquired when balance payment is performed, so that the payment is successful.
Specifically, in the current situation that the current data model state of the server is the process state (P state), when the data of the business operation is the pipeline data, for the operation of the new pipeline data, the data is inserted according to the new data model; and for the operation of inquiring the pipeline data, inquiring the data according to the old data model. In the embodiment of the disclosure, the stream data is stateless, there is no association between multiple services, and new documents, such as transaction stream and payment stream, are generated each time a service comes, and the service can be completed as long as the new documents can be inserted. The pipelined data is characterized in that the following data does not depend on the previous data, and all data enter the database in a time-pipelined mode.
Fig. 2 shows a flowchart of an example of step S103 in the data model upgrade method according to an embodiment of the present disclosure. Step S103 shown in fig. 2 includes step S201 and step S202.
In step S201, an account in the old data model is acquired according to the process state of the server and a preset time period.
In step S202, the accounts in the old data model are locked one by one, and the accounts in the old data model are sequentially brought into a process state to be upgraded to the new data model.
In an embodiment according to the present disclosure, after a certain distributed server is pushed to a process state (P state) through a unified management platform, an application acquires account numbers in an old data model through a timing task, locks the account numbers one by one, and completes upgrading. When the upgrading of a certain account is completed, the process state is kept, and the logic operation can be performed according to a new data model.
In the embodiment of the disclosure, an account in an old data model is acquired according to a preset time period according to the process state of a server; the account numbers in the old data model are locked one by one, the account numbers in the old data model are sequentially enabled to enter a process state to be upgraded to a new data model, lossless, unattended, write-forbidden and user-unaware data model upgrading can be achieved, manual intervention is not needed in the upgrading process, the upgrading risk is low, and manpower is saved.
FIG. 3 shows a flow diagram of a data model upgrade method according to another embodiment of the present disclosure. The embodiment shown in fig. 3 differs from the embodiment shown in fig. 1 in that fig. 3 includes step S301 in addition to steps S101, S102 and S103.
In step S301, when all the accounts in the server in the process state are accounts in the new data model, the server in the process state is pushed to the new data model state.
In an embodiment of the present disclosure, after all accounts of a preset batch are upgraded and the checking is completed, the server or the server cluster performing the upgrade task for the account of the preset batch is pushed to the new data model state (S state in fig. 11).
In the embodiment of the disclosure, when all the account numbers in the server in the process state are the account numbers in the new data model, the server in the process state is pushed to the new data model state, so that lossless, unattended, write-forbidden and user-unaware data model upgrading can be realized, no manual intervention is needed in the upgrading process, the upgrading risk is low, and the labor is saved.
FIG. 4 shows a flow diagram of a data model upgrade method according to another embodiment of the present disclosure. The embodiment shown in fig. 4 differs from the embodiment shown in fig. 3 in that fig. 4 includes step S401 in addition to steps S101, S102, S103, and S301.
In step S401, an account table recorded with accounts is established, where the account table includes an upgrade flag field for distinguishing an upgrade status of an account, where the upgrade flag field flags the upgrade status of each account as one of an old data model status, a process status, and a new data model status.
In the embodiment of the disclosure, the upgrade flag field is used on the account table to distinguish the upgrade state of the account model, and scenes such as disaster tolerance, gray scale and the like can be considered at the same time, which is beneficial to maintaining business logic compatibility on the maximum level.
FIG. 5 shows a flow diagram of a data model upgrade method according to another embodiment of the present disclosure. The embodiment shown in fig. 5 differs from the embodiment shown in fig. 4 in that fig. 5 includes step S501 in addition to steps S101, S102, S103, S301, and S401.
In step S501, before pushing the server in the process state to the new data model state, when a second preset condition is detected, the server in the process state is rolled back according to the upgrade flag field.
In one embodiment of the present disclosure, the model upgrade task needs to maintain business logic compatibility at the maximum level, and therefore, needs to ensure that business logic can be rolled back before pushing the server to the new data model state. Before pushing the server in the process state to the new data model state, under the condition that rollback is found to be needed, business logic rollback can be performed on the server in the process state according to the upgrading mark field. The detection of the second preset condition is that a rollback is required, for example, a certain proportion of accounts fails to be upgraded from an old data model to a new data model, the server in a process state is abnormal, and the upgrade is overtime.
In the embodiment of the disclosure, before the server in the process state is pushed to the new data model state, when the second preset condition is detected, the server in the process state is subjected to business logic rollback according to the upgrade flag field, so that the data model which is lossless, unattended, free of write prohibition, free of perception by the user and capable of rolling back can be upgraded, no manual intervention is required in the upgrading process, the upgrading risk is low, and the manpower is saved.
FIG. 12 illustrates a schematic diagram of an application scenario of a data model upgrade scheme according to an embodiment of the present disclosure.
As shown in FIG. 12, a segmenter-loader-executor three-tier framework may be used to progressively split a batch task and evenly load application servers using rpc (remote procedure call) services. And the segmenter splits the batch running task according to the horizontal split epitope with the migration (upgrade) state as the process state. The branch table is a flag bit of a unitized computer room (may be abbreviated as LDC), and can be understood as a flag bit for distinguishing routes after a database is split horizontally. And if the white list exists in the batch running task, the white list is independently split along with the sub-table. And the loader acquires the record of which the upgrading state is the new data model state from the task sent by the divider according to the white list or the sub-list bit, and splits the record according to the preset concurrency number. And if the sub-meter position is in a disaster tolerance state, the sub-meter position is not split. And the executor migrates (upgrades) the tasks sent by the loader according to the account number one by one. When an account is upgraded, whether the account is in a disaster tolerance state is checked, if the account is in the disaster tolerance state, the operation is ended, and if the account is not in the disaster tolerance state, a new data model is applied to upgrade. In addition, the account number of the new account opening input through the account opening type interface is directly checked whether to be in a disaster tolerance state, if so, the operation is ended, and if not, a new data model is applied for upgrading.
In the application scenario of the data model upgrade scheme shown in fig. 12, the account numbers are upgraded one by one, and the number of each upgrade can be adjusted by parameters, thereby providing a high availability guarantee. The batch running task acquires the sub-epitope according to the tangential flow state (the tangential flow state is each state of 'old data model state (initial state)' -process state (process state) '-new data model state (final state)') to split, and only the sub-epitope in the process state is fished out. The batch running task only aims at the stock account, and after the newly added account is switched to the process state, the account opening operation is carried out by using new logic. And if the branch table is in the disaster tolerance state, the task is not split, and the upgrading task is not performed. Migration (upgrading) is not performed during disaster tolerance, otherwise, the situation that migration is completed in a disaster tolerance library but migration is not performed occurs, and the problem of inconsistent data models is caused. The account opening type interface belongs to state type data insertion operation, the operation is processed according to the new model uniformly, the increment data are ensured to use the new model completely, and the consistency of the global model can be achieved under the process state. After the process state is pushed and the parameters are adjusted, the account model can be upgraded unattended, the service is not lost, and other manual operations are not needed in the upgrading process.
Fig. 6 shows a block diagram of a data model upgrade apparatus according to an embodiment of the present disclosure. The apparatus may comprise a detection module 601, a first push module 602 and a data processing module 603.
The detection module 601 is configured to detect a current data model state of the server while performing the business operation, where the current data model state is one of an old data model state without being upgraded, a process state in an upgrading process, and a new data model state completing the upgrading process.
The first push module 602 is configured to push a server with a current data model state in an old data model state to a process state when a first preset condition is detected.
The data processing module 603 is configured to perform data processing on business operations by using a data model corresponding to a current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operations of the account according to account dimensions.
In the embodiment of the disclosure, a data model upgrading scheme of an old data model state (initial state) -a process state (process state) -a new data model state (final state) is provided, and a bottleneck that distributed system service expandability is limited by a data model is broken through. That is, the data model upgrade scheme according to embodiments of the present disclosure may be considered to be an upgrade scheme based on a state machine of "initial state-process state-final state".
In the embodiments of the present disclosure, although only the upgrading of the data processing model of the server is mentioned, those skilled in the art can understand that the data model upgrading scheme according to the embodiments of the present disclosure is equally applicable to the server cluster, whether centralized or distributed. Thus, in embodiments of the present disclosure, a server may refer to a cluster of servers.
According to the data model upgrading scheme, write forbidding is not needed, and therefore, the current data model state of the server can be detected to perform corresponding operation while business operation is performed.
In an embodiment according to the present disclosure, the first preset condition may be that a server in an old data model state is at a preset time point, a server in the old data model state is in a preset upgrade batch, the server receives an instruction for upgrade, and the like.
In an embodiment according to the present disclosure, the current data model state of the server may be one of an old data model state in which the upgrade is not performed, a process state in the upgrade process, and a new data model state in which the upgrade process is completed.
In the embodiment of the present disclosure, a data processing model that passes through detects a current data model state of a server while performing a business operation, where the current data model state is one of an old data model state that is not upgraded, a process state that is in an upgrading process, and a new data model state that completes the upgrading process; the first pushing module is configured to push the server of which the current data model state is in the old data model state to the process state when a first preset condition is detected; the first pushing module is configured to perform data processing on the business operation by using a data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the account dimension, so that the upgrading complexity can be reduced, and the data model is upgraded according to the account dimension. And the new data model is directly used for the incremental data, so that the consistency of the data model can be ensured in the process state. Moreover, according to the data model upgrading scheme disclosed by the embodiment of the disclosure, lossless, unattended, no-write prohibition and no-perception data model upgrading of a user can be realized, manual intervention is not needed in the upgrading process, the upgrading risk is low, and manpower is saved.
In an embodiment according to the present disclosure, when the current data model state of the server is an old data model state, corresponding operations are performed only with the old data model, and when a first preset condition is detected, the server whose current data model state is in the old data model state is pushed to a process state. Therefore, the state in which the data model of the server is upgraded is the process state. And when the current data model state of the server is a process state, respectively applying one of a new data model and an old data model to the business operation of the account according to the account dimension. That is, when the current data model state of the server is a process state, an operation of switching to the new data model in one step is not performed on an account that is not upgraded, but one of the new data model and the old data model is applied for a different business operation. This avoids the risk of switching from the old data model to the new data model in one step and the user's apparent perception of the upgrade. And when the current data model state of the server is the new data model state, only adopting the new data model to perform corresponding operation.
In one embodiment of the present disclosure, the data processing module 603 is further configured to: according to the process state of the server, aiming at whether the account number is upgraded or not, and at least one of the data type related to the business operation of the account number and the operation type of the business operation of the account number, one of a new data model and an old data model is applied to the business operation of the account number respectively.
FIG. 11 illustrates a schematic diagram of the implementation of a data model upgrade scheme according to an embodiment of the present disclosure.
As shown in fig. 11, when a business operation is processed in the server and the current data model state of the server is an old data model state (I state), the data of the business is operated according to the old data model in a unified manner. When a business operation is processed in the server and the current data model state of the server is a new data model state (S state), the data of the business is operated according to the new data model in a unified mode. When a business operation is processed in the server and the current data model state of the server is a process state (P state), one of a new data model and an old data model is respectively applied to the business operation of the account according to whether the account is upgraded or not, the data type related to the business operation of the account and the operation type of the business operation of the account.
Specifically, under the current condition that the current data model state of the server is the process state (P state), when the data of the service operation is the state type data, inserting the data according to the new data model for the operation of adding the state type data; for the operation of modifying the state type data, judging whether the account number corresponding to the operation is upgraded or not, if the operation is upgraded, updating the data according to the new data model, and if the operation is not upgraded, updating the data according to the old data model; for operations that query for state type data, the data is queried according to the old data model. In the embodiment of the present disclosure, the status data is stateful, multiple services depend on the stateful data, and the accuracy of the data, such as the account balance, needs to be ensured, and the original balance must be acquired when balance payment is performed, so that the payment is successful.
Specifically, in the current situation that the current data model state of the server is the process state (P state), when the data of the business operation is the pipeline data, for the operation of the new pipeline data, the data is inserted according to the new data model; and for the operation of inquiring the pipeline data, inquiring the data according to the old data model. In the embodiment of the disclosure, the stream data is stateless, there is no association between multiple services, and new documents, such as transaction stream and payment stream, are generated each time a service comes, and the service can be completed as long as the new documents can be inserted. The pipelined data is characterized in that the following data does not depend on the previous data, and all data enter the database in a time-pipelined mode.
Fig. 7 shows a block diagram of an example of a data processing module 603 in a data model upgrade apparatus according to an embodiment of the present disclosure. The data processing module 603 shown in fig. 7 includes an acquisition sub-module 701 and an upgrade sub-module 702.
The obtaining sub-module 701 is configured to obtain an account in the old data model according to the process state of the server and according to a preset time period.
The upgrade submodule 702 is configured to lock accounts in the old data model one by one, in turn bringing accounts in the old data model into a process state to upgrade to the new data model.
In an embodiment according to the present disclosure, after a certain distributed server is pushed to a process state (P state) through a unified management platform, an application acquires account numbers in an old data model through a timing task, locks the account numbers one by one, and completes upgrading. When the upgrading of a certain account is completed, the process state is kept, and the logic operation can be performed according to a new data model.
In the embodiment of the disclosure, the obtaining sub-module is configured to obtain an account in an old data model according to a process state of the server and according to a preset time period; the upgrading submodule is configured to lock the account numbers in the old data model one by one, and the account numbers in the old data model are sequentially enabled to enter a process state to be upgraded to the new data model, so that lossless, unattended, write-prohibited and user-unaware upgrading of the data model can be realized, manual intervention is not needed in the upgrading process, the upgrading risk is low, and manpower is saved.
Fig. 8 shows a block diagram of a data model upgrade apparatus according to another embodiment of the present disclosure. The embodiment shown in fig. 8 differs from the embodiment shown in fig. 6 in that fig. 8 comprises a second push module 801 in addition to the detection module 601, the first push module 602 and the data processing module 603.
The second push module 801 is configured to push the server in the process state to the new data model state when all the account numbers in the server in the process state are account numbers in the new data model.
In an embodiment of the present disclosure, after all accounts of a preset batch are upgraded and the checking is completed, the server or the server cluster performing the upgrade task for the account of the preset batch is pushed to the new data model state (S state in fig. 11).
In the embodiment of the disclosure, the second pushing module is configured to push the server in the process state to the new data model state when all the account numbers in the server in the process state are account numbers in the new data model, so that lossless, unattended, write-forbidden and user-unaware data model upgrade can be realized, no manual intervention is required in the upgrade process, the upgrade risk is very low, and the labor is saved.
Fig. 9 shows a block diagram of a data model upgrade apparatus according to another embodiment of the present disclosure. The embodiment shown in fig. 9 is different from the embodiment shown in fig. 8 in that fig. 9 includes an account table establishing module 901 in addition to the detecting module 601, the first pushing module 602, the data processing module 603, and the second pushing module 801.
The account table establishing module 901 is configured to establish an account table in which accounts are recorded, wherein the account table includes an upgrade flag field that distinguishes an upgrade status of an account, and wherein the upgrade flag field flags the upgrade status of each account as one of an old data model status, a process status, and a new data model status.
In the embodiment of the disclosure, the upgrade flag field is used on the account table to distinguish the upgrade state of the account model, and scenes such as disaster tolerance, gray scale and the like can be considered at the same time, which is beneficial to maintaining business logic compatibility on the maximum level.
Fig. 10 shows a block diagram of a data model upgrade apparatus according to another embodiment of the present disclosure. The embodiment shown in fig. 10 is different from the embodiment shown in fig. 9 in that fig. 10 includes a rollback module 1001 in addition to the detection module 601, the first push module 602, the data processing module 603, the second push module 801, and the account table establishing module 901.
The rollback module 1001 is configured to perform a business logic rollback on the servers in the process state according to the upgrade flag field when a second preset condition is detected, before pushing the servers in the process state to the new data model state.
In one embodiment of the present disclosure, the model upgrade task needs to maintain business logic compatibility at the maximum level, and therefore, needs to ensure that business logic can be rolled back before pushing the server to the new data model state. Before pushing the server in the process state to the new data model state, under the condition that rollback is found to be needed, business logic rollback can be performed on the server in the process state according to the upgrading mark field. The detection of the second preset condition is that a rollback is required, for example, a certain proportion of accounts fails to be upgraded from an old data model to a new data model, the server in a process state is abnormal, and the upgrade is overtime.
In the embodiment of the disclosure, the rollback module is configured to perform business logic rollback on the server in the process state according to the upgrade flag field when a second preset condition is detected before pushing the server in the process state to the new data model state, so that the data model can be upgraded without loss, unattended operation, prohibition of writing, no perception of a user, and rollback, and the upgrade process does not require manual intervention, has a low upgrade risk, and saves manpower.
The internal functions and structures of the data model upgrade apparatus are described above, and in one possible design, the structures of the data model upgrade apparatus may be implemented as a data model upgrade device, as shown in fig. 13, and the processing device 1300 may include a processor 1301 and a memory 1302.
The memory 1302 is used for storing programs for supporting the data model upgrading device to execute the data model upgrading method in any one of the above embodiments, and the processor 1301 is configured to execute the programs stored in the memory 1302.
The memory 1302 is configured to store one or more computer instructions, which are executed by the processor 1301.
The processor 1301 is configured to perform all or part of the steps of the methods described above.
The structure of the data model upgrading device may further include a communication interface for the data model upgrading device to communicate with other devices or a communication network.
The exemplary embodiments of the present disclosure also provide a computer storage medium for storing computer software instructions for the data model upgrade apparatus, which contains a program for executing the data model upgrade method in any one of the above embodiments.
FIG. 14 is a schematic block diagram of a computer system suitable for use in implementing a data model upgrade method according to an embodiment of the present disclosure.
As shown in fig. 14, the computer system 1400 includes a Central Processing Unit (CPU)1401 that can execute various processes in the embodiment shown in fig. 1 described above according to a program stored in a Read Only Memory (ROM)1402 or a program loaded from a storage portion 1408 into a Random Access Memory (RAM) 1403. In the RAM1403, various programs and data necessary for the operation of the system 1400 are also stored. The CPU1401, ROM1402, and RAM1403 are connected to each other via a bus 1404. An input/output (I/O) interface 1405 is also connected to bus 1404.
The following components are connected to the I/O interface 1405: an input portion 1406 including a keyboard, a mouse, and the like; an output portion 1407 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker and the like; a storage portion 1408 including a hard disk and the like; and a communication portion 1409 including a network interface card such as a LAN card, a modem, or the like. The communication section 1409 performs communication processing via a network such as the internet. The driver 1410 is also connected to the I/O interface 1405 as necessary. A removable medium 1411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1410 as necessary, so that a computer program read out therefrom is installed into the storage section 1408 as necessary.
In particular, according to embodiments of the present disclosure, the method described above with reference to fig. 1 may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a medium readable thereby, the computer program comprising program code for performing the data processing method of fig. 1. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1409 and/or installed from the removable media 1411.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams may represent a module, a program segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present disclosure may be implemented by software or hardware. The units or modules described may also be provided in a processor, and the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus in the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (14)

1. A method for upgrading a data model, comprising:
detecting the current data model state of a server while executing business operation, wherein the current data model state is one of an old data model state which is not upgraded, a process state in the upgrading process and a new data model state which completes the upgrading process;
when a first preset condition is detected, pushing a server of which the current data model state is in an old data model state to a process state;
and according to the current data model state of the server, performing data processing on the business operation by using a data model corresponding to the current data model state, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the dimension of the account.
2. The method according to claim 1, wherein the performing data processing on the business operation by using a data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, applying one of a new data model and an old data model to the business operation of an account according to an account dimension respectively comprises:
according to the process state of the server, aiming at whether an account number is upgraded or not, and at least one of a data type related to business operation of the account number and an operation type of the business operation of the account number, one of the new data model and the old data model is applied to the business operation of the account number respectively.
3. The method according to claim 1 or 2, wherein the performing data processing on the business operation by using the data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, applying one of a new data model and an old data model to the business operation of an account according to an account dimension, further comprises:
acquiring an account in the old data model according to the process state of the server and a preset time period;
locking the account numbers in the old data model one by one, and sequentially enabling the account numbers in the old data model to enter the process state so as to upgrade to the new data model.
4. The method of claim 1, further comprising:
and when all the account numbers in the server in the process state are the account numbers in the new data model, pushing the server in the process state to the new data model state.
5. The method of claim 4, further comprising:
the method comprises the steps of establishing an account table recorded with accounts, wherein the account table comprises an upgrading marking field for distinguishing upgrading states of the accounts, and the upgrading marking field marks the upgrading state of each account into one of an old data model state, a process state and a new data model state.
6. The method of claim 5, further comprising:
before the server in the process state is pushed to the new data model state, when a second preset condition is detected, service logic rollback is carried out on the server in the process state according to the upgrading mark field.
7. A data model upgrade apparatus, comprising:
the detection module is configured to detect a current data model state of the server while executing business operation, wherein the current data model state is one of an old data model state which is not upgraded, a process state in an upgrading process and a new data model state which completes the upgrading process;
the first pushing module is configured to push the server of which the current data model state is in the old data model state to the process state when a first preset condition is detected;
and the data processing module is configured to perform data processing on the business operation by using a data model corresponding to the current data model state according to the current data model state of the server, wherein when the current data model state of the server is a process state, one of a new data model and an old data model is respectively applied to the business operation of the account according to the account dimension.
8. The apparatus of claim 7, wherein the data processing module is further configured to:
according to the process state of the server, aiming at whether an account number is upgraded or not, and at least one of a data type related to business operation of the account number and an operation type of the business operation of the account number, one of the new data model and the old data model is applied to the business operation of the account number respectively.
9. The apparatus according to claim 7 or 8, wherein the data processing module comprises:
the obtaining submodule is configured to obtain an account in the old data model according to the process state of the server and a preset time period;
and the upgrading sub-module is configured to lock the account numbers in the old data model one by one, and sequentially enable the account numbers in the old data model to enter the process state so as to upgrade to the new data model.
10. The apparatus of claim 7, further comprising:
and the second pushing module is configured to push the server in the process state to the new data model state when all the account numbers in the server in the process state are account numbers in the new data model.
11. The apparatus of claim 10, further comprising:
the account table establishing module is configured to establish an account table recorded with accounts, wherein the account table comprises an upgrade marking field for distinguishing upgrade states of the accounts, and the upgrade marking field marks the upgrade state of each account as one of an old data model state, a process state and a new data model state.
12. The apparatus of claim 11, further comprising:
and the rollback module is configured to roll back the service logic of the server in the process state according to the upgrading mark field when a second preset condition is detected before pushing the server in the process state to the new data model state.
13. An electronic device comprising a memory and a processor; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions are to be executed by the processor to implement the method of any one of claims 1-6.
14. A readable storage medium having stored thereon computer instructions, characterized in that the computer instructions, when executed by a processor, implement the method according to any one of claims 1-6.
CN201811152496.9A 2018-09-29 2018-09-29 Data model upgrading method, device, equipment and readable storage medium Active CN109582330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811152496.9A CN109582330B (en) 2018-09-29 2018-09-29 Data model upgrading method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811152496.9A CN109582330B (en) 2018-09-29 2018-09-29 Data model upgrading method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN109582330A CN109582330A (en) 2019-04-05
CN109582330B true CN109582330B (en) 2021-08-03

Family

ID=65920187

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811152496.9A Active CN109582330B (en) 2018-09-29 2018-09-29 Data model upgrading method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN109582330B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488170A (en) * 2020-04-07 2020-08-04 支付宝(杭州)信息技术有限公司 Method, device and equipment for updating business processing model

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317607A (en) * 2014-09-27 2015-01-28 昆明钢铁集团有限责任公司 Enterprise In-house IOS APP automatic update system and method
CN104899257A (en) * 2015-05-18 2015-09-09 北京京东尚科信息技术有限公司 Data updating method and device in distributed data warehouse
CN104915237A (en) * 2015-06-24 2015-09-16 深圳市兰丁科技有限公司 Upgrading method and upgrading control method of Bluetooth device firmware program, and equipment
CN106302629A (en) * 2016-06-06 2017-01-04 北京奇虎科技有限公司 A kind of information-pushing method and device
CN107092701A (en) * 2017-05-02 2017-08-25 山东浪潮通软信息科技有限公司 The data processing method and device of a kind of Multidimensional Data Model

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106973112B (en) * 2017-04-18 2020-12-11 北京金山安全软件有限公司 Data processing method and system, terminal and server thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104317607A (en) * 2014-09-27 2015-01-28 昆明钢铁集团有限责任公司 Enterprise In-house IOS APP automatic update system and method
CN104899257A (en) * 2015-05-18 2015-09-09 北京京东尚科信息技术有限公司 Data updating method and device in distributed data warehouse
CN104915237A (en) * 2015-06-24 2015-09-16 深圳市兰丁科技有限公司 Upgrading method and upgrading control method of Bluetooth device firmware program, and equipment
CN106302629A (en) * 2016-06-06 2017-01-04 北京奇虎科技有限公司 A kind of information-pushing method and device
CN107092701A (en) * 2017-05-02 2017-08-25 山东浪潮通软信息科技有限公司 The data processing method and device of a kind of Multidimensional Data Model

Also Published As

Publication number Publication date
CN109582330A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
US8688628B2 (en) Nested queued transaction manager
US20070169101A1 (en) Multi-Branch Management for Updating Software
US9075695B2 (en) Version conflict checking to installable unit
CN110225078B (en) Application service updating method, system and terminal equipment
CN111125106B (en) Batch running task execution method, device, server and storage medium
CN107368513B (en) Method and device for updating client database
CN115858488A (en) Parallel migration method and device based on data governance and readable medium
JP6329552B2 (en) Reference data segmentation from single table to multiple tables
CN109582330B (en) Data model upgrading method, device, equipment and readable storage medium
CN110795495A (en) Data processing method and device, electronic equipment and computer readable medium
CN116069725A (en) File migration method, device, apparatus, medium and program product
US9652766B1 (en) Managing data stored in memory locations having size limitations
CN107277108B (en) Method, device and system for processing messages at nodes of block chain
CN115329395A (en) Database data processing method, device, system, equipment and storage medium
CN110795259A (en) Method and device for analyzing application collapse
CN114064678A (en) Event data processing method and device and terminal equipment
CN110232069B (en) Customer information intelligent input method and device based on big data
CN113468143A (en) Data migration method, system, computing device and storage medium
CN111125743B (en) Authority management method, system, computer device and computer readable storage medium
CN110674119A (en) Data processing method, system and computer readable storage medium
US20170024438A1 (en) Method and system for data integration
CN110554895A (en) Data calling method and device
CN110807037A (en) Data modification method and device, electronic equipment and storage medium
CN111159198B (en) Parameter transaction processing method and device, computer equipment and readable storage medium
CN115114258A (en) Data copying method and device, electronic equipment and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200921

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200921

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant