Method, system, device and medium for processing associated data stored in redundant data tables
Through multi-level distribution, asynchronous processing and the use of data processing status tables, the efficiency and reliability problems during redundant data updates are solved, ensuring the fast, reliability of data updates and the maintenance of raw data processing performance.
Patent Information
- Application Number
- CN202110962294.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-20
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-08-20
AI Technical Summary
When the prior art updates the associated data of redundant storage, it may cause database transactions to affect the operation efficiency of the original data, or updates fail in an unstable network environment, affecting data accuracy.
By using multi-level distribution and asynchronous processing, we can build a data processing status table, register and cancel data update records, ensuring the tracking of data processing status and exception processing, and avoiding data update failure.
It realizes the maintenance of original data processing performance, while ensuring fast and reliable update of redundant data, avoiding the problem of data failure in timely update data.
Smart Images

Figure CN113656424B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method, system, device and medium for processing associated data redundantly stored in a data table. Background Art
[0002] In all kinds of information systems and their integration processes, there are cases where some data in a data table is redundantly stored in multiple other data tables. Taking accounting documents as an example, many documents have a field in their data tables specifically set up to store their corresponding accounting document numbers. However, when the original data changes, how to update the redundantly stored data in the associated data tables becomes a problem. Still taking accounting documents as an example, we need to consider how to update the redundantly stored document numbers in the data tables of each document when the document number of the accounting document changes.
[0003] In the current method, there are two widely used methods for updating redundantly stored associated data: 1) in the process of updating the original data, the redundantly stored associated data is synchronously modified. When there are many associated data, this method may cause the database transaction to be too large, affecting the operating efficiency of the original data; 2) after the original data is updated, the redundantly stored associated data is updated through a message queue. In the case of unstable network and other environments, this method may cause problems such as failure to update the redundantly stored associated data and inability to perform compensation operations, thereby affecting the accuracy of the associated data. Therefore, in order to solve the above problems, it is urgent to propose a fast and reliable redundant data update method. Summary of the invention
[0004] In view of this, the present invention proposes a method, system, device and medium for processing associated data redundantly stored in a data table, which adopts a multi-level distribution and asynchronous processing approach, thereby ensuring that the performance of original data processing is not affected and that redundant data is quickly and reliably updated.
[0005] Based on the above purpose, an embodiment of the present invention provides a method for processing associated data redundantly stored in a data table, which specifically includes the following steps:
[0006] Construct data processing status table;
[0007] In response to the distribution service manager receiving a data update request sent by the original data, starting the level 1 distribution device and the plurality of level 2 distribution devices;
[0008] Initiate level 1 distribution based on the level 1 distribution device, register level 1 distribution records in the data processing status table, and generate corresponding processing status;
[0009] In response to the first-level distribution device receiving the first-level distribution request sent by the distribution service manager, the processing status corresponding to the first-level distribution record in the data processing status table is updated, and the second-level distribution device is called in sequence based on the first-level distribution device to start the second-level distribution, and the second-level distribution record is registered in the data processing status table and the corresponding processing status is generated;
[0010] In response to the second-level distribution device receiving the second-level distribution request sent by the first-level distribution device, the processing status corresponding to the second-level distribution record is updated, and the associated data corresponding to the second-level distribution device is updated.
[0011] In some embodiments, the method further comprises:
[0012] When the level 1 distribution device and multiple level 2 distribution devices are started, polling is started to check the data processing status table.
[0013] In some implementations, the step of starting the second-level distribution based on the first-level distribution device sequentially calling the second-level distribution device further includes:
[0014] In response to all Level 2 distribution device calls being successful, the Level 1 distribution records are cancelled.
[0015] In some implementations, the method further includes: in response to successful data update, canceling the corresponding level 2 distribution record.
[0016] In some implementations, the method further includes: in response to the data update being unsuccessful, updating a processing status of the level 2 distribution record.
[0017] In some implementations, initiating polling to check the data processing status table includes: checking the data processing status table according to a preset check cycle, and processing abnormal data according to a polling check strategy.
[0018] In some implementations, processing abnormal data according to a polling inspection strategy includes:
[0019] If the processing status of the processing node is started or processing and the last processing time of the processing node exceeds the preset maximum node processing time, or the processing status of the processing node is processing failure, the corresponding exception record in the data processing status table corresponding to the processing node is sent to the processing exception data table.
[0020] Another aspect of the embodiment of the present invention further provides a system for processing associated data redundantly stored in a data table, including:
[0021] A construction module, wherein the construction module is configured to construct a data processing status table;
[0022] A start-up module, the start-up module being configured to start the level 1 distribution device and the plurality of level 2 distribution devices in response to the distribution service manager receiving a data update request sent by the original data;
[0023] a first registration module, the first registration module being configured to start the level 1 distribution based on the level 1 distribution device, register the level 1 distribution record in the data processing status table, and generate a corresponding processing status;
[0024] A second registration module, wherein the second registration module is configured to update the processing status corresponding to the level 1 distribution record in the data processing status table in response to the level 1 distribution device receiving the level 1 distribution request sent by the distribution service manager, and sequentially call the level 2 distribution device based on the level 1 distribution device to start the level 2 distribution, and register the level 2 distribution record in the data processing status table and generate the corresponding processing status;
[0025] An update module, wherein the update module is configured to update a processing status corresponding to the level 2 distribution record and update associated data corresponding to the level 2 distribution device in response to the level 2 distribution device receiving a level 2 distribution request sent by the level 1 distribution device.
[0026] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: at least one processor; and a memory, wherein the memory stores a computer program executable on the processor, and the computer program implements the steps of the above method when executed by the processor.
[0027] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements the above method steps when executed by a processor.
[0028] The present invention has the following beneficial technical effects: through the embodiments of the present invention, data update work can be registered, unregistered and the corresponding data status can be recorded, which is beneficial to tracking the data processing status when the original data asynchronously updates the associated data, avoiding data processing failure without being discovered, resulting in redundantly stored associated data not being updated in time, and by adopting a multi-level distribution and asynchronous processing method, it is guaranteed that the performance of the original data processing is not affected, and the redundant data is quickly and reliably updated. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0030] Figure 1 A block diagram of an embodiment of a method for processing associated data redundantly stored in a data table provided by the present invention;
[0031] Figure 2 A schematic diagram of an embodiment of a system for processing associated data redundantly stored in a data table provided by the present invention;
[0032] Figure 3 A schematic diagram of the structure of an embodiment of a computer device provided by the present invention;
[0033] Figure 4 A schematic diagram of the structure of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0034] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0035] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.
[0036] Based on the above purpose, the first aspect of the embodiments of the present invention provides an embodiment of a method for processing associated data redundantly stored in a data table. Figure 1 As shown, it includes the following steps:
[0037] Step S101, constructing a data processing status table;
[0038] Step S103, in response to the distribution service manager receiving the data update request sent by the original data, starting the first-level distribution device and multiple second-level distribution devices;
[0039] Step S105: starting the level 1 distribution based on the level 1 distribution device, registering the level 1 distribution record in the data processing status table, and generating the corresponding processing status;
[0040] Step S107: in response to the first-level distribution device receiving the first-level distribution request sent by the distribution service manager, updating the processing status corresponding to the first-level distribution record in the data processing status table, and sequentially calling the second-level distribution device based on the first-level distribution device to start the second-level distribution, registering the second-level distribution record in the data processing status table and generating the corresponding processing status;
[0041] Step S109: in response to the second-level distribution device receiving the second-level distribution request sent by the first-level distribution device, updating the processing status corresponding to the second-level distribution record and updating the associated data corresponding to the second-level distribution device.
[0042] Specifically, the data processing status table is used to record the data distribution update status, so as to facilitate the distribution management server to track the program processing process.
[0043] The data processing status table includes: data type, data id, new data value, processing node, start time, last processing time, processing status and message, see Table 1 for details, which gives several data status registration, level 1 distribution records when updating, and level 2 distribution records.
[0044] Table 1
[0045]
[0046] When the distribution service manager receives a data update request sent asynchronously by the original data, the distribution service manager starts a level 1 distribution device, multiple level 2 distribution devices, and calls to start level 1 distribution based on the level 1 distribution device, registers a level 1 distribution record in the data processing status table, and sets the processing status of the level 1 distribution record to started.
[0047] When the level 1 distribution device receives a level 1 distribution request sent by the distribution service manager, the processing status corresponding to the level 1 distribution record in the data processing status table is updated from started to processing, and the level 1 distribution device is used to call the level 2 distribution device in sequence to start the level 2 distribution, and the level 2 distribution record is registered in the data processing status table and the processing status of the level 1 distribution record is set to started.
[0048] The level 1 distribution device sends a level 2 distribution request to the level 2 distribution device, and updates the processing status corresponding to the level 2 distribution record in the data processing status table from started to processing, and updates the associated data corresponding to each level 2 distribution device based on the level 2 distribution device.
[0049] According to the method described above, an asynchronous approach is adopted to reduce resource consumption and waiting at each level of processing; a multi-level approach is adopted, in which a first-level processing device calls and starts multiple second-level processing devices to distribute updated data to multiple associated data tables at the same time, thereby improving data processing efficiency; and by constructing a data processing status table to register data update work and record the corresponding data status, it is beneficial for the original data to track the data processing status when asynchronously updating associated data, thereby avoiding data processing failure without being discovered, resulting in redundantly stored associated data not being updated in a timely manner.
[0050] In some embodiments, the method further comprises:
[0051] When the level 1 distribution device and multiple level 2 distribution devices are started, polling is started to check the data processing status table.
[0052] By polling and checking the data processing status table, abnormal data in the data processing status table is checked and transferred to the processing exception data table for registration. The processing exception data table is used to summarize and record the abnormal information that occurs when the data recorded in the data processing status table is updated, and the service manager is used to provide feedback to the user and remind the user to make a decision and then switch to the corresponding processing method.
[0053] In some implementations, the step of starting the second-level distribution based on the first-level distribution device sequentially calling the second-level distribution device further includes:
[0054] In response to all Level 2 distribution device calls being successful, the Level 1 distribution records are cancelled.
[0055] In some implementations, the method further includes: in response to successful data update, canceling the corresponding level 2 distribution record.
[0056] In some implementations, the method further includes: in response to the data update being unsuccessful, updating a processing status of the level 2 distribution record.
[0057] In some implementations, initiating polling to check the data processing status table includes: checking the data processing status table according to a preset check cycle, and processing abnormal data according to a polling check strategy.
[0058] In some implementations, processing abnormal data according to a polling inspection strategy includes:
[0059] If the processing status of the processing node is started or processing and the last processing time of the processing node exceeds the preset maximum node processing time, or the processing status of the processing node is processing failure, the corresponding exception record in the data processing status table corresponding to the processing node is sent to the processing exception data table.
[0060] Through the embodiments of the present invention, data update work can be registered, unregistered and the corresponding data status can be recorded, which is beneficial for tracking the data processing status when the original data asynchronously updates the associated data, avoiding data processing failure without being discovered, resulting in redundantly stored associated data not being updated in time, and by adopting a multi-level distribution and asynchronous processing method, it is guaranteed that the performance of the original data processing is not affected, and the redundant data is quickly and reliably updated.
[0061] Based on the same inventive concept, according to another aspect of the present invention, Figure 2 As shown, a system for processing associated data redundantly stored in a data table is also provided, comprising:
[0062] A construction module 110, wherein the construction module 110 is configured to construct a data processing status table;
[0063] A start module 120, wherein the start module 120 is configured to start a level 1 distribution device and a plurality of level 2 distribution devices in response to a data update request sent by the distribution service manager after receiving the original data;
[0064] A first registration module 130, the first registration module 130 is configured to start the level 1 distribution based on the level 1 distribution device, register the level 1 distribution record in the data processing status table, and generate a corresponding processing status;
[0065] The second registration module 140 is configured to update the processing status corresponding to the level 1 distribution record in the data processing status table in response to the level 1 distribution device receiving the level 1 distribution request sent by the distribution service manager, and sequentially call the level 2 distribution device based on the level 1 distribution device to start the level 2 distribution, and register the level 2 distribution record in the data processing status table and generate the corresponding processing status;
[0066] The updating module 150 is configured to update the processing status corresponding to the level 2 distribution record and update the associated data corresponding to the level 2 distribution device in response to the level 2 distribution device receiving the level 2 distribution request sent by the level 1 distribution device.
[0067] Based on the same inventive concept, according to another aspect of the present invention, Figure 3 As shown, an embodiment of the present invention further provides a computer device 20, which includes a processor 210 and a memory 220. The memory 220 stores a computer program 221 that can be run on the processor. When the processor 210 executes the program, the steps of the above method are performed.
[0068] Based on the same inventive concept, according to another aspect of the present invention, Figure 4 As shown, an embodiment of the present invention further provides a computer-readable storage medium 30, which stores a computer program 310 for executing the above method when executed by a processor.
[0069] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.
[0070] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0071] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0072] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0073] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0074] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for processing associated data redundantly stored in a data table, characterized in that: include: Construct data processing status table; In response to the distribution service manager receiving a data update request sent by the original data, starting the level 1 distribution device and the plurality of level 2 distribution devices; Initiate level 1 distribution based on the level 1 distribution device, register level 1 distribution records in the data processing status table, and generate corresponding processing status; In response to the first-level distribution device receiving the first-level distribution request sent by the distribution service manager, the processing status corresponding to the first-level distribution record in the data processing status table is updated, and the second-level distribution device is called in sequence based on the first-level distribution device to start the second-level distribution, and the second-level distribution record is registered in the data processing status table and the corresponding processing status is generated; In response to the second-level distribution device receiving the second-level distribution request sent by the first-level distribution device, updating the processing status corresponding to the second-level distribution record and updating the associated data corresponding to the second-level distribution device; Among them, when starting the level 1 distribution device and multiple level 2 distribution devices, the polling check data processing status table is started; the starting polling check data processing status table includes: checking the data processing status table according to a preset check cycle, and processing abnormal data according to the polling check strategy; processing abnormal data according to the polling check strategy includes: if the processing status of the processing node is started or processing and the last processing time of the processing node exceeds the preset node processing maximum time, or the processing status of the processing node is processing failure, then the corresponding abnormal record in the data processing status table corresponding to the processing node is sent to the processing abnormal data table.
2. The method according to claim 1, characterized in that: Based on the first-level distribution device, the second-level distribution device is called in sequence to start the second-level distribution, and further includes: In response to all Level 2 distribution device calls being successful, the Level 1 distribution records are cancelled.
3. The method according to claim 1, characterized in that Also includes: In response to successful data update, the corresponding level 2 distribution record is cancelled.
4. The method according to claim 1, characterized in that: Also includes: In response to the data update being unsuccessful, the processing status of the level 2 distribution record is updated.
5. A system for processing associated data redundantly stored in a data table, characterized in that: include: A construction module, wherein the construction module is configured to construct a data processing status table; A start-up module, the start-up module being configured to start the level 1 distribution device and the plurality of level 2 distribution devices in response to the distribution service manager receiving a data update request sent by the original data; a first registration module, the first registration module being configured to start the level 1 distribution based on the level 1 distribution device, register the level 1 distribution record in the data processing status table, and generate a corresponding processing status; A second registration module, wherein the second registration module is configured to update the processing status corresponding to the level 1 distribution record in the data processing status table in response to the level 1 distribution device receiving the level 1 distribution request sent by the distribution service manager, and sequentially call the level 2 distribution device based on the level 1 distribution device to start the level 2 distribution, and register the level 2 distribution record in the data processing status table and generate the corresponding processing status; an updating module, the updating module being configured to update a processing state corresponding to the level 2 distribution record and update associated data corresponding to the level 2 distribution device in response to the level 2 distribution device receiving a level 2 distribution request sent by the level 1 distribution device; Among them, the startup module is also configured to start a polling check on the data processing status table while starting a level 1 distribution device and multiple level 2 distribution devices; the startup of the polling check on the data processing status table includes: checking the data processing status table according to a preset check cycle, and processing abnormal data according to the polling check strategy; processing abnormal data according to the polling check strategy, including: if the processing status of the processing node is started or processing and the last processing time of the processing node exceeds the preset node processing maximum time, or the processing status of the processing node is processing failure, then the corresponding abnormal record in the data processing status table corresponding to the processing node is sent to the abnormal data processing table.
6. A computer device comprising: at least one processor; as well as A memory storing a computer program executable on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 4 when executing the program.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are performed.
