CN114036218A - Data model switching method and device, server and storage medium - Google Patents

Data model switching method and device, server and storage medium Download PDF

Info

Publication number
CN114036218A
CN114036218A CN202111331095.1A CN202111331095A CN114036218A CN 114036218 A CN114036218 A CN 114036218A CN 202111331095 A CN202111331095 A CN 202111331095A CN 114036218 A CN114036218 A CN 114036218A
Authority
CN
China
Prior art keywords
data
current
mode
verification
request
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.)
Pending
Application number
CN202111331095.1A
Other languages
Chinese (zh)
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.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN202111331095.1A priority Critical patent/CN114036218A/en
Publication of CN114036218A publication Critical patent/CN114036218A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity

Abstract

The embodiment of the invention discloses a data model switching method, a device, a server and a storage medium, wherein the method comprises the following steps: receiving a current data request sent by a client; processing the current data request based on the current processing mode to determine current response data corresponding to the current data request, and returning the current response data to the client, wherein the initial mode of the current processing mode is a data verification mode; and if the current data request meets the preset data verification success condition, updating the current processing mode from the data verification mode to a data model switching mode, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model. By the technical scheme of the embodiment of the invention, the data of the original data model and the data of the improved data model can be automatically verified on line, the consistency of the data is ensured, the seamless switching of the data model is realized under the condition of not influencing the operation of the existing service, and the switching efficiency is improved.

Description

Data model switching method and device, server and storage medium
Technical Field
The embodiment of the invention relates to computer technology, in particular to a data model switching method, a data model switching device, a server and a storage medium.
Background
With the rapid development of computer technology, various application software is developed. When the user scale of the application software is larger and larger or the business function is expanded, the original data model used by the application software background server cannot meet the current requirement, so that the data model needs to be redesigned, and the original data model is switched to an improved data model to meet the software requirement.
At present, in order to avoid influencing the existing business operation of application software, the data consistency of an original data model and an improved data model is generally verified manually offline. However, such offline manual verification is difficult to ensure data consistency and reduce handover efficiency, and it is also difficult to verify whether the improved data model is compatible with the existing services.
Disclosure of Invention
The embodiment of the invention provides a data model switching method, a data model switching device, a server and a storage medium, which are used for carrying out online automatic verification on data of an original data model and an improved data model, ensuring data consistency, realizing seamless switching of the data model under the condition of not influencing the operation of the existing service and improving switching efficiency.
In a first aspect, an embodiment of the present invention provides a data model switching method, including:
receiving a current data request sent by a client;
processing the current data request based on a current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein an initial mode of the current processing mode is a data verification mode, the data verification mode is a mode of performing data verification on an original data model and an improved data model, and determining the current response data corresponding to the current data request based on a data verification result;
and if the current data request meets the preset data verification success condition, updating the current processing mode from the data verification mode to a data model switching mode, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model.
In a second aspect, an embodiment of the present invention further provides a data model switching apparatus, including:
the current data request receiving module is used for receiving a current data request sent by a client;
the current response data determining module is used for processing the current data request based on a current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein the initial mode of the current processing mode is a data verification mode, the data verification mode is a mode for performing data verification on an original data model and an improved data model, and determining the current response data corresponding to the current data request based on a data verification result;
and the current processing mode updating module is used for updating the current processing mode from the data verification mode to a data model switching mode if the current processing mode is detected to meet the preset data verification success condition, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model.
In a third aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the data model switching method provided by the embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data model switching method provided in the embodiment of the present invention.
According to the embodiment of the invention, the data verification mode and the data model switching mode are preset, and the data verification mode is used as the initial mode of the current processing mode, so that the data verification can be carried out on the original data model and the improved data model in the data verification mode, and the current response data corresponding to the current data request sent by the client side is determined based on the data verification result, so that the online automatic verification can be carried out on the data of the original data model and the improved data model, manual participation is not needed, and the data consistency is further ensured. If the current condition that the preset data verification success condition is met is detected, the current processing mode is updated to the data model switching mode from the data verification mode, so that the current response data corresponding to the current data request sent by the client side can be determined based on the improved data model in the data model switching mode, the original data model is switched to the improved data model, seamless switching of the data model is achieved under the condition that the operation of the existing service is not affected, and the switching efficiency is improved.
Drawings
Fig. 1 is a flowchart of a data model switching method according to an embodiment of the present invention;
fig. 2 is a flowchart of a data model switching method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data model switching apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a data model switching method according to an embodiment of the present invention, which is applicable to switching data models with different structures, and is particularly applicable to an application scenario in which data models are complex, data must be completely consistent in a data switching process, and an existing service runs continuously. The method can be executed by a data model switching device, which can be implemented by software and/or hardware, and is integrated in a server. As shown in fig. 1, the method specifically includes the following steps:
and S110, receiving the current data request sent by the client.
A client may refer to an application software program that provides a local service for a user. The current data request may refer to a currently received data request. The current data request may include a data read request, such as a data query request, and may also include a data write request, such as a data registration request.
And S120, processing the current data request based on the current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein the initial mode of the current processing mode is a data verification mode, the data verification mode is a mode of performing data verification on the original data model and the improved data model, and determining the current response data corresponding to the current data request based on the data verification result.
The current processing mode may refer to a manner of processing the current data request. The current response data may refer to a request processing result. A data model may refer to a database used to store data. The data model may include: a hierarchical model, a mesh model, or a relational model. The fundamental difference between them is the different way in which the data is expressed in relation to each other. The original data model may refer to a data model originally used by the server. The improved data model is a data model obtained after redesign of the improvement. The improved data model in this embodiment has a different data structure from the original data model, so that the data consistency after data synchronization needs to be verified. The improved data model and the original data model can realize one-to-one correspondence, namely field mapping relation, through a single field and a plurality of joint fields, so that data synchronization operation and data verification operation can be carried out based on the field mapping relation.
Specifically, when the data model needs to be switched, the data verification mode is used as an initial mode of the current processing mode, so that the data verification mode is used for performing data verification on the original data model and the improved data model, and current response data corresponding to the current data request is determined based on a data verification result, so that online automatic verification of the data of the original data model and the improved data model is realized. For example, the original request processing logic may be used to obtain first field data corresponding to the current data request from the original data model, and perform logic processing on the first field data to obtain first business data that can be returned to the client, and the improved request processing logic may be used to obtain second field data corresponding to the current data request from the improved data model, and perform logic processing on the second field data to obtain second business data that can be returned to the client. The embodiment may perform the data checking operation and the response data returning operation synchronously, for example, it may check whether the first field data matches the second field data based on the field mapping relationship, check whether the first service data is the same as the second service data, and return the second service data to the client as the current response data corresponding to the current data request when the checking is successful, that is, the first field data matches the second field data and the first service data is the same as the second service data, or directly return the first service data to the client as the current response data corresponding to the current data request no matter the checking is successful or the checking is failed, so as to improve the response speed. If the verification fails, namely the first field data is not matched with the second field data and/or the first service data is different from the second service data, the warning information can be generated and reported to relevant personnel, and the relevant personnel can be reminded to check and maintain. The embodiment may also asynchronously perform the data verification operation and the response data return operation to further improve the response speed. For example, the first service data may be directly returned to the client as the current response data corresponding to the current data request, and at the same time, whether the first field data is matched with the second field data and whether the first service data is identical to the second service data are asynchronously checked, and when the checking fails, the warning information may be generated, so that the response speed may be further improved, and complete data consistency is ensured in the data model switching process.
And S130, if the current processing mode meets the preset data verification success condition, updating the current processing mode from the data verification mode to a data model switching mode, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model.
The preset data verification success condition may be preset, and is used to represent a condition that the current processing mode may be updated. For example, the preset data verification success condition may mean that no alarm information is generated within a preset time period, or no alarm information is generated after a preset number of requests are processed.
Specifically, when it is detected that the current request processing condition satisfies the preset data verification success condition, it indicates that the data of the original data model is consistent with the data of the improved data model, at this time, the current processing mode may be updated from the data verification mode to the data model switching mode, and the operation of step S110 is returned to be executed, so that the original data model may be switched to the improved data model by using the data model switching mode, and the current response data corresponding to the subsequently received current data request is directly determined based on the improved data model. By means of updating the current processing mode, seamless switching of data models can be achieved without influencing the operation of the existing service, switching efficiency is improved, improvement on a service level is not needed, the service is not perceived, and switching cost is reduced.
According to the technical scheme of the embodiment, the data verification mode and the data model switching mode are preset, and the data verification mode is used as the initial mode of the current processing mode, so that the data verification can be performed on the original data model and the improved data model in the data verification mode, and the current response data corresponding to the current data request sent by the client side is determined based on the data verification result, so that the data of the original data model and the improved data model can be automatically verified on line, manual participation is not needed, and the data consistency is further ensured. If the current condition that the preset data verification success condition is met is detected, the current processing mode is updated to the data model switching mode from the data verification mode, so that the current response data corresponding to the current data request sent by the client side can be determined based on the improved data model in the data model switching mode, the original data model is switched to the improved data model, seamless switching of the data model is achieved under the condition that the operation of the existing service is not affected, and the switching efficiency is improved.
On the basis of the above technical solution, step S120 may include: detecting whether the current data request is in a current verification request range or not based on a current request identifier in the current data request, wherein the current verification request range is updated based on a current verification result; if so, processing the current data request based on the current processing mode, and determining current response data corresponding to the current data request; if not, determining current response data corresponding to the current data request based on the original data model.
The current authentication request range may be a set formed by user-configured data request identifiers currently used for data verification. The current authentication request scope may be updated with a configuration based on the current authentication result. For example, if all the data requests within the current verification request range are successfully verified, the current verification request range may be increased, so as to verify more processing conditions of the data requests and ensure data consistency.
Specifically, when the data volume is large, a small number of data requests can be checked preferentially by configuring the current verification request range, and the verification range of the data requests is expanded after no problem exists, so as to further avoid the influence on the response speed. When the current processing mode is the data verification mode, whether the current data request is in the range of the current verification request or not can be detected, if yes, the data verification can be performed on the current data request, at this time, the data verification can be performed on the original data model and the improved data model based on the data verification mode, and current response data corresponding to the current data request is determined based on the data verification result. If the current data request is not in the range of the current verification request, the data verification of the current data request is not needed, and at the moment, the current response data corresponding to the current data request can be determined based on the original data model by utilizing the original request processing logic, so that the gradual verification of the data model can be realized.
On the basis of the above technical solution, before step S110, the method may further include: and synchronously storing the original field data in the original data model into the improved data model based on the field mapping relation between the original data model and the improved data model.
Specifically, after the improved data model is obtained, the improved field data corresponding to the original field data in the original data model can be determined based on the field mapping relationship between the original data model and the improved data model, and the improved field data is stored in the improved data model, so that data synchronization is realized, and data verification is performed after data synchronization, so that the accuracy and consistency of data synchronization are ensured.
Example two
Fig. 2 is a flowchart of a data model switching method according to a second embodiment of the present invention, where on the basis of the second embodiment, the data verification mode in this embodiment may include: correspondingly, the initial mode of the current processing mode is the field data verification mode, and on the basis, the step of updating the current processing mode from the data verification mode to the data model switching mode if the current processing mode is detected to meet the preset data verification success condition is further optimized. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted.
Referring to fig. 2, the data model switching method provided in this embodiment specifically includes the following steps:
s210, receiving a current data request sent by a client.
And S220, processing the current data request based on the current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein the initial mode of the current processing mode is a field data verification mode.
The field data verification mode may refer to a mode for performing field data verification on the original data model and the improved data model, and determining current response data corresponding to the current data request. The field data may refer to the raw data stored in the data model, i.e., raw underlying data.
Specifically, when the data model needs to be switched, the field data verification mode is used as an initial mode of the current processing mode, so that field data verification is performed on the original data model and the improved data model by using the field data verification mode, and consistency of field data is ensured. For example, in the field data verification process, the data verification operation and the response data return operation may be performed synchronously, or the data verification operation and the response data return operation may be performed asynchronously to ensure the response speed.
For example, when the current processing mode is the field data verification mode, S220 may include: acquiring first field data corresponding to the current data request from the original data model, and acquiring second field data corresponding to the current data request from the improved data model; and determining current response data corresponding to the current data request based on the first field data, asynchronously verifying whether the first field data is matched with the second field data based on a field mapping relation between the original data model and the improved data model, and generating alarm information if the first field data is not matched with the second field data.
Specifically, the original request processing logic may be utilized to obtain the first field data corresponding to the current data request from the original data model, and the improved request processing logic may also be utilized to obtain the second field data corresponding to the current data request from the improved data model. After the first field data is obtained, data processing can be directly performed on the first field data, and the obtained business data is returned to the client as current response data. When the current response data is determined, whether the first field data is matched with the second field data or not can be verified through starting an asynchronous thread based on a field mapping relation by utilizing the asynchronous thread, if not, alarm information can be generated and reported to relevant personnel, and the relevant personnel can be reminded to check and maintain, so that through asynchronous operation, the response speed can be guaranteed while the request processing accuracy is guaranteed, and the influence on user experience is avoided.
For example, if the current data request is a data query request, field data queried from the original data model may be used as first field data, field data queried from the improved data model may be used as second field data, data processing is performed on the first field data to obtain a query result to be displayed by the client, the query result is returned to the client as current response data, and asynchronous verification is performed on the first field data and the second field data at the same time, that is, whether a correspondence between the first field data and the second field data corresponds to a field mapping relationship, and if not, alarm information is generated.
For another example, if the current data request is a registration request, the registration information in the registration request may be written into the original data model, and a result of whether the writing is successful is used as first field data, and the registration information in the registration request is written into the improved data model, and a result of whether the writing is successful is used as second field data, and data processing is performed on the first field data to obtain a registration result to be displayed by the client, and the registration result is returned to the client as current response data, and at the same time, the first field data and the second field data are asynchronously checked, that is, whether a corresponding relationship between the first field data and the second field data conforms to a field mapping relationship, and if not, alarm information is generated.
And S230, if the current condition that the preset data verification success condition is met is detected, sequentially updating the current processing mode according to the sequence of the field data verification mode, the service data verification mode and the data model switching mode, and stopping updating until the current processing mode is the data model switching mode.
Specifically, when it is detected that the current request processing condition satisfies the preset data verification success condition, it indicates that the field data of the original data model is consistent with the field data of the improved data model, at this time, the current processing mode may be updated from the field data verification mode to the service data verification mode, and the operation of step S110 is returned to be executed, so that the service data verification is performed on the original data model and the improved data model again by using the service data verification mode, and the consistency of the service data is ensured. The service data may refer to data to be displayed by the client, that is, data returned to the client through the interface.
For example, when the current processing mode is the traffic data verification mode, S220 may include: acquiring third field data corresponding to the current data request from the original data model, and determining first business data based on the third field data; acquiring fourth field data corresponding to the current data request from the improved data model, and determining second service data based on the fourth field data; and performing data verification on the first service data and the second service data, and determining current response data corresponding to the current data request based on a data verification result.
Specifically, the original request processing logic may be utilized to obtain third field data corresponding to the current data request from the original data model, and process the third field data to obtain the first service data that can be returned to the client. Meanwhile, the improved request processing logic can be utilized to obtain the fourth field data corresponding to the current data request from the improved data model, and the fourth field data is processed to obtain the second service data which can be returned to the client. The embodiment can determine whether the second service data after using the improved data model is consistent with the original first service data by verifying whether the first service data is the same as the second service data, so that the data after switching the data model can be further ensured to be completely consistent.
For example, performing data verification on the first service data and the second service data, and determining current response data corresponding to the current data request based on a data verification result may include: if the first service data is verified to be the same as the second service data, the second service data is used as current response data corresponding to the current data request; and if the first service data is different from the second service data, the first service data is used as current response data corresponding to the current data request, and alarm information is generated. When the first service data is the same as the second service data, the second service data which uses the improved data model is returned to the client as the current response data, so that the gradual switching of the data model can be realized.
Specifically, when it is detected that the current request processing condition satisfies the preset data verification success condition, it indicates that the service data of the original data model is also consistent with the service data of the improved data model, at this time, the current processing mode may be updated from the service data verification mode to the data model switching mode, and the operation of step S110 is returned to be executed, so that the original data model may be switched to the improved data model by using the data model switching mode, and the current response data corresponding to the subsequently received current data request is directly determined based on the improved data model. By means of updating the current processing mode, seamless switching of data models can be achieved without influencing the operation of the existing service, switching efficiency is improved, improvement on a service level is not needed, the service is not perceived, and switching cost is reduced.
According to the technical scheme, the field data verification mode and the service data verification mode are utilized, and the field data verification and the service data verification are respectively carried out on the original data model and the improved data model, so that the step-by-step verification of the data model can be realized, the problem can be found in time and solved in time, and the switching efficiency is further improved.
The following is an embodiment of a data model switching apparatus provided in an embodiment of the present invention, which belongs to the same inventive concept as the data model switching methods in the foregoing embodiments, and reference may be made to the above embodiment of the data model switching method for details that are not described in detail in the embodiment of the data model switching apparatus.
EXAMPLE III
Fig. 3 is a schematic structural diagram of data model switching according to a third embodiment of the present invention, which is applicable to a case of switching data models with different structures, as shown in fig. 3, the apparatus includes: a current data request receiving module 310, a current response data determining module 320, and a current processing mode updating module 330.
The current data request receiving module 310 is configured to receive a current data request sent by a client; a current response data determining module 320, configured to process the current data request based on a current processing mode, determine current response data corresponding to the current data request, and return the current response data to the client, where an initial mode of the current processing mode is a data verification mode, and the data verification mode is a mode in which data verification is performed on an original data model and an improved data model, and the current response data corresponding to the current data request is determined based on a data verification result; the current processing mode updating module 330 is configured to update the current processing mode from the data verification mode to a data model switching mode if it is detected that the preset data verification success condition is currently met, where the data model switching mode is a mode in which current response data corresponding to the current data request is determined based on the improved data model.
Optionally, the data verification mode comprises: a field data verification mode and a service data verification mode; correspondingly, the initial mode of the current processing mode is a field data verification mode;
the current processing mode updating module 330 is specifically configured to: and if the current condition that the preset data verification success condition is met is detected, sequentially updating the current processing mode according to the sequence of the field data verification mode, the service data verification mode and the data model switching mode, and stopping updating until the current processing mode is the data model switching mode.
Optionally, the current response data determining module 320 is specifically configured to:
when the current processing mode is a field data verification mode, acquiring first field data corresponding to the current data request from the original data model and acquiring second field data corresponding to the current data request from the improved data model; and determining current response data corresponding to the current data request based on the first field data, asynchronously verifying whether the first field data is matched with the second field data based on a field mapping relation between the original data model and the improved data model, and generating alarm information if the first field data is not matched with the second field data.
Optionally, the current response data determining module 320 is further specifically configured to: when the current processing mode is a business data verification mode, acquiring third field data corresponding to the current data request from the original data model, and determining first business data based on the third field data; acquiring fourth field data corresponding to the current data request from the improved data model, and determining second service data based on the fourth field data; and performing data verification on the first service data and the second service data, and determining current response data corresponding to the current data request based on a data verification result.
Optionally, the current response data determining module 320 is further specifically configured to: if the first service data is verified to be the same as the second service data, the second service data is used as current response data corresponding to the current data request; and if the first service data is different from the second service data, the first service data is used as current response data corresponding to the current data request, and alarm information is generated.
Optionally, the current response data determining module 320 is specifically configured to:
detecting whether the current data request is in a current verification request range or not based on a current request identifier in the current data request, wherein the current verification request range is updated based on a current verification result; if so, processing the current data request based on the current processing mode, and determining current response data corresponding to the current data request; if not, determining current response data corresponding to the current data request based on the original data model.
Optionally, the apparatus further comprises:
and the data synchronization module is used for synchronously storing the original field data in the original data model into the improved data model based on the field mapping relation between the original data model and the improved data model before receiving the current data request sent by the client.
The data model switching device provided by the embodiment of the invention can execute the data model switching method provided by any embodiment of the invention, and has the corresponding functional module and the beneficial effect of executing the data model switching method.
It should be noted that, in the embodiment of the data model switching apparatus, the included units and modules are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Example four
Fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary server 12 suitable for use in implementing embodiments of the present invention. The server 12 shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 4, the server 12 is in the form of a general purpose computing device. The components of the server 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The server 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by server 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The server 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The server 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the server 12, and/or with any devices (e.g., network card, modem, etc.) that enable the server 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the server 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the server 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the server 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, to implement a data model switching method provided by the embodiment of the present invention, the method includes:
receiving a current data request sent by a client;
processing the current data request based on a current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein the initial mode of the current processing mode is a data verification mode, the data verification mode is a mode for performing data verification on an original data model and an improved data model, and determining the current response data corresponding to the current data request based on a data verification result;
and if the current data request meets the preset data verification success condition, updating the current processing mode from the data verification mode to a data model switching mode, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model.
Of course, those skilled in the art can understand that the processor may also implement the technical solution of the data model switching method provided in any embodiment of the present invention.
EXAMPLE five
The present embodiment provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of a data model switching method as provided in any of the embodiments of the present invention, the method comprising:
receiving a current data request sent by a client;
processing the current data request based on a current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein the initial mode of the current processing mode is a data verification mode, the data verification mode is a mode for performing data verification on an original data model and an improved data model, and determining the current response data corresponding to the current data request based on a data verification result;
and if the current data request meets the preset data verification success condition, updating the current processing mode from the data verification mode to a data model switching mode, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A data model switching method is characterized by comprising the following steps:
receiving a current data request sent by a client;
processing the current data request based on a current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein an initial mode of the current processing mode is a data verification mode, the data verification mode is a mode of performing data verification on an original data model and an improved data model, and determining the current response data corresponding to the current data request based on a data verification result;
and if the current data request meets the preset data verification success condition, updating the current processing mode from the data verification mode to a data model switching mode, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model.
2. The method of claim 1, wherein the data validation mode comprises: a field data verification mode and a service data verification mode; correspondingly, the initial mode of the current processing mode is the field data verification mode;
if the current processing mode is detected to meet the preset data verification success condition, updating the current processing mode from the data verification mode to a data model switching mode, wherein the updating comprises the following steps:
and if the current condition that the preset data verification success condition is met is detected, sequentially updating the current processing mode according to the sequence of the field data verification mode, the service data verification mode and the data model switching mode, and stopping updating until the current processing mode is the data model switching mode.
3. The method of claim 2, wherein processing the current data request based on the current processing mode to determine current response data corresponding to the current data request comprises:
when the current processing mode is the field data verification mode, acquiring first field data corresponding to the current data request from the original data model, and acquiring second field data corresponding to the current data request from the improved data model;
and determining current response data corresponding to the current data request based on the first field data, asynchronously verifying whether the first field data is matched with the second field data based on a field mapping relation between an original data model and an improved data model, and generating alarm information if the first field data is not matched with the second field data.
4. The method of claim 2, wherein processing the current data request based on the current processing mode to determine current response data corresponding to the current data request further comprises:
when the current processing mode is the service data verification mode, acquiring third field data corresponding to the current data request from the original data model, and determining first service data based on the third field data;
acquiring fourth field data corresponding to the current data request from the improved data model, and determining second service data based on the fourth field data;
and performing data verification on the first service data and the second service data, and determining current response data corresponding to the current data request based on a data verification result.
5. The method of claim 4, wherein the performing data verification on the first service data and the second service data and determining current response data corresponding to a current data request based on a data verification result comprises:
if the first service data is verified to be the same as the second service data, the second service data is used as current response data corresponding to the current data request;
and if the first service data is different from the second service data, the first service data is used as current response data corresponding to the current data request, and warning information is generated.
6. The method according to any one of claims 1-5, wherein the processing the current data request based on the current processing mode to determine current response data corresponding to the current data request comprises:
detecting whether the current data request is in a current verification request range or not based on a current request identifier in the current data request, wherein the current verification request range is updated based on a current verification result;
if so, processing the current data request based on the current processing mode, and determining current response data corresponding to the current data request;
and if not, determining current response data corresponding to the current data request based on the original data model.
7. The method according to any of claims 1-5, further comprising, before the receiving the current data request sent by the client:
and synchronously storing the original field data in the original data model into the improved data model based on the field mapping relation between the original data model and the improved data model.
8. A data model switching apparatus, comprising:
the current data request receiving module is used for receiving a current data request sent by a client;
the current response data determining module is used for processing the current data request based on a current processing mode, determining current response data corresponding to the current data request, and returning the current response data to the client, wherein the initial mode of the current processing mode is a data verification mode, the data verification mode is a mode for performing data verification on an original data model and an improved data model, and determining the current response data corresponding to the current data request based on a data verification result;
and the current processing mode updating module is used for updating the current processing mode from the data verification mode to a data model switching mode if the current processing mode is detected to meet the preset data verification success condition, wherein the data model switching mode is a mode for determining current response data corresponding to the current data request based on the improved data model.
9. A server, characterized in that the server comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the data model switching method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data model switching method according to any one of claims 1 to 7.
CN202111331095.1A 2021-11-11 2021-11-11 Data model switching method and device, server and storage medium Pending CN114036218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111331095.1A CN114036218A (en) 2021-11-11 2021-11-11 Data model switching method and device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111331095.1A CN114036218A (en) 2021-11-11 2021-11-11 Data model switching method and device, server and storage medium

Publications (1)

Publication Number Publication Date
CN114036218A true CN114036218A (en) 2022-02-11

Family

ID=80143971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111331095.1A Pending CN114036218A (en) 2021-11-11 2021-11-11 Data model switching method and device, server and storage medium

Country Status (1)

Country Link
CN (1) CN114036218A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115188190A (en) * 2022-07-08 2022-10-14 阿波罗智能技术(北京)有限公司 Updating method and device of traffic data processing mode and vehicle-road cooperation system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115188190A (en) * 2022-07-08 2022-10-14 阿波罗智能技术(北京)有限公司 Updating method and device of traffic data processing mode and vehicle-road cooperation system
CN115188190B (en) * 2022-07-08 2023-09-26 阿波罗智能技术(北京)有限公司 Updating method and device of traffic data processing mode and vehicle-road cooperative system

Similar Documents

Publication Publication Date Title
CN113064748B (en) Process succession method, device, electronic equipment and storage medium
CN114528044B (en) Interface calling method, device, equipment and medium
CN111324441A (en) Operating environment switching method and device, computer equipment and storage medium
CN112379883A (en) Code file generation method, device, equipment and storage medium
CN110647318A (en) Method, device, equipment and medium for creating instance of stateful application
CN113360519B (en) Data processing method, device, equipment and storage medium
CN111338834B (en) Data storage method and device
CN111737564A (en) Information query method, device, equipment and medium
CN115795211A (en) Page display method, device, system, equipment and storage medium
CN105955838A (en) System halt reason check method and device
WO2022134809A1 (en) Model training processing method and apparatus, computer device, and medium
CN114036218A (en) Data model switching method and device, server and storage medium
CN112713964B (en) Data verification acceleration method and device, computer equipment and storage medium
CN113220342A (en) Centralized configuration method and device, electronic equipment and storage medium
CN113760242A (en) Data processing method, device, server and medium
CN110096543B (en) Data operation method, device, server and medium of application program
CN112799760A (en) Form rendering method and device
CN111061740A (en) Data synchronization method, equipment and storage medium
CN113296796A (en) Project release method, device, system, storage medium and electronic equipment
CN112204527A (en) Method and system for processing engineering data in a multi-engineering system environment
CN112711602B (en) Method and device for running stored procedure, database system and storage medium
CN112261072B (en) Service calling method, device, equipment and storage medium
CN112925796A (en) Write consistency control method, device, equipment and storage medium
CN112364268A (en) Resource acquisition method and device, electronic equipment and storage medium
CN111324374A (en) Application program registration method and device based on application performance management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination