CN114048228A - State storage updating method, device, equipment and storage medium - Google Patents

State storage updating method, device, equipment and storage medium Download PDF

Info

Publication number
CN114048228A
CN114048228A CN202111301758.5A CN202111301758A CN114048228A CN 114048228 A CN114048228 A CN 114048228A CN 202111301758 A CN202111301758 A CN 202111301758A CN 114048228 A CN114048228 A CN 114048228A
Authority
CN
China
Prior art keywords
data
state
updating
condition
requirement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111301758.5A
Other languages
Chinese (zh)
Inventor
李小保
陈健璋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202111301758.5A priority Critical patent/CN114048228A/en
Publication of CN114048228A publication Critical patent/CN114048228A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation

Abstract

The application discloses a method, a device, equipment and a storage medium for updating state storage, wherein the method comprises the following steps: acquiring a judgment index of data in a State storage State, wherein the judgment index comprises at least one of a data State, a data query frequency and a data peak, and the data query frequency comprises a query frequency of at least one data dimension of data to be queried; determining whether the State meets the updating requirement according to the judgment condition corresponding to the judgment index; and under the condition that the State meets the updating requirement, updating the State according to the updating mode corresponding to the judgment index. According to the scheme, the storage State of the data in the current State is comprehensively determined at multiple angles by monitoring indexes of the data State, the data query frequency and the data peak, and the State is updated in a manner corresponding to the judgment index by combining the judgment index of the data and the data storage State of the State under the condition that the State meets the updating requirement, so that the data processing efficiency of the State is ensured.

Description

State storage updating method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the field of data processing, in particular to a method, a device, equipment and a storage medium for updating state storage.
Background
In the prior art, the intermediate State data is stored in a State storage (State), and the data in the State is generally set with a storage time, and when the data reaches the storage time, the data is cleared by using a clearing strategy. When the data volume is large, the parallelism is generally directly expanded to increase the memory space or the effective time of the State data in the memory is set to be short, and the external storage is used for storing the data State.
However, whether data is used or not or whether data events are completed or not is the data stored in the State, which wastes memory and reduces data query efficiency. In addition, when the data throughput is high, a measure of increasing the parallelism is taken, so that the consumption of a Central Processing Unit (CPU) is increased, and a large amount of data which is not commonly used is stored in a memory, thereby causing the waste of resources. At the same time, the use of external storage also increases system response delay.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for updating State storage, which can comprehensively determine the storage State of data in the current State from multiple angles, and update the State by combining the judgment index of the data and the data storage State of the State in a mode corresponding to the judgment index under the condition that the State meets the updating requirement so as to ensure the data processing efficiency of the State.
In a first aspect, an embodiment of the present application further provides a method for updating a state storage, where the method includes:
acquiring a judgment index of data in a State storage State, wherein the judgment index comprises at least one of a data State, a data query frequency and a data peak, and the data query frequency comprises a query frequency of at least one data attribute of data to be queried;
determining whether the State meets the updating requirement according to the judgment condition corresponding to the judgment index;
and under the condition that the State reaches the updating requirement, updating the State according to the updating mode corresponding to the judgment index.
In a second aspect, an embodiment of the present application further provides an apparatus for updating a state storage, where the apparatus includes:
the acquisition module is used for acquiring judgment indexes of data in a State storage State, wherein the judgment indexes comprise at least one of a data State, a data query frequency and a data flood peak, and the data query frequency comprises a query frequency of at least one data attribute of data to be queried;
the judging module is used for judging the judging index of the data according to the judging condition corresponding to the judging index and determining whether the State reaches the updating requirement;
and the updating module is used for updating the State according to the updating mode corresponding to the judgment index under the condition that the State reaches the updating requirement.
In a third aspect, an embodiment of the present application further provides a computer device, including: the memory, the processor and the computer program stored on the memory and capable of running on the processor realize the updating method of the state storage provided by any embodiment of the application when the processor executes the computer program.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for updating a state storage as provided in any embodiment of the present application.
The embodiment of the application provides a method, a device, equipment and a storage medium for updating state storage, wherein the method comprises the following steps: acquiring a judgment index of data in a State storage State, wherein the judgment index comprises at least one of a data State, a data query frequency and a data peak, and the data query frequency comprises a query frequency of at least one data attribute of data to be queried; determining whether the State meets the updating requirement according to the judgment condition corresponding to the judgment index; and under the condition that the State meets the updating requirement, updating the State according to the updating mode corresponding to the judgment index. According to the scheme, the storage State of the data in the current State is comprehensively determined at multiple angles by monitoring indexes of the data State, the data query frequency and the data peak, and the State is updated in a manner corresponding to the judgment index by combining the judgment index of the data and the data storage State of the State under the condition that the State meets the updating requirement, so that the data processing efficiency of the State is ensured.
Drawings
FIG. 1 is a flow chart of a method for updating a state store in an embodiment of the present application;
FIG. 2 is a diagram illustrating an updating method for implementing state storage by a Flink execution engine in an embodiment of the present application;
FIG. 3 is a diagram illustrating a Flink execution engine performing a state storage update according to a data state in an embodiment of the present application;
FIG. 4 is a diagram illustrating a state storage update performed by a Flink execution engine according to a data query frequency in an embodiment of the present application;
FIG. 5 is a schematic diagram of data flooding in an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a state storage updating apparatus in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computer device in an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
In addition, in the embodiments of the present application, the words "optionally" or "exemplarily" are used for indicating as examples, illustrations or explanations. Any embodiment or design described herein as "optionally" or "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "optionally" or "exemplarily" etc. is intended to present the relevant concepts in a concrete fashion.
In order to facilitate a clearer understanding of the solutions provided by the embodiments of the present application, concepts that may be referred to in the present application are explained herein, specifically as follows:
flink: is an open source stream processing framework developed by the Apache software foundation, and is at the core a distributed stream data stream engine written in Java and Scala. Flink executes arbitrary stream data programs in a data parallel and pipelined manner, and Flink's pipelined runtime system can execute batch and stream processing programs.
ETL: english is called extraction, Cleaning and Transform, namely, the process of loading data of a business system into a data warehouse after extraction, Cleaning and conversion is carried out, the aim is to integrate scattered, disordered and standard-nonuniform data in an enterprise together, and an analysis basis is provided for the decision of the enterprise, and ETL is an important link of a BI (business intelligence) project.
Kafka: is an open source stream processing platform developed by the Apache software foundation and written by Scala and Java. Kafka is a high-throughput distributed publish-subscribe messaging system that can handle all the action flow data of a consumer in a web site. This action (web browsing, searching and other user behavior) is a key factor in many social functions on modern networks. These data are typically addressed by handling logs and log aggregations due to throughput requirements. This is a viable solution to the limitations of Hadoop-like log data and offline analysis systems, but which require real-time processing. The purpose of Kafka is to unify online and offline message processing through the parallel loading mechanism of Hadoop, and also to provide real-time messages through clustering.
Fig. 1 is a flowchart of a State storage updating method according to an embodiment of the present application, where the method may be applied to a scenario where various types of data to be queried are stored in a State, so as to implement adaptive update of the State according to a real-time storage State of the data, ensure storage and query efficiencies of the data, and improve a resource utilization rate. As shown in fig. 1, the method may include, but is not limited to, the following steps:
s101, obtaining a judgment index of data in the State.
In this embodiment, the State is a State storage, and is used to store data, for example, waybill data in a waybill scene of an e-commerce platform. Illustratively, the judgment index of the data may include at least one of a data state, a data query frequency, and a data flood peak. Further, in the embodiment of the present application, the data query frequency may be understood as a query frequency of at least one data attribute of the data to be queried, for example, in the e-commerce platform scenario, the data to be queried may include waybill data, and the at least one attribute of the waybill data may include a delivery address, a contact phone, a buyer name, etc., and accordingly, the query frequency of the data attribute may include an address query frequency of the waybill data, a phone query frequency of the waybill data, a name query frequency of the waybill data, etc. In the document retrieval website scenario, the data to be searched may include document data, at least one attribute of the data may include an author name, an affiliated subject, a keyword, and the like, and accordingly, the query frequency of the data attribute may include an author name query frequency, a keyword query frequency, and the like of the document data.
S102, determining whether the State meets the updating requirement according to the judgment condition corresponding to the judgment index.
Since the judgment indexes designed in the embodiment of the application belong to different factors, the judgment conditions corresponding to different judgment indexes are different, and therefore when judging whether the State is updated, the judgment conditions corresponding to the judgment indexes in the State need to be adopted to respectively judge the corresponding judgment indexes. For example, the data State, the data query frequency and the data flood peak in the State are respectively judged according to the judgment condition of the data State, the judgment condition of the data query frequency and the judgment condition of the data flood peak, and whether the State meets the updating requirement is determined according to the judgment results of different indexes. Illustratively, if at least one judgment index in the states meets the judgment condition corresponding to the judgment index, it can be determined that the states meet the update requirement, otherwise, the states do not meet the update requirement.
And S103, updating the State according to the updating mode corresponding to the judgment index under the condition that the State meets the updating requirement.
When the State meets the update requirement, the State may be updated according to the update mode corresponding to the determination indicator, for example, update the data stored in the State such as deletion and backup, or update the data storage capacity of the State.
The embodiment of the application provides a state storage updating method, which comprises the following steps: acquiring a judgment index of data in a State storage State, wherein the judgment index comprises at least one of a data State, a data query frequency and a data peak, and the data query frequency comprises a query frequency of at least one data attribute of data to be queried; determining whether the State meets the updating requirement according to the judgment condition corresponding to the judgment index; and under the condition that the State meets the updating requirement, updating the State according to the updating mode corresponding to the judgment index. According to the scheme, the storage State of the data in the current State is comprehensively determined at multiple angles by monitoring indexes of the data State, the data query frequency and the data peak, and the State is updated in a manner corresponding to the judgment index by combining the judgment index of the data and the data storage State of the State under the condition that the State meets the updating requirement, so that the data processing efficiency of the State is ensured.
Optionally, the update process of the State storage may be implemented in a flag execution engine, as shown in fig. 2, after the data stream reaches the flag execution engine, the data stream is processed through an ETL process, and then stored in State, the State and the data query frequency of the data are monitored in real time by a monitor, and a data flood peak is monitored by a monitor. Further, the data in State may be synchronized to disk or data warehouse, or, in certain cases, the data may be queried in disk and the queried data returned to State.
In one example, the implementation process of step S102 may include the following implementation manners:
and if the judgment index comprises the data State, determining that the update requirement of the State is not met under the condition that the data State comprises the initialization State and the update State, and updating the data corresponding to the data State into the State. Where the data State includes a completion State, it is determined that the update requirement of State is reached.
For example, as shown in fig. 3, real-time consumption data is acquired in Kafka message middleware in Flink, the sequence of data messages in Kafka is a (INIT), B (UPDATE1), (UPDATE2), and d (FINISH), wherein the data initialization state is INIT, two intermediate states (UPDATE1 and UPDATE2) are passed, and the final data event is completed (FINISH). When the data A arrives for the first time, because the data State of the data is an initialization State, the data A is determined not to reach the update requirement of the State, the data A is directly stored into the State, and the data A is sent to a downstream message queue, so that a downstream user can see the data change in real time. When the data B, C arrives, since the State attribute of the B, C data is in an updated State, the update requirement of the State is not reached, then the data a can be updated according to B, C, for example, the storage time of the data, the value in some attributes of the data, and the new attribute of the data are updated, and the data of B, C is updated to the State. When the data D arrives, the State updating requirement is determined to be met because the State of the data is the completion State.
Correspondingly, the updating of State according to the update mode corresponding to the determination indicator of the data State in step S103 may include: and merging the data corresponding to the data State and the data before the data to obtain integrated data, synchronizing the integrated data to other nodes for storage, for example, issuing the integrated data to a downstream node, and deleting the integrated data from the State, or synchronizing the integrated data to a remote node for storage, so that the storage space of the State can be reduced.
The above process is described in detail below with specific examples, which are as follows:
the A data includes { ' id ': 1 ', ' state ': INIT ', ' name ': goods1 ', ' update time ': 2020-08-0100: 00:00 ', ' addr ': beijing ' };
b data includes { ' id ': 1 ', ' state ': UPDATE1 ', ' name ': goods1 ', ' UPDATE time ': 2020-08-0100: 20:00 ', ' phone ': 1232932 ' };
c data includes { 'id': 1 ',' state ': UPDATE 2', 'name': goods1 ',' UPDATE time ': 2020-08-0100: 30: 00', 'color': red ',' period ': 1 year';
d data includes { 'id': 1 ',' state ': FINSH', 'name': goods1 ',' update time ': 2020-08-0100: 40: 00' }.
These data are sent in sequence, and the B data updates the same value of the attribute in the a data and supplements the added attribute, e.g., the phone attribute. After the data B is processed, the data results are saved as { 'id': 1 ',' state ': UPDATE 2', 'name': goods1 ',' UPDATE time ': 2020-08-0100: 20: 00', 'phone': 1232932 ',' addr ': beijing'.
The C data is processed in the same way until the D data is processed, and the final data is { 'id': 1 ',' state ': FINSHII', 'name': goods1 ',' update time ': 2020-08-0100: 20: 00', 'phone': 1232932 ',' addr ': beijing', 'period': 1year ',' color ': red'.
When the data processing is completed and the data message is sent out (i.e. synchronously stored to other nodes), the data contained in the message can be deleted from the State or synchronously stored to the remote node. Therefore, the pressure of data storage in the State is reduced, and the pressure of processing the expired data in a centralized mode is also reduced.
In one example, the implementation process of step S102 may include the following implementation manners:
if the judgment index includes the data query frequency, the query frequency of at least one data attribute of the data to be queried can be obtained, for example, when the data to be queried is waybill data, the query frequency of a phone attribute and the query frequency of an addr attribute associated with the waybill data. In a preset time, if the query times of all data attributes in at least one data attribute associated with waybill data are greater than or equal to a disk refresh threshold, it is indicated that the data refresh frequency corresponding to the data attribute is frequent, and it is determined that the update requirement of the State is not met currently, that is, the data is continuously stored in the State, and the State is not updated. On the contrary, in the preset time, if the query frequency of any data attribute in at least one data attribute is smaller than the disk flashing threshold, it indicates that the data flashing frequency corresponding to the data attribute is low, indicating that the State updating requirement is met.
As shown in fig. 4, taking the data to be searched as waybill data as an example, assuming that the data1 is address attribute data, the address is encoded as addr1, the corresponding specific positions are "No. 6 building 1 unit 111 of the Tongzhou district of beijing city through sea road 38", the data2 and the data3 are waybill data { ' package _ id ': 1 ', ' addr _ code ': addr1 ', ' username ': zhangsan ' }, then the address attribute data needs to be correlated when data2 and data3 are queried, and after the address is correlated using the address encoding addr1, the waybill data obtained by querying is { ' package _ id ': 1 ', ' addr _ code ': 1 ', ' username ': zhangsan ': and ' address ': are ' package _ id ': 1 unit 111 of the Tongzhan district of beijing city through sea road 6 '.
Accordingly, under this condition, the implementation process of updating State according to the update mode corresponding to the determination indicator of the data query frequency in step S103 may include: the data to be checked is refreshed into the disk, and the data to be checked is deleted from the State, that is, whether the data is refreshed into the disk is determined according to the query frequency of the associated attribute of the data to be checked, if the query frequency corresponding to all the data attributes of the data to be checked stored in the State is high and the refreshing is frequent, the data to be checked can be continuously stored in the State, and if the query frequency of the data attribute is low, the data to be checked can be refreshed into the disk, so that the delay caused by frequent reading and writing of the disk can be avoided.
In one example, the implementation process of step S102 may include the following implementation manners:
if the judgment index comprises a data flood peak, the variation trend of the data flow in a preset time length can be obtained; in a preset time length, if the variation trend does not include a data flood peak, determining that the update requirement of the State is not met; and in a preset time length, if the change trend comprises a data peak and the data peak time is consistent with the historical data peak time, determining that the update requirement of State is met. As shown in fig. 5, the data flood peak includes that the data traffic whose variation trend is an ascending trend and the time length within the preset time length that is greater than the first proportion exceeds the maximum value of the fluctuation range of the data traffic, and/or that the data traffic whose variation trend is a descending trend and the time length within the preset time length that is greater than the second proportion exceeds the maximum value of the fluctuation range of the data traffic. The first proportion and the second proportion are respectively used for limiting the time length of the data flow rate in the above trend and the time length of the data flow rate in the descending trend within the preset time length, and optionally, the first proportion and the second proportion may be the same or different. That is, if the data traffic fluctuates within a preset data fluctuation range (such as the maximum value and the minimum value of the data traffic shown in fig. 5), it can be considered that the current data traffic fluctuates within a normal fluctuation range, and does not belong to a data flood peak, and the State does not need to be updated. Or, if only a small part of fluctuation amplitude in the data flow fluctuation trend exceeds the maximum value of the data flow, but the time length of the exceeding part does not meet the requirement of the data flood peak, the data flood peak is not considered to belong to currently, and the State does not need to be updated. On the contrary, if the fluctuation range of the data traffic is large and the trend of the data flood peak appears in the fluctuation trend, the data flood peak appears in the current data traffic fluctuation, and the State needs to be updated.
Optionally, the data flood may also be determined by listening to the data processing process of the Flink execution engine by the listener. For example, in the normal execution process of the program, if the monitor monitors that a back pressure condition occurs to the Flink, the monitor queries historical peak data flow or historical peak data time, and if the data flow occurring in the current back pressure condition coincides with the historical peak data flow, or the time occurring in the current back pressure condition coincides with the historical peak data time, the monitor determines that a data peak occurs in the change trend of the current data flow.
Optionally, the setting time of the data flood peak may also be queried, and if the time when the current backpressure condition occurs matches the setting time of the data flood peak, it is determined that the data flood peak occurs in the change trend of the current data volume.
The backpressure condition can be understood as that the speed of processing data by the downstream node is too low, so that the upstream node is blocked, namely, a bottleneck occurs in data processing, and the data generation speed is higher than the data processing speed. In the prior art, if a Flink back pressure condition occurs, a downstream node feeds back a data processing pressure to an upstream node, so that the upstream node reduces a data production speed.
Optionally, the data peak time may also be determined in an automatic notification manner, that is, the data peak arrival time is set in advance, and if the timing time is up, it is determined that the data peak occurs in the change trend of the data volume, and it is determined that the State update requirement is met.
Correspondingly, the implementation process of updating State according to the update mode corresponding to the determination index of the data flood peak in step S103 may include: under the condition that the data flood peak comprises a rising trend, obtaining the capacity expansion amount corresponding to the historical flood peak data flow and the growth ratio corresponding to the historical flood peak data flow, determining the predicted capacity expansion amount corresponding to the predicted flood peak data flow according to the capacity expansion amount and the growth ratio, and expanding the capacity of the current State based on the predicted capacity expansion amount. Optionally, since the historical peak data traffic may be determined simultaneously when the expansion capacity and the growth ratio corresponding to the historical peak data traffic are obtained, when the predicted expansion capacity corresponding to the predicted peak data traffic is determined, the predicted peak data traffic may be determined based on the historical peak data traffic and the corresponding growth ratio. For example, when the data traffic is in an ascending trend and needs to be expanded, if the historical peak data traffic of the last year is 1000, the corresponding expansion capacity is 10 nodes, and the increase ratio of the historical peak data traffic is 100%, the predicted peak data traffic of this year is 2000, and the predicted expansion capacity corresponding to the predicted peak data traffic is 20 nodes, then 20 nodes may be expanded on the basis of the current expansion State capacity according to the determined predicted expansion capacity.
And if the data flow in the data flood peak is reduced to the data flow fluctuation range, namely the data flood peak disappears, reducing the capacity of the State after capacity expansion to the capacity of the State before capacity expansion.
Optionally, in the case that the flag is monitored to have the backpressure for a certain period of time, the State may be expanded proportionally. For example, if the Flink back pressure occurs and the data processing speed is slow, 1/2 of the current State may be expanded until the data back pressure disappears, and the capacity of the State after expansion is reduced to the capacity of the State before expansion.
Fig. 6 is a schematic structural diagram of a state storage updating apparatus according to an embodiment of the present application, and as shown in fig. 6, the apparatus may include: an acquisition module 601, a judgment module 602 and an update module 603;
the acquisition module is used for acquiring a judgment index of data in the State, wherein the judgment index comprises at least one of a data State, a data query frequency and a data peak, and the data query frequency comprises a query frequency of at least one data attribute of data to be queried;
the judging module is used for determining whether the State meets the updating requirement according to the judging condition corresponding to the judging index;
and the updating module is used for updating the State according to the updating mode corresponding to the judgment index under the condition that the State meets the updating requirement.
In one example, in the case that the data State includes an initialization State and an update State, the determining module is configured to determine that the update requirement of State is not reached;
the updating module is used for updating the data corresponding to the data State to the State;
and under the condition that the data State comprises a completion State, the judging module is used for determining that the update requirement of State is met.
Optionally, the updating module is configured to merge data corresponding to the data state with data before the data to obtain integrated data;
and synchronizing the integrated data to other nodes for storage, and deleting the integrated data from the State.
In an example, the determining module may further include an obtaining unit and a determining unit;
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring the query frequency of at least one data attribute of data to be queried;
the determining unit is used for determining that the update requirement of the State is not met under the condition that the query times of all the data attributes in at least one data attribute are greater than or equal to the disk flash threshold value within the preset time;
and determining that the update requirement of State is met under the condition that the query times of any data attribute in at least one data attribute is smaller than the flash threshold of the disk within the preset time.
Optionally, the updating module is configured to flush the data to be checked to the disk, and delete the data to be checked from the State.
In one example, the judging module includes an acquiring unit and a determining unit;
the acquiring unit is used for acquiring the variation trend of the data flow within a preset time length;
the determining unit is used for determining that the update requirement of the State is not met if the change trend does not include the data flood peak within the preset time length;
and in a preset time length, if the change trend comprises a data peak and the data peak time is consistent with the historical data peak time, determining that the update requirement of State is met;
the data flood peak comprises a data flow exceeding the maximum value of the fluctuation range of the data flow, wherein the data flow has a change trend which is an ascending trend and is longer than the time length of the first proportion in a preset time length, and/or the data flow has a change trend which is a descending trend and is longer than the time length of the second proportion in the preset time length exceeds the maximum value of the fluctuation range of the data flow.
Optionally, the updating module may include an obtaining unit, a determining unit, and an updating unit;
the acquisition unit is used for acquiring the expansion capacity and the growth ratio corresponding to the historical peak data flow under the condition that the data peak comprises a rising trend;
the determining unit is used for determining the predicted expansion capacity corresponding to the predicted flood peak data flow according to the expansion capacity and the growth ratio;
the updating unit is used for expanding the capacity of the current State according to the predicted expansion capacity;
and reducing the capacity of the State after capacity expansion to the capacity of the State before capacity expansion under the condition that the data flow in the data flood peak is reduced to the data flow fluctuation range.
The state storage updating device can execute the state storage updating method provided by the figures 1-5, and has corresponding devices and beneficial effects in the method.
Fig. 7 is a schematic structural diagram of a computer apparatus according to embodiment 7 of the present invention, as shown in fig. 7, the computer apparatus includes a controller 701, a memory 702, an input device 703, and an output device 704; the number of the controllers 701 in the computer device may be one or more, and one controller 701 is taken as an example in fig. 7; the controller 701, the memory 702, the input device 703 and the output device 704 in the computer apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 7.
The memory 702 is used as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the updating method of the state storage in the embodiments of fig. 1-5 (e.g., the obtaining module 601, the determining module 602, and the updating module 603 in the updating device of the state storage). The controller 701 executes various functions of the computer device and data processing by executing software programs, instructions, and modules stored in the memory 702, that is, implements the above-described update method of the state storage.
The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the computer, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 702 may further include memory located remotely from the controller 701, which may be connected to a terminal/server through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 703 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 704 may include a display device such as a display screen.
Embodiments of the present application also provide a storage medium containing computer-executable instructions for performing a method for updating a state store when executed by a computer controller, the method comprising the steps shown in fig. 1.
From the above description of the embodiments, it is obvious for those skilled in the art that the present application can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods described in the embodiments of the present application.
It should be noted that the modules included in the apparatus for sorting packages are only divided according to the functional logic, but are not limited to the above-mentioned division manner as long as the corresponding functions can be realized, and are not used to limit the scope of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. A method for updating a state store, comprising:
acquiring a judgment index of data in a State storage State, wherein the judgment index comprises at least one of a data State, a data query frequency and a data peak, and the data query frequency comprises a query frequency of at least one data attribute of data to be queried;
determining whether the State meets the updating requirement according to the judgment condition corresponding to the judgment index;
and under the condition that the State reaches the updating requirement, updating the State according to the updating mode corresponding to the judgment index.
2. The method of claim 1, wherein in a case that the determination indicator includes a data State, the determining whether the State meets an update requirement according to a determination condition corresponding to the determination indicator includes:
under the condition that the data State comprises an initialization State and an updating State, determining that the updating requirement of the State is not met, and updating the data corresponding to the data State into the State;
determining that an update requirement of the State is reached if the data State comprises a completion State.
3. The method of claim 1, wherein in the case that the determination indicator includes a data query frequency, the determining whether the State meets an update requirement according to a determination condition corresponding to the determination indicator includes:
acquiring the query frequency of at least one data attribute of the data to be queried;
in a preset time, under the condition that the query times of all data attributes in the at least one data attribute are greater than or equal to a disk flash threshold, determining that the update requirement of the State is not met;
and in a preset time, determining that the update requirement of the State is met under the condition that the query frequency of any data attribute in the at least one data attribute is less than the disk flash threshold.
4. The method of claim 1, wherein in a case that the determination index includes a data flood peak, the determining whether the State meets an update requirement according to a determination condition corresponding to the determination index includes:
acquiring the variation trend of data flow within a preset time length;
within a preset time length, if the change trend does not include a data flood peak, determining that the update requirement of the State is not met;
within a preset time length, if the change trend comprises a data peak, and the data peak time is consistent with the historical data peak time, determining that the update requirement of the State is met;
the data flood peak comprises the data flow of which the variation trend is an ascending trend and the time length which is greater than the first proportion in the preset time length exceeds the maximum value of the fluctuation range of the data flow, and/or the data flow of which the variation trend is a descending trend and the time length which is greater than the second proportion in the preset time length exceeds the maximum value of the fluctuation range of the data flow.
5. The method according to claim 1 or 2, wherein updating the State according to the update mode corresponding to the determination index comprises:
merging the data corresponding to the data state with the data before the data to obtain integrated data;
and synchronizing the integrated data to other nodes for storage, and deleting the integrated data from the State.
6. The method according to claim 1 or 3, wherein updating the State according to the updating manner corresponding to the judgment index comprises:
and flushing the data to be checked into a disk, and deleting the data to be checked from the State.
7. The method according to claim 1 or 4, wherein updating the State according to the updating manner corresponding to the judgment index comprises:
under the condition that the data flood peak comprises a rising trend, acquiring the expansion capacity and the growth ratio corresponding to the historical flood peak data flow;
determining a predicted capacity expansion corresponding to the predicted flood peak data flow according to the capacity expansion and the growth ratio;
expanding the capacity of the current State according to the predicted expansion capacity;
and under the condition that the data flow in the data flood peak is reduced to the data flow fluctuation range, reducing the capacity of the State after capacity expansion to the capacity of the State before capacity expansion.
8. An apparatus for updating a state store, comprising:
the acquisition module is used for acquiring judgment indexes of data in a State storage State, wherein the judgment indexes comprise at least one of a data State, a data query frequency and a data flood peak, and the data query frequency comprises a query frequency of at least one data attribute of data to be queried;
the judging module is used for determining whether the State meets the updating requirement according to the judging condition corresponding to the judging index;
and the updating module is used for updating the State according to the updating mode corresponding to the judgment index under the condition that the State reaches the updating requirement.
9. A computer device, comprising: memory, processor and computer program stored on the memory and executable on the processor, which when executed by the processor implements the method of updating a state store according to any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of updating a state store according to any one of claims 1 to 7.
CN202111301758.5A 2021-11-04 2021-11-04 State storage updating method, device, equipment and storage medium Pending CN114048228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111301758.5A CN114048228A (en) 2021-11-04 2021-11-04 State storage updating method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111301758.5A CN114048228A (en) 2021-11-04 2021-11-04 State storage updating method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114048228A true CN114048228A (en) 2022-02-15

Family

ID=80207281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111301758.5A Pending CN114048228A (en) 2021-11-04 2021-11-04 State storage updating method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114048228A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668455A (en) * 2023-07-28 2023-08-29 深圳博瑞天下科技有限公司 Multi-block-chain-oriented platform node data management method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668455A (en) * 2023-07-28 2023-08-29 深圳博瑞天下科技有限公司 Multi-block-chain-oriented platform node data management method and system
CN116668455B (en) * 2023-07-28 2023-10-10 深圳博瑞天下科技有限公司 Multi-block-chain-oriented platform node data management method and system

Similar Documents

Publication Publication Date Title
CN109947668B (en) Method and device for storing data
CN105068864A (en) Method and system for processing asynchronous message queue
CN111782692B (en) Frequency control method and device
CN107016039B (en) Database writing method and database system
US9922133B2 (en) Live topological query
CN111723073B (en) Data storage processing method, device, processing system and storage medium
CN110875885B (en) Message processing method, server, terminal, system and storage medium
CN111125013B (en) Data warehousing method, device, equipment and medium
CN111949389B (en) Slurm-based information acquisition method and device, server and computer-readable storage medium
CN113515545A (en) Data query method, device, system, electronic equipment and storage medium
CN112685394A (en) Real-time threat information correlation method, device and system based on Flink
CN114048228A (en) State storage updating method, device, equipment and storage medium
CN111913793A (en) Distributed task scheduling method, device, node equipment and system
CN113568938A (en) Data stream processing method and device, electronic equipment and storage medium
CN114490160A (en) Method, device, equipment and medium for automatically adjusting data tilt optimization factor
CN112541119B (en) Efficient and energy-saving small recommendation system
CN113254445A (en) Real-time data storage method and device, computer equipment and storage medium
CN111049898A (en) Method and system for realizing cross-domain architecture of computing cluster resources
CN116185578A (en) Scheduling method of computing task and executing method of computing task
CN114328683A (en) Data import method, device, equipment and storage medium
US11372832B1 (en) Efficient hashing of data objects
CN114401207A (en) Positioning method and device for communication abnormal terminal equipment and electronic equipment
CN111125161A (en) Real-time data processing method, device, equipment and storage medium
CN111737026A (en) Multithreading message processing method based on lookup operation
CN109739883A (en) Promote the method, apparatus and electronic equipment of data query performance

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