CN112783909B - Data updating method, device, terminal equipment and storage medium - Google Patents

Data updating method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN112783909B
CN112783909B CN202110124661.5A CN202110124661A CN112783909B CN 112783909 B CN112783909 B CN 112783909B CN 202110124661 A CN202110124661 A CN 202110124661A CN 112783909 B CN112783909 B CN 112783909B
Authority
CN
China
Prior art keywords
data
updated
caching
update
local
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110124661.5A
Other languages
Chinese (zh)
Other versions
CN112783909A (en
Inventor
李可
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningxia Aerospace Information Co ltd
Shenzhen Lian Intellectual Property Service Center
Original Assignee
Ningxia Aerospace Information 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 Ningxia Aerospace Information Co ltd filed Critical Ningxia Aerospace Information Co ltd
Priority to CN202110124661.5A priority Critical patent/CN112783909B/en
Publication of CN112783909A publication Critical patent/CN112783909A/en
Application granted granted Critical
Publication of CN112783909B publication Critical patent/CN112783909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/23Updating
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Abstract

The application is applicable to the technical field of artificial intelligence, and provides a data updating method, a device, terminal equipment and a storage medium, wherein the method comprises the following steps: setting the data pointed by the data update prompt in the update database as data to be updated; carrying out local caching on the data to be updated according to the data caching rule of the data to be updated to obtain cached data; if the local cache result of the cache data meets the data updating condition, carrying out data analysis on the cache data by using a data analysis rule of the data to be updated to obtain effective data, and carrying out data updating on the local data according to the effective data. According to the application, the data caching rule of the data to be updated is obtained, and the obtained data caching rule is used for locally caching the data to be updated, so that the data damage caused by data replacement of the local data is prevented, and the normal provision of data service by the local data when the data is updated in error is ensured. Furthermore, the present application relates to blockchain techniques.

Description

Data updating method, device, terminal equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence, and in particular, to a data updating method, apparatus, terminal device, and storage medium.
Background
The commonly accepted definitions of the internet of things are: the social information system is composed of a perception layer, a network layer and an application layer, wherein the perception layer is responsible for perceiving and collecting information; the network layer is responsible for transmitting the information collected by the sensing layer to the application layer, and the application layer analyzes and processes the information transmitted by the network layer, so that the sensing among objects and people is realized.
In the existing use process of the internet of things, in order to ensure normal use of data on a client, the problem of data updating accuracy is more and more paid attention to, but in the existing data updating process, received data to be updated is directly used for replacing local data, data using service is provided based on the replaced data, and when errors occur in the process of directly replacing the local data by the data to be updated, the local data and the data to be updated cannot normally provide the data using service, so that the use experience of a user is reduced.
Disclosure of Invention
In view of the above, embodiments of the present application provide a data updating method, device, terminal equipment, and storage medium, so as to solve the problem in the prior art that, when data replacement is performed on local data by to-be-updated data, the local data and the to-be-updated data cannot normally provide data service.
A first aspect of an embodiment of the present application provides a data updating method, including:
receiving a data update prompt sent by an update database, and setting data pointed by the data update prompt in the update database as data to be updated;
acquiring a data caching rule of the data to be updated, and carrying out local caching on the data to be updated by the acquired data caching rule to obtain cached data;
if the local caching result of the cached data meets the data updating condition, acquiring a data analysis rule of the data to be updated;
and carrying out data analysis on the cache data by the acquired data analysis rule to obtain effective data, and carrying out data updating on local data according to the effective data.
Further, the obtaining the data caching rule of the data to be updated, and locally caching the data to be updated by using the obtained data caching rule to obtain cached data includes:
acquiring format information of the data to be updated, and setting a data type pointed by the format information as the data type of the data to be updated;
setting information pointed by the data type of the data to be updated as the data caching rule of the data to be updated, and acquiring a data caching path pointed by the data caching rule, a data caching format, a data caching speed and a data calling interface;
and carrying out local caching on the data to be updated by the acquired data caching path, the data caching format, the data caching speed and the data calling interface to obtain the cached data.
Further, the locally caching the data to be updated by the obtained data caching rule to obtain cached data, further includes:
acquiring data information of the cache data, wherein the data information comprises at least one parameter information, and the parameter information is format information, paragraph information or data volume information;
comparing the parameter information in the data information with corresponding preset information;
if any one of the parameter information in the data information is not matched with the corresponding preset information, judging that the local caching result of the cached data does not meet the data updating condition;
and if the parameter information in the data information is matched with the corresponding preset information, judging that the local caching result of the cached data meets the data updating condition.
Further, the data analysis of the cache data by the obtained data analysis rule to obtain effective data includes:
performing text translation on the cached data to obtain a data text, and compiling a data analysis object by a regular expression preset in the data analysis rule;
performing text searching and/or replacing on the data text by using a text processing rule pointed by the data analysis object to obtain a text processing result, wherein the text processing result comprises at least one target position, and the target position is a data position corresponding to the effective data in the cache data;
and carrying out data extraction on the cache data by taking the target position as a data extraction position to obtain the effective data.
Further, after the data analysis is performed on the cached data according to the obtained data analysis rule to obtain the valid data, the method further includes:
acquiring a data tag of the data to be updated, and setting data pointed by the data tag in local data as target data of the data to be updated, wherein the target data and the data to be updated provide the same data use service;
respectively calculating hash values of the target data and the effective data to obtain a target hash value and an effective hash value;
and if the target hash value is equal to the effective hash value, sending an update error prompt for the data to be updated.
Further, after the local data is updated according to the valid data, the method further includes:
acquiring a prompt identifier of the data update prompt, and setting a data forwarding table pointed by the prompt identifier as a data forwarding table of the update database, wherein the data forwarding table stores corresponding relations between different communication addresses and corresponding associated clients;
acquiring a local communication address, and matching the local communication address with a data downloading table of the update database to obtain the associated client corresponding to the data update prompt;
acquiring a storage address of the data to be updated in the update database, and generating data update broadcast by the storage address;
and broadcasting the data updating broadcast to notify the matched associated client.
Further, the locally caching the data to be updated by the obtained data caching rule to obtain cached data, and then further includes:
if the local cache result of the cache data does not meet the data updating condition, the prompt identifier of the data updating prompt inquires a data forwarding table of the updating database;
acquiring a local communication address, and matching the local communication address with the queried data forwarding table to obtain an associated client corresponding to the data update prompt;
acquiring an update state of the associated client for the data to be updated;
and if the update state of the data to be updated on any associated client is the updated state, carrying out local caching on the data to be updated again until the local caching result of the cached data meets the data update condition.
A second aspect of an embodiment of the present application provides a data updating apparatus, including:
the data query unit is used for receiving a data update prompt sent by an update database and setting data pointed by the data update prompt in the update database as data to be updated;
the local caching unit is used for acquiring the data caching rule of the data to be updated, and carrying out local caching on the data to be updated by the acquired data caching rule to obtain cached data;
the analysis rule acquisition unit is used for acquiring the data analysis rule of the data to be updated if the local cache result of the cache data meets the data updating condition;
and the data updating unit is used for carrying out data analysis on the cache data by the acquired data analysis rule to obtain effective data, and carrying out data updating on local data according to the effective data.
A third aspect of the embodiments of the present application provides a terminal device, comprising a memory, a processor and a computer program stored in the memory and executable on the terminal device, the processor implementing the steps of the data update method provided by the first aspect when executing the computer program.
A fourth aspect of the embodiments of the present application provides a storage medium storing a computer program which, when executed by a processor, implements the steps of the data updating method provided by the first aspect.
The data updating method, the device, the terminal equipment and the storage medium provided by the embodiment of the application have the following beneficial effects:
according to the data updating method provided by the embodiment of the application, the data caching rule of the data to be updated is obtained, the obtained data caching rule is used for locally caching the data to be updated, so that the data damage caused by data replacement of the local data is prevented, the local data can normally provide data service when the data is updated in error, the obtained data analysis rule of the data to be updated is obtained, the obtained data analysis rule is used for carrying out data analysis on the cached data, the effective data in the cached data can be effectively extracted, the local data is updated based on the extracted effective data, the effect of data thermal updating is achieved, and the data updating efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an implementation of a data update method according to an embodiment of the present application;
FIG. 2 is a flow chart of an implementation of a data update method according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for updating data according to still another embodiment of the present application;
FIG. 4 is a block diagram of a data update apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The data updating method according to the embodiment of the present application may be performed by a control device or a terminal (hereinafter referred to as a "mobile terminal").
Referring to fig. 1, fig. 1 shows a flowchart of an implementation of a data updating method according to an embodiment of the present application, including:
step S10, receiving a data update prompt sent by an update database, and setting data pointed by the data update prompt in the update database as data to be updated.
The data updating method can be applied to any mobile terminal, the updating database is a database preset for the mobile terminal, the mobile terminal and the updating database can be stored in a one-to-many mode, and the updating database is used for sending a data updating prompt to the mobile terminal and providing corresponding data to be updated when the data updating occurs.
For example, the update databases corresponding to the mobile terminal include an update database a1, an update database a2 and an update database a3, and when the update database a1 is updated with data, the update database a1 sends a data update prompt to the mobile terminal.
Specifically, in this step, a data lookup table is stored in the update database, and the correspondence between different data identifiers and corresponding data is stored in the data lookup table, so that the data pointed by the data update prompt in the update database is obtained by matching the data identifier stored in the data update prompt with the data lookup table.
Step S20, obtaining the data caching rule of the data to be updated, and carrying out local caching on the data to be updated by the obtained data caching rule to obtain cached data.
Specifically, in this step, the obtaining the data caching rule of the data to be updated, and locally caching the data to be updated by using the obtained data caching rule, to obtain cached data includes:
the format information of the data to be updated is obtained, and the data type pointed by the format information is set as the data type of the data to be updated, wherein a data type lookup table is prestored, and the data type lookup table stores the corresponding relation between different format information and corresponding data types.
Setting information pointed by the data type of the data to be updated as the data caching rule of the data to be updated, and obtaining a data caching path pointed by the data caching rule, a data caching format, a data caching speed and a data calling interface, wherein a rule lookup table is prestored in the embodiment, and the rule lookup table stores corresponding relations between different data caching rules and corresponding data caching paths, data caching formats, data caching speeds and data calling interfaces.
And carrying out local caching on the data to be updated according to the acquired data caching path, the data caching format, the data caching speed and the data calling interface to obtain the cached data, wherein caching of the data to be updated in the local data is effectively guaranteed based on the data caching path, format conversion is carried out on the data to be updated based on the data caching format, unification of data formats after the data to be updated is effectively guaranteed, caching efficiency in the data caching process is effectively guaranteed based on the data caching speed, and data calling after the data to be updated is effectively guaranteed based on the data calling interface.
Step S30, if the local cache result of the cache data meets the data updating condition, acquiring a data analysis rule of the data to be updated.
The data updating condition is used for judging whether the local caching result of the cached data is abnormal, if the local caching result of the cached data meets the data updating condition, the local caching operation of the data to be updated is normal, and the cached data obtained by caching is correct.
Specifically, in this embodiment, an parsing rule lookup table is pre-stored, where correspondence between different databases and corresponding data parsing rules is stored in the parsing rule lookup table, so that by matching the update database corresponding to the data to be updated with the parsing rule lookup table, a data parsing rule of the data to be updated is obtained, and the data parsing rule is used to perform data analysis on the data to be updated, so as to obtain effective data in the data to be updated.
Optionally, in this embodiment, if the local cache result of the cached data does not meet the data update condition, an update error prompt is sent for the data to be updated.
And S40, carrying out data analysis on the cache data by the acquired data analysis rule to obtain effective data, and carrying out data updating on local data according to the effective data.
Specifically, in this step, the performing data analysis on the cached data by using the obtained data analysis rule to obtain effective data includes:
and performing text translation on the cache data to obtain a data text, and compiling a data analysis object by using a regular expression preset in the data analysis rule, wherein the text translation of the cache data can be performed by adopting a text translator, and the text translation is used for converting the cache data into a text format, so that the text processing operation of the subsequent cache data is effectively facilitated.
And carrying out text searching and/or replacing on the data text by using a text processing rule pointed by the data analysis object to obtain a text processing result, wherein the text processing result comprises at least one target position which corresponds to the data position of the effective data in the cache data and can be a character string position, a text position or a field position and the like by carrying out text searching and/or replacing on the data text according to the data analysis object.
And carrying out data extraction on the cache data by taking the target position as a data extraction position to obtain the effective data.
Optionally, in this step, after performing data analysis on the cached data according to the obtained data analysis rule, the method further includes:
and acquiring a data tag of the data to be updated, and setting the data pointed by the data tag in the local data as target data of the data to be updated, wherein the target data and the data to be updated provide the same data use service, and the target data is the data to be updated on the mobile terminal.
Respectively calculating hash values of the target data and the effective data to obtain a target hash value and an effective hash value, and comparing the target hash value with the effective hash value, wherein whether the effective data and the target data are the same data or not is judged by comparing the target hash value with the effective hash value;
and if the target hash value is equal to the effective hash value, sending an update error prompt for the data to be updated, wherein if the target hash value is equal to the effective hash value, judging that the effective data and the target data are the same data, namely the data to be updated are updated in error on the mobile terminal, and sending the update error prompt for the data to be updated to prompt a user to perform manual inquiry and detection.
In this embodiment, by acquiring the data caching rule of the data to be updated and locally caching the acquired data caching rule of the data to be updated, data damage caused by data replacement of the local data is prevented, normal data service can be provided for the local data when the data is updated in error is ensured, the effective data in the cache data can be effectively extracted by acquiring the data analysis rule of the data to be updated and performing data analysis on the cache data by the acquired data analysis rule, and the local data is updated based on the extracted effective data, so that the effect of data thermal update is achieved, and the data updating efficiency is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a data updating method according to another embodiment of the present application. Compared to the corresponding embodiment of fig. 1, the data updating method provided in this embodiment further includes, after step S20 of fig. 1:
step S50, obtaining data information of the cache data, and comparing the parameter information in the data information with corresponding preset information.
The data information comprises at least one parameter information, the parameter information is format information, paragraph information or data volume information, the preset information comprises preset format information, preset paragraph information and preset data volume information, the preset format information, the preset paragraph information and the preset data volume information can be set according to requirements, and the format information, the paragraph information and the data volume information in the data information corresponding to the cache data are respectively compared with the preset format information, the preset paragraph information and the preset data volume information to judge whether the cache data are cached correctly or not.
Step S60, if any one of the parameter information in the data information is not matched with the corresponding preset information, determining that the local cache result of the cache data does not meet the data update condition.
If the format information of the cache data is not matched with the preset format information, it is determined that an error exists in the storage format of the cache data, the cache data cannot perform effective data update on the mobile terminal, if the paragraph information of the cache data is not matched with the preset paragraph information, it is determined that an error exists in the paragraph information of the cache data, the cache data cannot perform effective data update on the mobile terminal, if the data volume information of the cache data is not matched with the preset data volume information, it is determined that an error exists in the data volume of the cache data, and the cache data cannot perform effective data update on the mobile terminal, namely, the local cache result of the cache data cannot meet the data update condition.
Step S70, if the parameter information in the data information is matched with the corresponding preset information, determining that the local cache result of the cache data meets the data updating condition.
If the format information, the paragraph information and the data volume information of the cached data are all matched with the preset format information, the preset paragraph information and the preset data volume information, the local caching operation of the data to be updated is judged to be normal, and the cached data obtained by caching are correct.
In this embodiment, by acquiring the data information of the cached data and comparing the parameter information in the data information with the corresponding preset information, it can be effectively determined whether the local cache of the data to be updated operates normally, and the cached data obtained by caching is correct, thereby improving the accuracy of data updating.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a data updating method according to another embodiment of the present application. Compared to the corresponding embodiment of fig. 1, the data updating method provided in this embodiment further includes, after step S40 of fig. 1:
step S80, obtaining a prompt identifier of the data update prompt, and setting a data download table pointed by the prompt identifier as the data download table of the update database.
In this embodiment, a data issuing lookup table is prestored, and the data issuing lookup table stores corresponding relations between different prompt identifiers and corresponding data issuing tables.
In the step, the prompt identifier of the data update prompt is matched with the data issuing lookup table to obtain a data issuing table pointed by the prompt identifier, and the data issuing table stores corresponding relations between different communication addresses and corresponding associated clients.
Step S90, obtaining a local communication address, and matching the local communication address with a data forwarding table of the update database, so as to obtain the associated client corresponding to the data update prompt.
The mobile terminal corresponding to the data update prompt and the associated client are devices in the same update queue, that is, the associated client and the mobile terminal both need to update the data to be updated corresponding to the data update prompt.
For example, when the local communication address is matched with the queried data forwarding table to obtain the associated client b1 and the associated client b2, it is determined that the associated client b1 and the associated client b2 need to update the data to be updated corresponding to the data update prompt.
Step S100, a storage address of the data to be updated in the update database is obtained, and a data update broadcast is generated from the storage address.
The method comprises the steps of acquiring a storage address of data to be updated in an update database, effectively improving the generation accuracy of data update broadcast, and effectively storing the storage address of the data to be updated in the update database into the data update broadcast by generating the data update broadcast by the storage address.
And step S110, broadcasting the data updating broadcast to notify the matched associated client.
And broadcasting notification is carried out on the matched associated client through data updating broadcasting, so that the effect of prompting the associated client to synchronously update the data is achieved.
Specifically, in the step, broadcasting notification is carried out on the matched associated client through data updating broadcast carrying the data storage address to be updated, so that the matched associated client is prompted to download and update data based on the data storage address to be updated.
Further, in this embodiment, the locally caching the data to be updated according to the obtained data caching rule, after obtaining the cached data, further includes:
if the local cache result of the cache data does not meet the data updating condition, the prompt identifier of the data updating prompt inquires a data forwarding table of the updating database;
acquiring a local communication address, and matching the local communication address with the queried data forwarding table to obtain an associated client corresponding to the data update prompt;
acquiring an update state of the associated client for the data to be updated;
if the update state of the data to be updated on any associated client is the updated state, carrying out local caching on the data to be updated again until the local caching result of the cached data meets the data update condition;
if the update state of the data to be updated on any associated client is the updated state, it is determined that the data to be updated is not abnormal, and the local cache result of the cache data on the mobile terminal does not meet the data update condition because of cache errors and not because of the abnormality of the data to be updated, so that the effect of re-updating the data is achieved by re-locally caching the data to be updated, and the accuracy of data update is improved.
In this embodiment, the accuracy of the query of the associated client is effectively improved by acquiring the prompt identifier of the data update prompt and setting the data download table pointed by the prompt identifier as the data download table of the update database, the associated client corresponding to the mobile terminal is acquired by matching the local communication address with the queried data download table, the accuracy of generating the data update broadcast is improved by acquiring the storage address of the data to be updated in the update database, the storage address of the data to be updated in the update database is effectively stored in the data update broadcast, and the matched associated client is broadcast notified by the data update broadcast, so as to achieve the effect of prompting the associated client to synchronously perform data update.
In all embodiments of the present application, the data analysis is performed on the cache data based on the acquired data analysis rule to obtain the valid data, and specifically, the valid data is obtained by performing data analysis on the cache data by the acquired data analysis rule. Uploading valid data to the blockchain can ensure its security and fair transparency to the user. The user device may download the valid data from the blockchain to verify that the valid data has been tampered with. The blockchain referred to in this example is a novel mode of application for computer technology such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
Referring to fig. 4, fig. 4 is a block diagram illustrating a data updating apparatus 100 according to an embodiment of the application. The data updating apparatus 100 in this embodiment includes units for performing the steps in the embodiments corresponding to fig. 1, 2, and 3. Refer specifically to fig. 1, fig. 2, fig. 3, and the related descriptions in the embodiments corresponding to fig. 1, fig. 2, fig. 3. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 4, the data updating apparatus 100 includes: a data query unit 10, a local cache unit 11, an analysis rule acquisition unit 12, and a data update unit 13, wherein:
and the data query unit 10 is used for receiving the data update prompt sent by the update database and setting the data pointed by the data update prompt in the update database as the data to be updated.
The local caching unit 11 is configured to obtain a data caching rule of the data to be updated, and locally cache the data to be updated with the obtained data caching rule, so as to obtain cached data.
Wherein the local caching unit 10 is further configured to:
acquiring format information of the data to be updated, and setting a data type pointed by the format information as the data type of the data to be updated;
setting information pointed by the data type of the data to be updated as the data caching rule of the data to be updated, and acquiring a data caching path pointed by the data caching rule, a data caching format, a data caching speed and a data calling interface;
and carrying out local caching on the data to be updated by the acquired data caching path, the data caching format, the data caching speed and the data calling interface to obtain the cached data.
Optionally, the local caching unit 10 is further configured to:
acquiring data information of the cache data, wherein the data information comprises at least one parameter information, and the parameter information is format information, paragraph information or data volume information;
comparing the parameter information in the data information with corresponding preset information;
if any one of the parameter information in the data information is not matched with the corresponding preset information, judging that the local caching result of the cached data does not meet the data updating condition;
and if the parameter information in the data information is matched with the corresponding preset information, judging that the local caching result of the cached data meets the data updating condition.
Further, the local caching unit 10 is further configured to:
if the local cache result of the cache data does not meet the data updating condition, the prompt identifier of the data updating prompt inquires a data forwarding table of the updating database;
acquiring a local communication address, and matching the local communication address with the queried data forwarding table to obtain an associated client corresponding to the data update prompt;
acquiring an update state of the associated client for the data to be updated;
and if the update state of the data to be updated on any associated client is the updated state, carrying out local caching on the data to be updated again until the local caching result of the cached data meets the data update condition.
And the analysis rule obtaining unit 12 is configured to obtain a data analysis rule of the data to be updated if the local cache result of the cache data meets a data update condition.
And the data updating unit 13 is configured to perform data analysis on the obtained data analysis rule on the cached data, obtain valid data, and perform data update on local data according to the valid data.
Wherein the data updating unit 13 is further configured to: performing text translation on the cached data to obtain a data text, and compiling a data analysis object by a regular expression preset in the data analysis rule;
performing text searching and/or replacing on the data text by using a text processing rule pointed by the data analysis object to obtain a text processing result, wherein the text processing result comprises at least one target position, and the target position is a data position corresponding to the effective data in the cache data;
and carrying out data extraction on the cache data by taking the target position as a data extraction position to obtain the effective data.
Optionally, the data updating unit 13 is further configured to: acquiring a data tag of the data to be updated, and setting data pointed by the data tag in local data as target data of the data to be updated, wherein the target data and the data to be updated provide the same data use service;
respectively calculating hash values of the target data and the effective data to obtain a target hash value and an effective hash value;
and if the target hash value is equal to the effective hash value, sending an update error prompt for the data to be updated.
Further, the data updating unit 13 is further configured to: acquiring a prompt identifier of the data update prompt, and setting a data forwarding table pointed by the prompt identifier as a data forwarding table of the update database, wherein the data forwarding table stores corresponding relations between different communication addresses and corresponding associated clients;
acquiring a local communication address, and matching the local communication address with a data downloading table of the update database to obtain the associated client corresponding to the data update prompt;
acquiring a storage address of the data to be updated in the update database, and generating data update broadcast by the storage address;
and broadcasting the data updating broadcast to notify the matched associated client.
In this embodiment, by acquiring the data caching rule of the data to be updated and locally caching the acquired data caching rule of the data to be updated, data damage caused by data replacement of the local data is prevented, normal data service can be provided for the local data when the data is updated in error is ensured, the effective data in the cache data can be effectively extracted by acquiring the data analysis rule of the data to be updated and performing data analysis on the cache data by the acquired data analysis rule, and the local data is updated based on the extracted effective data, so that the effect of data thermal update is achieved, and the data updating efficiency is improved.
Fig. 5 is a block diagram of a terminal device 2 according to another embodiment of the present application. As shown in fig. 5, the terminal device 2 of this embodiment includes: a processor 20, a memory 21 and a computer program 22, such as a program of a data update method, stored in said memory 21 and executable on said processor 20. The steps in the respective embodiments of the data updating method described above are implemented when the processor 20 executes the computer program 23, for example, S10 to S40 shown in fig. 1, or S50 to S70 shown in fig. 2, or S80 to S120 shown in fig. 3. Alternatively, the processor 20 may implement the functions of each unit in the embodiment corresponding to fig. 4, for example, the functions of the units 10 to 13 shown in fig. 4, when executing the computer program 22, and the detailed description of the embodiment corresponding to fig. 5 will be referred to herein, which is omitted.
Illustratively, the computer program 22 may be partitioned into one or more units that are stored in the memory 21 and executed by the processor 20 to complete the present application. The one or more units may be a series of computer program instruction segments capable of performing a specific function for describing the execution of the computer program 22 in the terminal device 2. For example, the computer program 22 may be divided into a data query unit 10, a local cache unit 11, an parsing rule acquisition unit 12 and a data update unit 13, each unit functioning specifically as described above.
The terminal device may include, but is not limited to, a processor 20, a memory 21. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the terminal device 2 and does not constitute a limitation of the terminal device 2, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The processor 20 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may be an internal storage unit of the terminal device 2, such as a hard disk or a memory of the terminal device 2. The memory 21 may be an external storage device of the terminal device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the terminal device 2. The memory 21 is used for storing the computer program as well as other programs and data required by the terminal device. The memory 21 may also be used for temporarily storing data that has been output or is to be output.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (9)

1. A method of updating data, comprising:
receiving a data update prompt sent by an update database, and setting data pointed by the data update prompt in the update database as data to be updated;
acquiring a data caching rule of the data to be updated, and carrying out local caching on the data to be updated by the acquired data caching rule to obtain cached data;
if the local caching result of the cached data meets the data updating condition, acquiring a data analysis rule of the data to be updated;
carrying out data analysis on the cache data by the acquired data analysis rule to obtain effective data, and carrying out data update on local data according to the effective data;
the obtaining the data caching rule of the data to be updated, and locally caching the data to be updated by using the obtained data caching rule to obtain cached data includes:
acquiring format information of the data to be updated, and setting a data type pointed by the format information as the data type of the data to be updated;
setting information pointed by the data type of the data to be updated as the data caching rule of the data to be updated, and acquiring a data caching path pointed by the data caching rule, a data caching format, a data caching speed and a data calling interface;
and carrying out local caching on the data to be updated by the acquired data caching path, the data caching format, the data caching speed and the data calling interface to obtain the cached data.
2. The method for updating data according to claim 1, wherein the locally caching the data to be updated by the obtained data caching rule, after obtaining the cached data, further comprises:
acquiring data information of the cache data, wherein the data information comprises at least one parameter information, and the parameter information is format information, paragraph information or data volume information;
comparing the parameter information in the data information with corresponding preset information;
if any one of the parameter information in the data information is not matched with the corresponding preset information, judging that the local caching result of the cached data does not meet the data updating condition;
and if the parameter information in the data information is matched with the corresponding preset information, judging that the local caching result of the cached data meets the data updating condition.
3. The method for updating data according to claim 1, wherein the data parsing of the cache data by the obtained data parsing rule to obtain valid data includes:
performing text translation on the cached data to obtain a data text, and compiling a data analysis object by a regular expression preset in the data analysis rule;
performing text searching and/or replacing on the data text by using a text processing rule pointed by the data analysis object to obtain a text processing result, wherein the text processing result comprises at least one target position, and the target position is a data position corresponding to the effective data in the cache data;
and carrying out data extraction on the cache data by taking the target position as a data extraction position to obtain the effective data.
4. The method for updating data according to claim 1, wherein after the data analysis is performed on the cached data according to the obtained data analysis rule, the method further comprises:
acquiring a data tag of the data to be updated, and setting data pointed by the data tag in local data as target data of the data to be updated, wherein the target data and the data to be updated provide the same data use service;
respectively calculating hash values of the target data and the effective data to obtain a target hash value and an effective hash value;
and if the target hash value is equal to the effective hash value, sending an update error prompt for the data to be updated.
5. The method for updating data according to claim 1, wherein after the local data is updated according to the valid data, further comprising:
acquiring a prompt identifier of the data update prompt, and setting a data forwarding table pointed by the prompt identifier as a data forwarding table of the update database, wherein the data forwarding table stores corresponding relations between different communication addresses and corresponding associated clients;
acquiring a local communication address, and matching the local communication address with a data downloading table of the update database to obtain the associated client corresponding to the data update prompt;
acquiring a storage address of the data to be updated in the update database, and generating data update broadcast by the storage address;
and broadcasting the data updating broadcast to notify the matched associated client.
6. The method for updating data according to claim 1, wherein the locally caching the data to be updated by the obtained data caching rule, after obtaining the cached data, further comprises:
if the local cache result of the cache data does not meet the data updating condition, the prompt identifier of the data updating prompt inquires a data forwarding table of the updating database;
acquiring a local communication address, and matching the local communication address with the queried data forwarding table to obtain an associated client corresponding to the data update prompt;
acquiring an update state of the associated client for the data to be updated;
and if the update state of the data to be updated on any associated client is the updated state, carrying out local caching on the data to be updated again until the local caching result of the cached data meets the data update condition.
7. A data updating apparatus for implementing the method of any of claims 1-6; the data updating apparatus includes:
the data query unit is used for receiving a data update prompt sent by an update database and setting data pointed by the data update prompt in the update database as data to be updated;
the local caching unit is used for acquiring the data caching rule of the data to be updated, and carrying out local caching on the data to be updated by the acquired data caching rule to obtain cached data;
the analysis rule acquisition unit is used for acquiring the data analysis rule of the data to be updated if the local cache result of the cache data meets the data updating condition;
and the data updating unit is used for carrying out data analysis on the cache data by the acquired data analysis rule to obtain effective data, and carrying out data updating on local data according to the effective data.
8. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when the computer program is executed.
9. A storage medium storing a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
CN202110124661.5A 2021-01-29 2021-01-29 Data updating method, device, terminal equipment and storage medium Active CN112783909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110124661.5A CN112783909B (en) 2021-01-29 2021-01-29 Data updating method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110124661.5A CN112783909B (en) 2021-01-29 2021-01-29 Data updating method, device, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112783909A CN112783909A (en) 2021-05-11
CN112783909B true CN112783909B (en) 2023-09-26

Family

ID=75759693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110124661.5A Active CN112783909B (en) 2021-01-29 2021-01-29 Data updating method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112783909B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115080582A (en) * 2022-06-29 2022-09-20 中电金信软件有限公司 Data updating method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268173A (en) * 2014-09-15 2015-01-07 中国工商银行股份有限公司 Centralized data monitoring method, device and system
CN108874304A (en) * 2018-03-30 2018-11-23 北京奇艺世纪科技有限公司 A kind of regular configuration method and device of caching system
CN109522294A (en) * 2018-11-14 2019-03-26 郑州云海信息技术有限公司 A kind of distributed data cache system and data cache method
CN110113385A (en) * 2019-04-15 2019-08-09 中国平安人寿保险股份有限公司 Cache Dynamic Configuration, device, computer equipment and storage medium
WO2020232868A1 (en) * 2019-05-20 2020-11-26 平安科技(深圳)有限公司 Data transmission method and related device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268173A (en) * 2014-09-15 2015-01-07 中国工商银行股份有限公司 Centralized data monitoring method, device and system
CN108874304A (en) * 2018-03-30 2018-11-23 北京奇艺世纪科技有限公司 A kind of regular configuration method and device of caching system
CN109522294A (en) * 2018-11-14 2019-03-26 郑州云海信息技术有限公司 A kind of distributed data cache system and data cache method
CN110113385A (en) * 2019-04-15 2019-08-09 中国平安人寿保险股份有限公司 Cache Dynamic Configuration, device, computer equipment and storage medium
WO2020232868A1 (en) * 2019-05-20 2020-11-26 平安科技(深圳)有限公司 Data transmission method and related device

Also Published As

Publication number Publication date
CN112783909A (en) 2021-05-11

Similar Documents

Publication Publication Date Title
US11394805B1 (en) Automatic discovery of API information
CN108564339B (en) Account management method, device, terminal equipment and storage medium
US9471285B1 (en) Identifying software components in a software codebase
CN112148674B (en) Log data processing method, device, computer equipment and storage medium
CN106027644B (en) Service verification method and system
CN109388417B (en) Communication protocol updating method, system and terminal equipment
US20060156129A1 (en) System for maintaining data
US11115913B2 (en) Wireless communication core network and method for analyzing user equipment mobility in the same
CN110222107B (en) Data transmission method and related equipment
CN112905323B (en) Data processing method, device, electronic equipment and storage medium
CN111782652B (en) Data calling method, device, computer equipment and storage medium
CN113407997A (en) Data desensitization method and device, computer equipment and storage medium
CN112783909B (en) Data updating method, device, terminal equipment and storage medium
CN114116401A (en) Method, device, equipment and medium for tracking and monitoring all links of cluster message
CN111814045A (en) Data query method and device, electronic equipment and storage medium
CN115390939B (en) Service processing method and system
CN112506968A (en) Information aggregation method and device, electronic equipment and computer readable medium
CN116668520A (en) Gateway-based service arrangement method, system, equipment and storage medium
EP3040891A1 (en) Method for providing information to determine a graph associated with a data item
CN111722994A (en) Task request response method and device
US11803549B2 (en) Method and system for facilitating on-the-fly OVSDB protocol translation between multiple OVSDB schema versions
CN113076331B (en) Method, device, equipment, storage medium and program product for processing middle-stage data
CN115314382B (en) Configuration information processing method
CN110427600B (en) Batch text management method and device
CN112052267B (en) Data query method, equipment, server and storage medium

Legal Events

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

Effective date of registration: 20230830

Address after: Floor 7, Block A, Yida Bauhinia Business Center, No. 65, Xinchang West Road, Jinfeng District, Yinchuan City, Ningxia Hui Autonomous Region, 750000

Applicant after: Ningxia Aerospace Information Co.,Ltd.

Address before: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen LIAN intellectual property service center

Effective date of registration: 20230830

Address after: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen LIAN intellectual property service center

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant