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

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

Info

Publication number
CN112783909A
CN112783909A CN202110124661.5A CN202110124661A CN112783909A CN 112783909 A CN112783909 A CN 112783909A CN 202110124661 A CN202110124661 A CN 202110124661A CN 112783909 A CN112783909 A CN 112783909A
Authority
CN
China
Prior art keywords
data
updated
updating
cache
rule
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.)
Granted
Application number
CN202110124661.5A
Other languages
Chinese (zh)
Other versions
CN112783909B (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
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management 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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/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 data pointed by the data updating prompt in the updating database as data to be updated; the data to be updated is locally cached according to the data caching rule of the data to be updated to obtain cached data; and if the local cache result of the cache data meets the data updating condition, performing data analysis on the cache data according to the data analysis rule of the data to be updated to obtain effective data, and updating the local data according to the effective data. According to the data updating method and device, 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 data damage caused by data replacement of the local data is prevented, and the data service can be normally provided by the local data when the data updating is wrong. In addition, the application also relates to a block chain technology.

Description

Data updating method and 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 generally accepted definition of the internet of things is: the system comprises a social information system, a network layer and an application layer, wherein the social information system is formed by a sensing layer, the network layer and the application layer together, and the sensing layer is responsible for sensing 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 between objects and between people is realized.
In the use process of the existing internet of things, in order to guarantee normal use of data on a client, the problem of data updating accuracy is more and more emphasized by people, but in the existing data updating process, received data to be updated is directly replaced for local data, data use 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 use service, so that the use experience of a user is reduced.
Disclosure of Invention
In view of this, embodiments of the present application provide a data updating method, an apparatus, a terminal device, and a storage medium, so as to solve the problem that, in the data updating process in the prior art, when data replacement of local data by data to be updated is wrong, both the local data and the data to be updated cannot normally provide data using services.
A first aspect of an embodiment of the present application provides a data updating method, including:
receiving a data updating prompt sent by an updating database, and setting data pointed by the data updating prompt in the updating database as data to be updated;
acquiring a data caching rule of the data to be updated, and locally caching the data to be updated according to the acquired data caching rule to obtain cached data;
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;
and performing data analysis on the cache data according to the obtained data analysis rule to obtain effective data, and performing data updating on local data according to the effective data.
Further, the obtaining a data caching rule of the data to be updated, and locally caching the data to be updated according to 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 cache rule of the data to be updated, and acquiring a data cache path, a data cache format, a data cache speed and a data call interface pointed by the data cache rule;
and locally caching 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, after the locally caching the data to be updated according to the obtained data caching rule to obtain cached data, the method 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 parameter information in the data information is not matched with the corresponding preset information, judging that a local cache result of the cache 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 cache result of the cache data meets the data updating condition.
Further, the data analysis of the cache data according to the obtained data analysis rule to obtain valid data includes:
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;
performing text search and/or replacement 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 of the corresponding effective data in the cache data;
and taking the target position as a data extraction position to extract the data of the cache data to obtain the effective data.
Further, after performing data analysis on the cached data according to the obtained data analysis rule to obtain valid data, the method further includes:
acquiring a data tag of the data to be updated, 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 aiming at the data to be updated.
Further, after the data updating is performed on the local data according to the valid data, the method further includes:
acquiring a prompt identifier of the data updating prompt, and setting a data issuing table pointed by the prompt identifier as a data issuing table of the updating database, wherein the data issuing table stores corresponding relations between different communication addresses and corresponding associated clients;
acquiring a local communication address, issuing the local communication address and the data of the update database for matching, and acquiring 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 a data update broadcast by the storage address;
and broadcasting the data updating broadcast to the matched associated client for notification.
Further, after the locally caching the data to be updated according to the obtained data caching rule to obtain cached data, the method 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 the data of the updating database and issues the data;
acquiring a local communication address, and matching the local communication address with the inquired data published list to obtain an associated client corresponding to the data updating prompt;
acquiring the update state of the associated client aiming at the data to be updated;
and if the update state of the data to be updated on any one of the associated clients is the updated state, locally caching the data to be updated again until the local caching result of the cached data meets the data updating 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 cache unit is used for acquiring a data cache rule of the data to be updated and locally caching the data to be updated according to the acquired data cache rule to obtain cache data;
the analysis rule obtaining unit is used for obtaining a data analysis rule of the data to be updated if a local cache result of the cache data meets a data updating condition;
and the data updating unit is used for performing data analysis on the cache data according to the obtained data analysis rule to obtain effective data, and performing data updating on local data according to the effective data.
A third aspect of the embodiments of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the terminal device, where the processor implements the steps of the data updating 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, which stores a computer program that, when executed by a processor, implements the steps of the data updating method provided by the first aspect.
The data updating method, the data updating 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, data damage caused by data replacement of the local data is prevented, the data service can be normally provided for the local data when the data updating is wrong, the 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, 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 hot updating is achieved, and the data updating efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an implementation of a data updating method provided in an embodiment of the present application;
FIG. 2 is a flowchart illustrating an implementation of a data updating method according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of a data updating method according to another embodiment of the present application;
FIG. 4 is a block diagram illustrating a data update apparatus according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The data updating method according to the embodiment of the present application may be executed 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 provided in an embodiment of the present application, including:
step S10, receiving a data update prompt sent by the 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 store corresponding relations 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 data updating occurs.
For example, the update database corresponding to the mobile terminal comprises an update database a1, an update database a2 and an update database a3, and when the update database a1 has data update, 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 a corresponding relationship 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 identifiers stored in the data update prompt with the data lookup table.
Step S20, obtaining a data caching rule of the data to be updated, and locally caching the data to be updated according to the obtained data caching rule to obtain cached data.
Specifically, in this step, the obtaining a data caching rule of the data to be updated, and locally caching the data to be updated according to the obtained data caching rule to obtain cached data includes:
the format information of the data to be updated is acquired, 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 query table is prestored in the embodiment, and the data type query table stores the corresponding relationship between different format information and the corresponding data type, so that the data type pointed by the format information is obtained by matching the format information of the data to be updated with the data type query table.
Setting information pointed by the data type of the data to be updated as the data cache rule of the data to be updated, and obtaining a data cache path, a data cache format, a data cache speed and a data call interface pointed by the data cache rule, wherein a rule lookup table is prestored in the embodiment, and the rule lookup table stores corresponding relations between different data cache rules and corresponding data cache paths, data cache formats, data cache speeds and data call interfaces.
And locally caching the data to be updated according to the acquired data caching path, the acquired data caching format, the acquired data caching speed and the acquired 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 performed on the data to be updated based on the data caching format, unification of the data format after caching of the data to be updated is effectively guaranteed, caching efficiency in the caching process of the data to be updated is effectively guaranteed based on the data caching speed, and data calling after caching of 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 update condition, obtaining the data analysis rule of the data to be updated.
The data updating condition is used for judging whether a local cache result of the cache data is abnormal or not, if the local cache result of the cache data meets the data updating condition, the local cache operation of the data to be updated is judged to be normal, and the cache data obtained by caching is correct.
Specifically, in this embodiment, an analysis rule lookup table is prestored, and a corresponding relationship between different databases and corresponding data analysis rules is stored in the analysis rule lookup table, so that the data analysis rule of the data to be updated is obtained by matching the update database corresponding to the data to be updated with the analysis rule lookup table, and the data analysis rule is used for performing data analysis on the data to be updated to obtain valid data in the data to be updated.
Optionally, in this embodiment, if the local caching result of the cached data does not satisfy the data updating condition, an update error prompt is sent for the data to be updated.
Step S40, performing data analysis on the cache data according to the obtained data analysis rule to obtain valid data, and performing data update on local data according to the valid data.
Specifically, in this step, the performing data analysis on the cache data according to the obtained data analysis rule to obtain valid data includes:
the cache data is subjected to text translation to obtain a data text, and a regular expression preset in the data analysis rule is compiled into a data analysis object, wherein the text translation of the cache data can be performed in a text translator mode, and the text translation is used for converting the cache data into a text format, so that the subsequent text processing operation of the cache data is effectively facilitated.
And performing text search and/or replacement on the data text according to a text processing rule pointed by the data analysis object to obtain a text processing result, wherein the text search and/or replacement can be performed on the data text according to the data analysis object, so that the position of effective data in the cache data can be effectively identified, the text processing result comprises at least one target position, the target position is the data position of the corresponding effective data in the cache data, and the target position can be a character string position, a character position, a field position or the like.
And taking the target position as a data extraction position to extract the data of the cache data to obtain the effective data.
Optionally, in this step, after performing data analysis on the cached data according to the obtained data analysis rule to obtain valid data, the method further includes:
and 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, and the target data is data which needs 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 the target hash value and the effective hash value are compared to judge whether the effective data and the target data are the same data;
and if the target hash value is equal to the effective hash value, sending an update error prompt aiming at 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 is updated on the mobile terminal in an error manner, and sending the update error prompt aiming at the data to be updated so as to prompt a user to perform manual inquiry and detection.
In the embodiment, the data cache rule of the data to be updated is obtained, and the obtained data cache rule is used for locally caching the data to be updated, so that data damage caused by data replacement of the local data is prevented, and the data service can be normally provided by the local data when the data update is wrong.
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. With respect to the embodiment corresponding to fig. 1, the data updating method provided in this embodiment further includes, after step S20 of fig. 1:
step S50, acquiring data information of the cached data, and performing information comparison between the parameter information in the data information and corresponding preset information.
The data information comprises at least one piece of 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 compared with the preset format information, the preset paragraph information and the preset data volume information respectively to judge whether the cache data are cached correctly.
Step S60, if any of the parameter information in the data information does not match the corresponding preset information, determining that the local caching result of the cached data does not satisfy the data updating condition.
If the format information of the cached data is not matched with the preset format information, it is determined that the storage format of the cached data has an error, the cached data cannot perform effective data update on the mobile terminal, if the paragraph information of the cached data is not matched with the preset paragraph information, it is determined that the paragraph information of the cached data has an error, the cached data cannot perform effective data update on the mobile terminal, if the data amount information of the cached data is not matched with the preset data amount information, it is determined that the data amount of the cached data has an error, the cached data cannot perform effective data update on the mobile terminal, that is, the local cached result of the cached data does not satisfy the data update condition.
Step S70, if the parameter information in the data information matches the corresponding preset information, it is determined that the local caching result of the cached data satisfies 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, it is determined that the local caching operation of the data to be updated is normal, and the cached data obtained by caching is correct.
In the embodiment, by acquiring the data information of the cache data and comparing the parameter information in the data information with the corresponding preset information, the local cache operation of the data to be updated can be effectively judged to be normal, and whether the cache data obtained by caching is correct or not can be effectively judged, so that the accuracy of data updating is improved.
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. With respect to the embodiment corresponding to 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 the data publishing table pointed by the prompt identifier as the data publishing table of the update database.
The implementation is pre-stored with a data issuing query table, and the data issuing query table stores the corresponding relationship between different prompt identifiers and corresponding data issuing tables.
In this step, the prompt identifier of the data update prompt is matched with the data issuance query table to obtain the data issuance statement pointed by the prompt identifier, and the data issuance statement stores the corresponding relationship between different communication addresses and corresponding associated clients.
And step S90, obtaining a local communication address, and issuing and matching the local communication address with the data of the update database to obtain the associated client corresponding to the data update prompt.
The associated client and the mobile terminal corresponding to the data update prompt are devices in the same update queue, that is, both the associated client and the mobile terminal need to update data to be updated corresponding to the data update prompt.
For example, when the local communication address is matched with the published data obtained by querying and the associated client b1 and the associated client b2 are obtained, 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, obtaining the storage address of the data to be updated in the update database, and generating a data update broadcast by the storage address.
The method comprises the steps of obtaining a storage address of data to be updated in an update database, effectively improving the accuracy of data update broadcast generation, and generating the data update broadcast by the storage address, so that the storage address of the data to be updated in the update database can be effectively stored in the data update broadcast.
Step S110, performing broadcast notification on the matched associated client by the data update broadcast.
The matched associated client is broadcasted by the data updating broadcast, so that the effect of prompting the associated client to synchronously update the data is achieved.
Specifically, in this step, a data update broadcast carrying the storage address of the data to be updated is used to perform broadcast notification on the matched associated client, so as to prompt the matched associated client to download and update data based on the storage address of the data to be updated.
Further, in this embodiment, after locally caching the data to be updated according to the obtained data caching rule to obtain cached data, the method 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 the data of the updating database and issues the data;
acquiring a local communication address, and matching the local communication address with the inquired data published list to obtain an associated client corresponding to the data updating prompt;
acquiring the update state of the associated client aiming at the data to be updated;
if the update state of the data to be updated on any one of the associated clients is the updated state, locally caching the data to be updated again until the local caching result of the cached data meets the data updating condition;
if the update state of the data to be updated on any associated client is the updated state, judging that the data to be updated is not abnormal, wherein the fact that the local cache result of the cache data on the mobile terminal does not meet the data update condition is caused by cache error and is not caused by the abnormality of the data to be updated, so that the effect of updating the data again is achieved by performing local cache on the data to be updated, and the accuracy of updating the data is improved.
In the embodiment, the prompt identifier of the data updating prompt is obtained, the data publishing table pointed by the prompt identifier is set as the data publishing table of the updating database, the query accuracy of the associated client is effectively improved, the associated client corresponding to the mobile terminal is obtained by matching the local communication address with the queried data publishing table, the storage address of the data to be updated in the updating database is obtained, the generation accuracy of the data updating broadcast is improved, the data updating broadcast is generated by the storage address, the storage address of the data to be updated in the updating database can be effectively stored in the data updating broadcast, and the matched associated client is broadcasted and notified by the data updating broadcast, so that the effect of prompting the associated client to synchronously update the data is achieved.
In all embodiments of the present application, the cache data is subjected to data analysis based on the obtained data analysis rule to obtain valid data, and specifically, the valid data is obtained by performing data analysis on the cache data according to the obtained data analysis rule. Uploading valid data to the blockchain can ensure the safety and the fair transparency to users. The user equipment may download the valid data from the blockchain to verify whether the valid data is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Referring to fig. 4, fig. 4 is a block diagram of a data updating apparatus 100 according to an embodiment of the present disclosure. The data updating apparatus 100 in this embodiment includes units for executing steps in the embodiments corresponding to fig. 1, fig. 2, and fig. 3. Please refer to fig. 1, fig. 2, and fig. 3, and the corresponding embodiments of fig. 1, fig. 2, and fig. 3. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 4, the data update apparatus 100 includes: data query unit 10, local cache unit 11, parsing rule obtaining unit 12 and data updating unit 13, wherein:
the data query unit 10 is configured to receive a data update prompt sent by an update database, and set data pointed by the data update prompt in the update database as 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 according to the obtained data caching rule to obtain cached data.
Wherein, the local cache 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 cache rule of the data to be updated, and acquiring a data cache path, a data cache format, a data cache speed and a data call interface pointed by the data cache rule;
and locally caching 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 cache 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 parameter information in the data information is not matched with the corresponding preset information, judging that a local cache result of the cache 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 cache result of the cache data meets the data updating condition.
Further, the local cache 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 the data of the updating database and issues the data;
acquiring a local communication address, and matching the local communication address with the inquired data published list to obtain an associated client corresponding to the data updating prompt;
acquiring the update state of the associated client aiming at the data to be updated;
and if the update state of the data to be updated on any one of the associated clients is the updated state, locally caching the data to be updated again until the local caching result of the cached data meets the data updating condition.
An analysis rule obtaining unit 12, configured to obtain a data analysis rule of the data to be updated if a 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 cache data according to the obtained data analysis rule to obtain valid data, and perform data updating on local data according to the valid data.
Wherein, the data updating unit 13 is further configured to: 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;
performing text search and/or replacement 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 of the corresponding effective data in the cache data;
and taking the target position as a data extraction position to extract the data of the cache data 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, 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 aiming at the data to be updated.
Further, the data updating unit 13 is further configured to: acquiring a prompt identifier of the data updating prompt, and setting a data issuing table pointed by the prompt identifier as a data issuing table of the updating database, wherein the data issuing table stores corresponding relations between different communication addresses and corresponding associated clients;
acquiring a local communication address, issuing the local communication address and the data of the update database for matching, and acquiring 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 a data update broadcast by the storage address;
and broadcasting the data updating broadcast to the matched associated client for notification.
In the embodiment, the data cache rule of the data to be updated is obtained, and the obtained data cache rule is used for locally caching the data to be updated, so that data damage caused by data replacement of the local data is prevented, and the data service can be normally provided by the local data when the data update is wrong.
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 processor 20, when executing the computer program 23, implements the steps in the embodiments of the data updating methods described above, such as S10 to S40 shown in fig. 1, or S50 to S70 shown in fig. 2, or S80 to S120 shown in fig. 3. Alternatively, when the processor 20 executes the computer program 22, the functions of the units in the embodiment corresponding to fig. 4, for example, the functions of the units 10 to 13 shown in fig. 4, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 5, which is not repeated herein.
Illustratively, the computer program 22 may be divided into one or more units, which are stored in the memory 21 and executed by the processor 20 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 22 in the terminal device 2. For example, the computer program 22 may be divided into the data query unit 10, the local cache unit 11, the parsing rule obtaining unit 12 and the data update unit 13, and the specific functions of each unit are 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 a terminal device 2 and does not constitute a limitation of the terminal device 2 and may include more or less components than those shown, or some components may be combined, or different components, for example the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 20 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. 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 also 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), and 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 and other programs and data required by the terminal device. The memory 21 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for updating data, comprising:
receiving a data updating prompt sent by an updating database, and setting data pointed by the data updating prompt in the updating database as data to be updated;
acquiring a data caching rule of the data to be updated, and locally caching the data to be updated according to the acquired data caching rule to obtain cached data;
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;
and performing data analysis on the cache data according to the obtained data analysis rule to obtain effective data, and performing data updating on local data according to the effective data.
2. The data updating method according to claim 1, wherein 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 comprises:
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 cache rule of the data to be updated, and acquiring a data cache path, a data cache format, a data cache speed and a data call interface pointed by the data cache rule;
and locally caching 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.
3. The data updating method according to claim 1, wherein after the locally caching the data to be updated according to the obtained data caching rule to obtain cached data, the method 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 parameter information in the data information is not matched with the corresponding preset information, judging that a local cache result of the cache 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 cache result of the cache data meets the data updating condition.
4. The data updating method according to claim 1, wherein the performing data analysis on the cached data according to the obtained data analysis rule to obtain valid data comprises:
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;
performing text search and/or replacement 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 of the corresponding effective data in the cache data;
and taking the target position as a data extraction position to extract the data of the cache data to obtain the effective data.
5. The data updating method according to claim 1, wherein after performing data analysis on the cached data according to the obtained data analysis rule to obtain valid data, the method further comprises:
acquiring a data tag of the data to be updated, 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 aiming at the data to be updated.
6. The data updating method according to claim 1, wherein after the data updating the local data according to the valid data, the method further comprises:
acquiring a prompt identifier of the data updating prompt, and setting a data issuing table pointed by the prompt identifier as a data issuing table of the updating database, wherein the data issuing table stores corresponding relations between different communication addresses and corresponding associated clients;
acquiring a local communication address, issuing the local communication address and the data of the update database for matching, and acquiring 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 a data update broadcast by the storage address;
and broadcasting the data updating broadcast to the matched associated client for notification.
7. The data updating method according to claim 1, wherein after the obtained data caching rule locally caches the data to be updated and obtains cached data, the method 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 the data of the updating database and issues the data;
acquiring a local communication address, and matching the local communication address with the inquired data published list to obtain an associated client corresponding to the data updating prompt;
acquiring the update state of the associated client aiming at the data to be updated;
and if the update state of the data to be updated on any one of the associated clients is the updated state, locally caching the data to be updated again until the local caching result of the cached data meets the data updating condition.
8. A data update apparatus, comprising:
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 cache unit is used for acquiring a data cache rule of the data to be updated and locally caching the data to be updated according to the acquired data cache rule to obtain cache data;
the analysis rule obtaining unit is used for obtaining a data analysis rule of the data to be updated if a local cache result of the cache data meets a data updating condition;
and the data updating unit is used for performing data analysis on the cache data according to the obtained data analysis rule to obtain effective data, and performing data updating on local data according to the effective data.
9. 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 7 when executing the computer program.
10. A storage medium storing a computer program, characterized in that the computer program realizes the steps of the method according to any one of claims 1 to 7 when executed by a processor.
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 true CN112783909A (en) 2021-05-11
CN112783909B 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)

Cited By (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

Cited By (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

Also Published As

Publication number Publication date
CN112783909B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
US9471285B1 (en) Identifying software components in a software codebase
CN108564339B (en) Account management method, device, terminal equipment and storage medium
US10063649B2 (en) Data translation using a proxy service
US8095547B2 (en) Method and apparatus for detecting spam user created content
CN110399388A (en) Data query method, system and equipment
US20060156129A1 (en) System for maintaining data
CN106027644B (en) Service verification method and system
WO2021003979A1 (en) Data entry method and system, device and storage medium
US11115913B2 (en) Wireless communication core network and method for analyzing user equipment mobility in the same
CN110389859B (en) Method, apparatus and computer program product for copying data blocks
CN108491715B (en) Terminal fingerprint database generation method and device and server
CN112783909A (en) Data updating method and device, terminal equipment and storage medium
CN110619204A (en) Invitation code generation method and device, terminal equipment and storage medium
CN112052256A (en) Multi-version request returning method and device, computer equipment and readable storage medium
CN111722994A (en) Task request response method and device
CN111259049A (en) Information query method, information query device and terminal equipment
CN115390939A (en) Service processing method and system
CN114463125A (en) Transaction issuing and transaction updating method, device, equipment and storage medium
CN113312540A (en) Information processing method, device, equipment, system and readable storage medium
EP3040891A1 (en) Method for providing information to determine a graph associated with a data item
CN113076331B (en) Method, device, equipment, storage medium and program product for processing middle-stage data
CN115314382B (en) Configuration information processing method
CN116828404B (en) Industry short message accurate sending method and device, electronic equipment and medium
US20230090170A1 (en) Method and system for facilitating on-the-fly ovsdb protocol translation between multiple ovsdb schema versions
CN110377325B (en) Interface configuration method, interface calling method, device, equipment 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
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.

GR01 Patent grant
GR01 Patent grant