Data updating method, medium, apparatus, and computing device
By acquiring authorization information in real time through a message queue and performing computational logic processing, the problem of delayed authorization data updates on multimedia platforms has been solved, enabling real-time updates of authorization data and ensuring the timeliness and accuracy of copyright protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
- Filing Date
- 2023-03-01
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, when multimedia platforms distribute multimedia works, the updates to authorization data cannot reflect changes in authorization time in real time, resulting in data lag and affecting the real-time application of copyright protection.
Authorization information is obtained in real time through a message queue, authorization data is retrieved from a real-time database and processed using computational logic, thereby enabling real-time updates of the authorization data in the database.
It enables real-time updates of authorization data, ensuring that the multimedia platform can respond promptly to changes in authorization time and guaranteeing the real-time accuracy and validity of copyright data.
Smart Images

Figure CN116257537B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the field of data processing, and more particularly, to a data updating method, medium, device and computing device. BACKGROUND
[0002] This section is intended to provide background or context to the embodiments of the present disclosure. The description herein is not admitted to be prior art merely by inclusion in this section.
[0003] In order to protect the rights of authors of multimedia works, laws for protecting copyrights are established, and dissemination of multimedia works within the scope of the laws can maintain the rights of authors.
[0004] In actual applications, a multimedia platform needs to obtain the corresponding copyright through an authorization letter before disseminating a multimedia work, and the authorization letter includes an authorization time. The copyright obtained by the multimedia platform is time-effective, that is, the multimedia platform can only disseminate the corresponding multimedia work within the authorization time, and the multimedia platform cannot disseminate the corresponding multimedia work after the authorization time, thereby protecting the rights of authors.
[0005] The multimedia platform will process a large amount of authorization letters, and since the copyright is strictly time-effective, the authorization time needs to be accurately extracted from the authorization letter, so as to protect the rights of authors.
[0006] In related technologies, an offline updating manner is used, in which authorization data in a database is fully copied to an offline database every day, the offline database is updated according to changes in authorization letters on the day, and the update result is used to overwrite the database, thereby realizing data updating. However, this scheme needs to reflect changes in authorization data every other day, and cannot reflect changes in authorization data in real time, thereby affecting real-time application of authorization data. SUMMARY
[0007] The present disclosure provides a data updating method, medium, device and computing device for updating data in real time.
[0008] In a first aspect of the embodiments of the present disclosure, a data updating method is provided, including: obtaining authorization information from a message queue, the authorization information including change information of authorization data; obtaining first target authorization data from a real-time database; extracting authorization data calculation logic from the authorization information; performing updating processing on the first target authorization data through the authorization data calculation logic, and storing the updated first target authorization data to the real-time database.
[0009] In an embodiment of the present disclosure, the change information includes updated authorization data corresponding to the authorization data, and the authorization data calculation logic is used to update the authorization data to the updated authorization data.
[0010] In another embodiment of the present disclosure, the authorization data includes an authorization duration; the updating of the first target authorization data by the authorization data calculation logic includes: determining a first authorization duration corresponding to the first target authorization data; modifying the first authorization duration by the authorization data calculation logic corresponding to the first target authorization data to obtain a second authorization duration; and updating the first authorization duration corresponding to the first target authorization data to the second authorization duration.
[0011] In yet another embodiment of the present disclosure, before obtaining the authorization information from the message queue, the method further includes: obtaining single authorization information and batch authorization information, the single authorization information including change information of single authorization data, and the batch authorization information including change information of multiple authorization data; storing the single authorization information to the message queue; splitting the batch authorization information to obtain multiple authorization information; and storing the multiple authorization information to the message queue.
[0012] In still another embodiment of the present disclosure, the change information includes: addition of authorization data, deletion of authorization data, and modification of authorization time; and the authorization data calculation logic is extracted from the authorization information, including: determining the first target authorization data from the authorization information, wherein the first target authorization data is authorization data with corresponding change information; determining the change information corresponding to the first target authorization data from the authorization information; and generating the authorization data calculation logic corresponding to the first target authorization data according to the change information corresponding to the first target authorization data.
[0013] In still another embodiment of the present disclosure, the method further includes: obtaining authorization data in a real-time database at a preset time and storing the authorization data to an offline database; obtaining authorization information from the message queue; updating the authorization data in the offline database by the authorization information to obtain authorization data in an updated offline database; and updating the authorization data in the real-time database by the authorization data in the updated offline database to obtain authorization data in an updated real-time database.
[0014] In still another embodiment of the present disclosure, the updating of the authorization data in the offline database by the authorization information to obtain authorization data in an updated offline database includes: obtaining second target authorization data from the offline database; extracting authorization data calculation logic corresponding to the second target authorization data from the authorization information; and updating the second target authorization data by the authorization data calculation logic corresponding to the second target authorization data, and storing the updated second target authorization data to the offline database.
[0015] In a further embodiment of the present disclosure, the second target authorization data is updated by the authorization data calculation logic corresponding to the second target authorization data, including: determining a third authorization duration corresponding to the second target authorization data; modifying the third authorization duration by the authorization data calculation logic corresponding to the second target authorization data to obtain a fourth authorization duration; and updating the third authorization duration corresponding to the second target authorization data to the fourth authorization duration.
[0016] In a further embodiment of the present disclosure, the authorization data in the real-time database is updated by the authorization data in the updated offline database, including: obtaining a first update time of each authorization data in the real-time database, and obtaining a second update time of each authorization data in the updated offline database; and if the second update time is greater than the first update time, updating the authorization data in the real-time database to the authorization data in the updated offline database.
[0017] In a further embodiment of the present disclosure, the authorization data in the real-time database is updated by the authorization data in the updated offline database, including: if the authorization data in the updated offline database does not have a corresponding authorization data in the real-time database, adding the authorization data to the real-time database.
[0018] In a second aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, including: computer execution instructions stored in the computer readable storage medium, the computer execution instructions being used to implement the data updating method according to any one of the first aspect when executed by a processor.
[0019] In a third aspect of the embodiments of the present disclosure, a data updating apparatus is provided, including: a first authorization module configured to obtain authorization information from a message queue, the authorization information including change information of authorization data; a first acquisition module configured to obtain first target authorization data from a real-time database; an extraction module configured to extract authorization data calculation logic from the authorization information; and a first update module configured to update the first target authorization data by the authorization data calculation logic, and store the updated first target authorization data to the real-time database.
[0020] In an embodiment of the present disclosure, the change information includes updated authorization data corresponding to the authorization data, and the authorization data calculation logic is used to update the authorization data to the updated authorization data.
[0021] In another embodiment of the present disclosure, the authorization data includes an authorization duration; the first updating module is specifically configured to determine a first authorization duration corresponding to the first target authorization data; the first updating module is further configured to modify the first authorization duration by using the authorization data calculation logic corresponding to the first target authorization data to obtain a second authorization duration; and the first updating module is further configured to update the first authorization duration corresponding to the first target authorization data to the second authorization duration.
[0022] In yet another embodiment of the present disclosure, the device further includes an information module configured to acquire single authorization information and batch authorization information, the single authorization information including change information of single authorization data, and the batch authorization information including change information of multiple authorization data; the information module is further configured to store the single authorization information into the message queue; the information module is further configured to split the batch authorization information to obtain multiple authorization information; and the information module is further configured to store the multiple authorization information into the message queue.
[0023] In still another embodiment of the present disclosure, the change information includes authorization data addition, authorization data deletion, and authorization time modification; the device further includes a generation module configured to determine the first target authorization data from the authorization information, wherein the first target authorization data is authorization data with corresponding change information; the generation module is further configured to determine the change information corresponding to the first target authorization data from the authorization information; and the generation module is further configured to generate authorization data calculation logic corresponding to the first target authorization data according to the change information corresponding to the first target authorization data.
[0024] In still another embodiment of the present disclosure, the device further includes a second authorization module configured to acquire authorization data in a real-time database at a preset time and store the authorization data into an offline database; a second acquisition module configured to acquire authorization information from the message queue; a second updating module configured to update the authorization data in the offline database by using the authorization information to obtain updated authorization data in the offline database; and a replacement module configured to update the authorization data in the real-time database by using the updated authorization data in the offline database to obtain updated authorization data in the real-time database.
[0025] In a further embodiment of the present disclosure, the second updating module is specifically configured to obtain second target authorization data from the offline database; the second updating module is further specifically configured to extract authorization data calculation logic corresponding to the second target authorization data from the authorization information; and the second updating module is further specifically configured to update the second target authorization data through the authorization data calculation logic corresponding to the second target authorization data, and store the updated second target authorization data into the offline database.
[0026] In a further embodiment of the present disclosure, the second updating module is specifically configured to determine a third authorization duration corresponding to the second target authorization data; the second updating module is further specifically configured to modify the third authorization duration through the authorization data calculation logic corresponding to the second target authorization data to obtain a fourth authorization duration; and the second updating module is further specifically configured to update the third authorization duration corresponding to the second target authorization data to the fourth authorization duration.
[0027] In a further embodiment of the present disclosure, the apparatus further comprises an execution module configured to obtain a first update time of each authorization data in the real-time database and a second update time of each authorization data in the updated offline database; and the execution module is further configured to update the authorization data in the real-time database to the authorization data in the updated offline database if the second update time is greater than the first update time.
[0028] In a further embodiment of the present disclosure, the apparatus further comprises an adding module configured to add the authorization data in the updated offline database to the real-time database if there is no corresponding authorization data in the real-time database.
[0029] In a fourth aspect of the embodiments of the present disclosure, a computing device is provided, comprising at least one processor, and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the computing device to perform the data updating method according to any one of the first aspect of the embodiments of the present disclosure.
[0030] According to the embodiments of the present disclosure, the authorization information is obtained in real time through the message queue, and the authorization data in the database is updated, so that the data is updated in real time. BRIEF DESCRIPTION OF DRAWINGS
[0031] The above and other objects, features and advantages of the present disclosure exemplary embodiments will be more apparent from the following detailed description read in conjunction with the accompanying drawings, in which:
[0032] Figure 1 A schematic diagram illustrating an application scenario according to an embodiment of the present disclosure is shown schematically;
[0033] Figure 2 A flowchart illustrating a data updating method according to an embodiment of the present disclosure is shown schematically;
[0034] Figure 3 A flowchart illustrating a data updating method according to an embodiment of the present disclosure is shown schematically;
[0035] Figure 4 An example diagram illustrating generation of computing logic according to an embodiment of the present disclosure is shown schematically;
[0036] Figure 5 A flowchart illustrating a data updating method according to an embodiment of the present disclosure is shown schematically;
[0037] Figure 6 A structural diagram of a storage medium according to an embodiment of the present disclosure is shown schematically;
[0038] Figure 7 A structural diagram of a data updating apparatus according to an embodiment of the present disclosure is shown schematically;
[0039] Figure 8 A structural diagram of a data updating apparatus according to an embodiment of the present disclosure is shown schematically;
[0040] Figure 9 A structural diagram of a data updating apparatus according to an embodiment of the present disclosure is shown schematically;
[0041] Figure 10 A structural diagram of a computing device according to an embodiment of the present disclosure is shown schematically.
[0042] In the drawings, the same or corresponding parts are denoted by the same or corresponding reference numerals. DETAILED DESCRIPTION
[0043] The principles and spirits of the present disclosure will be described below with reference to a number of exemplary embodiments. It should be understood that the embodiments are given only so that those skilled in the art can better understand and implement the present disclosure, and do not limit the scope of the present disclosure in any way. On the contrary, the embodiments are provided so that the present disclosure is more thorough and complete, and the scope of the present disclosure is fully conveyed to those skilled in the art.
[0044] Those skilled in the art understand that the embodiments of the present disclosure can be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure can be embodied in the form of entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. The data involved in the present disclosure can be data authorized by the user or sufficiently authorized by all parties, and the collection, transmission and use of the data comply with the relevant legal requirements of the country. The embodiments / examples of the present disclosure can be combined with each other.
[0045] According to the embodiments of the present disclosure, a data updating method, medium, device and computing equipment are provided.
[0046] In addition, the number of any elements in the drawings is used for illustration and not limitation, and any naming is only used for distinction and does not have any limiting meaning.
[0047] The principles and spirits of the present disclosure will be described below with reference to a number of exemplary embodiments. It should be understood that the embodiments are given only so that those skilled in the art can better understand and implement the present disclosure, and do not limit the scope of the present disclosure in any way. On the contrary, the embodiments are provided so that the present disclosure is more thorough and complete, and the scope of the present disclosure is fully conveyed to those skilled in the art. SUMMARY
[0049] The inventors found that in the related art, the authorized data in the real-time database is updated by an offline updating manner, the authorized data in the database is copied in full to an offline database every day, and the offline database is updated according to the change of the authorization document on the day. The update result is overlaid on the database, and the updated database can be seen on the second day, which has a lag of data. At the same time, the full copy also causes a transient memory pressure of the database.
[0050] In order to solve the above problems, the inventors acquire the authorized information in real time through a message queue, update the authorized data in the database, and thus realize real-time updating of the data.
[0051] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure will be specifically introduced.
[0052] OVERVIEW OF APPLICATION SCENARIOS
[0053] Firstly, reference is made to Figure 1 , Figure 1 The application scenario schematic diagram provided for the embodiments of the present disclosure.
[0054] As shown in Figure 1 , the authorization letter includes change information of the authorization data, the change information includes change information of multimedia authorization time, and a calculation logic is extracted from the change information of the authorization time, the calculation logic includes: authorization time increase, authorization time decrease, and authorization cancellation, etc. The current authorization data in the database is calculated by the calculation logic, so as to realize the update of the authorization data.
[0055] Exemplary Method
[0056] The data update method provided by the exemplary embodiments of the present disclosure will be described below in combination with the application scenario of Figure 1 , and in reference to Figures 2-5 . It should be noted that the above-mentioned application scenario is only shown for the purpose of facilitating the understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0057] The execution subject of the embodiments of the present disclosure can be a data update device, and the data update device can be implemented in various ways. For example, the data update device can be a program software; or the device can also be integrated or installed or stored on an entity device, such as a chip, a smart terminal, a computer, a server, a U disk, etc.
[0058] Reference is made to Figure 2 , Figure 2 for the flowchart of the data update method provided by an embodiment of the present disclosure. As shown in Figure 2 , it includes:
[0059] S201, authorization information is obtained from a message queue, and the authorization information includes change information of authorization data.
[0060] Optionally, the authorization message can come from one authorization letter or from multiple authorization letters. The change information of the authorization data includes but is not limited to: exclusive authorization time, non-exclusive authorization time, multimedia release, multimedia offline, and multimedia transfer platform, etc.
[0061] Further optionally, one multimedia can include multiple authorization data. For example, one multimedia is authorized to be spread on multiple platforms, and each platform has independent authorization data for the multimedia.
[0062] Further optionally, one multimedia can correspond to multiple authorization letters, and the multiple authorization letters jointly determine the authorization data of the multimedia.
[0063] It can be understood that asynchronous acquisition of the authorization information through the message queue can reduce the instantaneous pressure of data update.
[0064] S202. Obtain the first target authorization data from the real-time database.
[0065] Among them, the first target authorization data is the first target authorization data included in the authorization information, and the first target authorization data is the authorization data to be updated.
[0066] S203, Extract the authorization data calculation logic from the authorization information.
[0067] Optionally, the change information includes the updated authorization data corresponding to the authorization data, and the authorization data calculation logic is used to update the authorization data to the updated authorization data.
[0068] Among them, the authorization information consists of events related to the authorization data, such as multimedia publishing and multimedia transfer platform events. These events cannot update the authorization data, but the calculation logic extracted from them can update the authorization data. For example, the calculation logic can increase the authorization duration of the authorization data by 6 months.
[0069] S204. The first target authorization data is updated using the authorization data calculation logic, and the updated first target authorization data is stored in the real-time database.
[0070] The process of obtaining authorization information occurs immediately after the authorization information is received in the message queue, while the update of authorization data occurs immediately after the calculation logic is extracted.
[0071] Understandably, compared to daily full offline updates, real-time updates to the authorization data in the real-time database can provide immediate update results, and users can obtain more accurate authorization data by querying the database.
[0072] The data update method provided in this embodiment obtains authorization information from a message queue, the authorization information including change information of authorization data; obtains first target authorization data from a real-time database; extracts authorization data calculation logic from the authorization information; updates the first target authorization data using the authorization data calculation logic; and stores the updated first target authorization data in the real-time database. This solution achieves real-time data updates by obtaining authorization information in real-time through a message queue and updating the authorization data in the database.
[0073] Based on any of the above embodiments, the following, in conjunction with Figure 3 The detailed process of data updating is explained.
[0074] Figure 3 This is a schematic flowchart illustrating a data update method according to an embodiment of this disclosure. Figure 3 As shown, the method includes:
[0075] S301. Obtain authorization information from the message queue, wherein the authorization information includes change information of authorization data.
[0076] One feasible implementation method further includes, before obtaining authorization information from the message queue: obtaining single authorization information and batch authorization information, wherein the single authorization information includes change information of a single authorization data, and the batch authorization information includes change information of multiple authorization data; storing the single authorization information in the message queue; splitting the batch authorization information to obtain multiple authorization information; and storing the multiple authorization information in the message queue.
[0077] For example, taking an authorization letter as an example, an authorization letter can include change information for the authorization data of one multimedia device, or it can include change information for the authorization data of multiple multimedia devices individually. For batch authorization information, it needs to be split into multiple authorization letters, and then the corresponding authorization data needs to be updated according to each authorization letter.
[0078] S302. Obtain the first target authorization data from the real-time database.
[0079] It should be noted that the execution process of S302 is the same as that of S202, and will not be repeated here.
[0080] S303, Extract the authorization data calculation logic from the authorization information.
[0081] One feasible implementation method includes: the change information includes: adding authorized data, deleting authorized data, and modifying the authorization time; extracting the authorization data calculation logic includes: determining the first target authorized data from the authorization information, wherein the first target authorized data is authorized data with corresponding change information; determining the change information corresponding to the first target authorized data from the authorization information; and generating the authorization data calculation logic corresponding to the first target authorized data based on the change information corresponding to the first target authorized data.
[0082] Below, in conjunction with Figure 4 The logic for generating the computation is explained.
[0083] Figure 4 This is a schematic diagram of the generation calculation logic provided for an embodiment of this application. For example... Figure 4 As shown, the authorization information includes multiple change information, each change information corresponds to a first target authorization data, and calculation logic is generated based on each change information, with each calculation logic corresponding one-to-one with the first target authorization data.
[0084] For example, the authorization information includes authorization data with corresponding change information and authorization data without corresponding change information. The authorization data with corresponding change information needs to be updated, so the corresponding calculation logic is generated only based on the change information corresponding to the first target authorization data.
[0085] In this feasible implementation, only authorized data with changed information is updated, which can improve data update efficiency.
[0086] S304. Determine the first authorization duration corresponding to the first target authorization data.
[0087] The first authorization duration is the current authorization duration of the first target authorization data in the real-time database, and the data is updated based on this.
[0088] S305. Modify the first authorization duration using the authorization data calculation logic corresponding to the first target authorization data to obtain the second authorization duration.
[0089] For example, if the first authorization period is 60 days remaining, meaning the platform has the right to distribute the multimedia within 60 days, the calculation logic is to increase the authorization period by 300 days, then the second authorization period is 360 days remaining, meaning the platform has the right to distribute the multimedia within 360 days.
[0090] S306. Update the first authorization duration corresponding to the first target authorization data to the second authorization duration.
[0091] For example, by overwriting the first authorization duration with the second authorization duration, the updated first target authorization data is obtained, and the updated first target authorization data only includes the second authorization duration.
[0092] Based on any of the above embodiments, the following, in conjunction with Figure 5 The detailed process of data updating is explained.
[0093] Figure 5 This is a schematic flowchart illustrating a data update method according to an embodiment of this disclosure. Figure 5 As shown, the method includes:
[0094] S501. Obtain the authorized data from the real-time database at a preset time and store it in the offline database.
[0095] This involves copying all authorized data from the real-time database to the offline database.
[0096] For example, the preset time can be a fixed time every day or a fixed time every week; this disclosure does not limit this.
[0097] S502. Obtain authorization information from the message queue.
[0098] It should be noted that the execution process of S502 is the same as that of S201, and will not be repeated here.
[0099] S503. Obtain the second target authorization data from the offline database.
[0100] The second target authorization data is the authorization data corresponding to the authorization information in the offline database.
[0101] S504. Extract the authorization data calculation logic corresponding to the second target authorization data from the authorization information.
[0102] It should be noted that the execution process of S504 is the same as that of S303, and will not be repeated here.
[0103] S505. Determine the third authorization duration corresponding to the second target authorization data.
[0104] The third authorization duration is the current authorization duration of the second target authorization data.
[0105] S506. Modify the third authorization duration using the authorization data calculation logic corresponding to the second target authorization data to obtain the fourth authorization duration.
[0106] The fourth authorization duration is the modified authorization duration corresponding to the second target authorization data.
[0107] S507. Update the third authorization duration corresponding to the second target authorization data to the fourth authorization duration.
[0108] The fourth authorization duration covers the third authorization duration, and the updated second target authorization data only includes the fourth authorization duration.
[0109] S508. Obtain the first update time of each authorized data in the real-time database, and obtain the second update time of each authorized data in the updated offline database.
[0110] In both the real-time and offline databases, the update completion time is recorded for each authorized data entry. This update time determines whether the current authorized data is the latest version. This prevents older versions of authorized data from replacing newer ones.
[0111] S509. If the second update time is greater than the first update time, then the corresponding authorized data in the real-time database is updated to the corresponding updated authorized data in the offline database.
[0112] It should be noted that the second update time used for comparison and the first update time correspond to the same authorized data.
[0113] For example, if the second update time is later than the first update time, it means that the same authorized data is updated in the offline database compared to the real-time database. Therefore, the authorized data in the real-time database is updated to the updated authorized data in the offline database, so that the data queried by the user in the real-time database is the latest version of the data.
[0114] S510. If the authorized data in the updated offline database does not have corresponding authorized data in the real-time database, then the authorized data is added to the real-time database.
[0115] For example, if any change in the authorization letter is the addition of multimedia, and the updated authorization data in the offline database does not have corresponding authorization data in the real-time database, it means that the real-time database has missed the change information. The offline database executes the calculation logic corresponding to the change information and adds the authorization data to the real-time database to ensure that the real-time database is the latest version.
[0116] The data update method provided in this embodiment can supplement real-time database updates through offline updates, thereby improving the accuracy of data updates.
[0117] Exemplary Medium
[0118] After introducing the methods of exemplary embodiments of this disclosure, the following references are made. Figure 6 The storage medium of the exemplary embodiments of this disclosure will be described.
[0119] refer to Figure 6 As shown, the storage medium 60 stores a program product for implementing the above-described method according to embodiments of the present disclosure. This program product may be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a device such as a personal computer. However, the program product of the present disclosure is not limited thereto.
[0120] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A 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 of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0121] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium.
[0122] Program code for performing the operations disclosed herein can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing devices can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN).
[0123] Exemplary Apparatus
[0124] Having introduced the medium of exemplary embodiments of this disclosure, the following references are made to... Figure 7 The data update apparatus of the exemplary embodiments of this disclosure will be described to implement the method in any of the above method embodiments. The implementation principle and technical effect are similar, and will not be repeated here.
[0125] refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of a data update apparatus provided in an embodiment of this disclosure. Figure 7 As shown, it includes:
[0126] The first authorization module 71 is used to obtain authorization information from the message queue, the authorization information including modification information of authorization data;
[0127] The first acquisition module 72 is used to acquire the first target authorization data from the real-time database;
[0128] Extraction module 73 is used to extract authorization data calculation logic from the authorization information;
[0129] The first update module 74 is used to update the first target authorization data through the authorization data calculation logic and store the updated first target authorization data in the real-time database.
[0130] Optionally, the first authorized module 71 can be executed. Figure 2 S201 in the embodiment.
[0131] Optionally, the first acquisition module 72 can be executed. Figure 2 S202 in the embodiment.
[0132] Optionally, extraction module 73 can be executed. Figure 2 S203 in the embodiment.
[0133] Optionally, the first update module 74 can be executed. Figure 2 S204 in the embodiment.
[0134] In one possible implementation, the change information includes the updated authorization data corresponding to the authorization data, and the authorization data calculation logic is used to update the authorization data to the updated authorization data.
[0135] In one possible implementation, the authorization data includes the authorization duration; the first update module 74 is specifically used for:
[0136] Determine the first authorization duration corresponding to the first target authorization data;
[0137] The first authorization duration is modified using the authorization data calculation logic corresponding to the first target authorization data to obtain the second authorization duration;
[0138] Update the first authorization duration corresponding to the first target authorization data to the second authorization duration.
[0139] Figure 8 This is a schematic diagram of a data update device provided in an embodiment of this application. Figure 7 Based on the illustrated embodiments, as Figure 8 As shown, the data update device 80 further includes: an information module 85 and a generation module 86, wherein:
[0140] The information module 85 is used for:
[0141] Obtain single authorization information and batch authorization information, wherein the single authorization information includes change information of a single authorization data, and the batch authorization information includes change information of multiple authorization data;
[0142] The single authorization information is stored in the message queue;
[0143] The batch authorization information is split into multiple authorization information items;
[0144] The multiple authorization information is stored in the message queue.
[0145] The generation module 86 is used for:
[0146] The first target authorization data is determined from the authorization information, wherein the first target authorization data is authorization data for which there is corresponding change information;
[0147] Determine the change information corresponding to the first target authorization data from the authorization information;
[0148] Based on the change information corresponding to the first target authorization data, the authorization data calculation logic corresponding to the first target authorization data is generated.
[0149] Figure 9 This is a schematic diagram of a data update device provided in an embodiment of this application. Figure 9 As shown, the data update device 90 includes: a second authorization module 91, a second acquisition module 92, a second update module 93, a replacement module 94, an execution module 95, and an addition module 96, wherein:
[0150] The second authorization module 91 is used to obtain authorization data from the real-time database at a preset time and store it in the offline database.
[0151] The second acquisition module 92 is used to acquire authorization information from the message queue.
[0152] The second update module 93 is used to update the authorization data in the offline database using the authorization information to obtain the updated authorization data in the offline database.
[0153] The replacement module 94 is used to update the authorization data in the real-time database using the updated authorization data in the offline database, so as to obtain the updated authorization data in the real-time database.
[0154] In one possible implementation, the second update module 93 is specifically used for:
[0155] Retrieve the second target authorization data from the offline database;
[0156] The authorization data calculation logic is extracted from the authorization information to obtain the authorization data corresponding to the second target authorization data.
[0157] The second target authorization data is updated using the authorization data calculation logic corresponding to the second target authorization data, and the updated second target authorization data is stored in the offline database.
[0158] In one possible implementation, the second update module 93 is specifically used for:
[0159] Determine the third authorization duration corresponding to the second target authorization data;
[0160] The third authorization duration is modified using the authorization data calculation logic corresponding to the second target authorization data to obtain the fourth authorization duration;
[0161] Update the third authorization duration corresponding to the second target authorization data to the fourth authorization duration.
[0162] The execution module 95 is used for:
[0163] Get the first update time of each authorized data in the real-time database, and get the second update time of each authorized data in the updated offline database;
[0164] If the second update time is greater than the first update time, then the corresponding authorized data in the real-time database will be updated to the corresponding updated authorized data in the offline database.
[0165] The adding module 96 is used to add the authorized data to the real-time database if the authorized data in the updated offline database does not have corresponding authorized data in the real-time database.
[0166] Exemplary Computing Device
[0167] Having described the methods, media, and apparatus of exemplary embodiments of this disclosure, the following references... Figure 10 A computing device according to an exemplary embodiment of the present disclosure will be described.
[0168] Figure 10 The computing device 100 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0169] like Figure 10As shown, the computing device 100 is presented in the form of a general-purpose computing device. The components of the computing device 100 may include, but are not limited to: at least one processing unit 1001, at least one storage unit 1002, and a bus 1003 connecting different system components (including the processing unit 1001 and the storage unit 1002).
[0170] Bus 1003 includes a data bus, a control bus, and an address bus.
[0171] Storage unit 1002 may include readable media in the form of volatile memory, such as random access memory (RAM) 10021 and / or cache memory 10022, and may further include readable media in the form of non-volatile memory, such as read-only memory (ROM) 10023.
[0172] Storage unit 1002 may also include a program / utility 10025 having a set (at least one) program module 10024, such program module 10024 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0173] The computing device 100 can also communicate with one or more external devices 1004 (e.g., keyboard, pointing device, etc.). This communication can be performed via the input / output (I / O) interface 1005. Furthermore, the computing device 100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 1006. Figure 10 As shown, network adapter 1006 communicates with other modules of computing device 100 via bus 1003. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with computing device 100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0174] It should be noted that although several units / modules or sub-units / modules of the data update apparatus have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0175] Furthermore, although the operations of the methods disclosed herein are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0176] While the spirit and principles of this disclosure have been described with reference to several specific embodiments, it should be understood that this disclosure is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for convenience of expression. This disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A data update method, comprising: Retrieve authorization information from the message queue, the authorization information including changes to the authorization data; Retrieve the first target authorization data from the real-time database; The authorization data calculation logic is extracted from the authorization information; The first target authorization data is updated using the authorization data calculation logic, and the updated first target authorization data is stored in the real-time database. The method further includes: At a preset time, retrieve all authorized data from the real-time database and store it in the offline database; Obtain authorization information from the message queue; The authorization information is used to update the authorization data in the offline database to obtain the updated authorization data in the offline database. Get the first update time of each authorized data in the real-time database, and get the second update time of each authorized data in the updated offline database; If the second update time is greater than the first update time, then the corresponding authorized data in the real-time database will be updated to the corresponding updated authorized data in the offline database.
2. The method according to claim 1, wherein the change information includes the updated authorization data corresponding to the authorization data, and the authorization data calculation logic is used to update the authorization data to the updated authorization data.
3. The method according to claim 2, wherein the authorization data includes authorization duration; and the first target authorization data is updated through the authorization data calculation logic, including: Determine the first authorization duration corresponding to the first target authorization data; The first authorization duration is modified using the authorization data calculation logic corresponding to the first target authorization data to obtain the second authorization duration; Update the first authorization duration corresponding to the first target authorization data to the second authorization duration.
4. The method according to claim 3, further comprising, before obtaining authorization information from the message queue: Obtain single authorization information and batch authorization information, wherein the single authorization information includes change information of a single authorization data, and the batch authorization information includes change information of multiple authorization data; The single authorization information is stored in the message queue; The batch authorization information is split into multiple authorization information items; The multiple authorization information is stored in the message queue.
5. The method according to claim 4, wherein the change information includes: Adding authorized data, deleting authorized data, and modifying authorized time; The logic for extracting authorization data from the authorization information includes: The first target authorization data is determined from the authorization information, wherein the first target authorization data is authorization data for which there is corresponding change information; Determine the change information corresponding to the first target authorization data from the authorization information; Based on the change information corresponding to the first target authorization data, the authorization data calculation logic corresponding to the first target authorization data is generated.
6. The method according to claim 1, wherein the authorization information is used to update the authorization data in the offline database to obtain updated authorization data in the offline database, comprising: Retrieve the second target authorization data from the offline database; The authorization data calculation logic is extracted from the authorization information to obtain the authorization data corresponding to the second target authorization data. The second target authorization data is updated using the authorization data calculation logic corresponding to the second target authorization data, and the updated second target authorization data is stored in the offline database.
7. The method according to claim 6, wherein updating the second target authorization data through authorization data calculation logic corresponding to the second target authorization data includes: Determine the third authorization duration corresponding to the second target authorization data; The third authorization duration is modified using the authorization data calculation logic corresponding to the second target authorization data to obtain the fourth authorization duration; Update the third authorization duration corresponding to the second target authorization data to the fourth authorization duration.
8. The method according to claim 1, further comprising: If the authorized data in the updated offline database does not have a corresponding authorized data in the real-time database, then the authorized data is added to the real-time database.
9. A computer-readable storage medium, comprising: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data update method as described in any one of claims 1 to 8.
10. A data updating apparatus, the apparatus comprising: The first authorization module is used to obtain authorization information from the message queue, the authorization information including change information of authorization data; The first acquisition module is used to acquire the first target authorization data from the real-time database; The extraction module is used to extract the authorization data calculation logic from the authorization information; The first update module is used to update the first target authorization data through the authorization data calculation logic and store the updated first target authorization data in the real-time database. The device further includes: The second authorization module is used to obtain the full authorization data from the real-time database at a preset time and store it in the offline database; The second acquisition module is used to acquire authorization information from the message queue; The second update module is used to update the authorization data in the offline database using the authorization information to obtain the updated authorization data in the offline database. The execution module is used to obtain the first update time of each authorized data in the real-time database and the second update time of each authorized data in the updated offline database; if the second update time is greater than the first update time, the corresponding authorized data in the real-time database is updated to the corresponding authorized data in the updated offline database.
11. The apparatus according to claim 10, wherein the change information includes updated authorization data corresponding to the authorization data, and the authorization data calculation logic is used to update the authorization data to the updated authorization data.
12. The apparatus according to claim 11, wherein the authorization data includes the authorization duration; The first update module is specifically used to determine the first authorization duration corresponding to the first target authorization data; The first update module is further configured to modify the first authorization duration through the authorization data calculation logic corresponding to the first target authorization data to obtain the second authorization duration; The first update module is further configured to update the first authorization duration corresponding to the first target authorization data to the second authorization duration.
13. The apparatus of claim 12, further comprising: The information module is used to obtain single authorization information and batch authorization information. The single authorization information includes change information of a single authorization data, and the batch authorization information includes change information of multiple authorization data. The information module is also used to store the single authorization information into the message queue; The information module is also used to split the batch authorization information to obtain multiple authorization information; The information module is also used to store the multiple authorization information to the message queue.
14. The apparatus according to claim 13, wherein the change information includes: Adding authorized data, deleting authorized data, and modifying authorized time; The device further includes: The generation module is used to determine the first target authorization data from the authorization information, wherein the first target authorization data is authorization data with corresponding change information; The generation module is further configured to determine the change information corresponding to the first target authorization data from the authorization information; The generation module is further configured to generate authorization data calculation logic corresponding to the first target authorization data based on the change information corresponding to the first target authorization data.
15. The apparatus according to claim 10, The second update module is specifically used to obtain the second target authorization data from the offline database; The second update module is further configured to extract the authorization data calculation logic corresponding to the second target authorization data from the authorization information; The second update module is further configured to update the second target authorization data through the authorization data calculation logic corresponding to the second target authorization data, and store the updated second target authorization data in the offline database.
16. The apparatus according to claim 15, The second update module is specifically used to determine the third authorization duration corresponding to the second target authorization data; The second update module is further configured to modify the third authorization duration through the authorization data calculation logic corresponding to the second target authorization data to obtain the fourth authorization duration; The second update module is further configured to update the third authorization duration corresponding to the second target authorization data to the fourth authorization duration.
17. The apparatus of claim 10, further comprising: An add module is used to add the authorized data to the real-time database if the authorized data in the updated offline database does not have a corresponding authorized data in the real-time database.
18. A computing device, comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the computing device to perform the data update method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Distributed system data consistency processing method, device and system
CN105447046A
License authentication method of PON system and OLT
CN108093318A
Index updating method and device, medium and computing equipment
CN114461641A