Movatterモバイル変換


[0]ホーム

URL:


CN113760984A - Data processing method and device, electronic equipment and computer readable medium - Google Patents

Data processing method and device, electronic equipment and computer readable medium
Download PDF

Info

Publication number
CN113760984A
CN113760984ACN202110075949.8ACN202110075949ACN113760984ACN 113760984 ACN113760984 ACN 113760984ACN 202110075949 ACN202110075949 ACN 202110075949ACN 113760984 ACN113760984 ACN 113760984A
Authority
CN
China
Prior art keywords
data processing
data
processed
cache
identifier
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
CN202110075949.8A
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 Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co LtdfiledCriticalBeijing Jingdong Century Trading Co Ltd
Priority to CN202110075949.8ApriorityCriticalpatent/CN113760984A/en
Publication of CN113760984ApublicationCriticalpatent/CN113760984A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本公开的实施例公开了数据处理方法、装置、电子设备和计算机可读介质。该方法的一具体实施方式包括:响应于应用程序启动,在缓存中生成对应上述应用程序的缓存数据处理关系表,上述缓存数据处理关系表包含了上述应用程序的数据处理方法标识和对应上述应用程序的数据库中的待处理数据标识,上述数据处理方法标识和待处理数据标识具有对应关系;响应于检测到对应上述应用程序的目标数据处理方法,基于上述目标数据处理方法和缓存数据处理关系表对缓存中对应上述应用程序的数据进行数据处理。该实施方式使得数据处理效率有所提高,应进而减低了无效数据带来的数据处理错误。

Figure 202110075949

Embodiments of the present disclosure disclose data processing methods, apparatuses, electronic devices, and computer-readable media. A specific implementation of the method includes: in response to application startup, generating a cache data processing relationship table corresponding to the application program in the cache, and the cache data processing relationship table includes the data processing method identifier of the application program and the corresponding application program. The identifier of the data to be processed in the database of the program, the identifier of the above-mentioned data processing method and the identifier of the data to be processed have a corresponding relationship; in response to detecting the target data processing method corresponding to the above-mentioned application program, based on the above-mentioned target data processing method and the cached data processing relationship table Data processing is performed on the data corresponding to the above application in the cache. This embodiment improves the data processing efficiency, and further reduces data processing errors caused by invalid data.

Figure 202110075949

Description

Data processing method and device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a computer-readable medium.
Background
When data is processed, data in a database is generally required to be called into a cache, and an application program directly processes the data in the cache, so that the data processing efficiency can be improved. The application program can perform a plurality of different types of data processing on the data in the cache, and these different types of data processing may cause the data in the cache to change, and further the following problems may occur:
firstly, invalid data in the cache occupies the cache space, and the data processing efficiency is reduced;
secondly, after the data change, the cache data is asynchronous with the database data, and data processing errors occur.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose data processing methods, apparatuses, electronic devices, and computer readable media to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a data processing method, including: responding to the starting of an application program, generating a cache data processing relation table corresponding to the application program in a cache, wherein the cache data processing relation table comprises a data processing method identifier of the application program and a to-be-processed data identifier in a database corresponding to the application program, and the data processing method identifier and the to-be-processed data identifier have a corresponding relation; and in response to detecting the target data processing method corresponding to the application program, performing data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table.
In a second aspect, some embodiments of the present disclosure provide a data processing apparatus comprising: a cache data processing relation table generating unit configured to generate a cache data processing relation table corresponding to an application program in a cache in response to the start of the application program, where the cache data processing relation table includes a data processing method identifier of the application program and a to-be-processed data identifier in a database corresponding to the application program, and the data processing method identifier and the to-be-processed data identifier have a corresponding relationship; and the data processing unit is configured to respond to the detection of the target data processing method corresponding to the application program, and perform data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: the data processing method of some embodiments of the present disclosure processes data of an application program, so that data processing efficiency is improved. Specifically, the reason why the data processing efficiency is not high is that: in the process of processing data by the application program, invalid data in the cache cannot be processed in time. Based on this, in the data processing method of some embodiments of the present disclosure, the data to be processed in the cache may be processed differently according to the type of the data processing method. And the data to be processed in the cache is processed differently according to the type of the data processing method, so that the data to be processed in the cache can be changed according to the type of the data processing method, and invalid data to be processed in the cache can be deleted in time. Therefore, the data processing efficiency is improved, and data processing errors caused by invalid data are reduced.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
Fig. 1 is a schematic diagram of an application scenario of a data processing method of some embodiments of the present disclosure;
FIG. 2 is a schematic diagram of a cache data handling relationship table corresponding to FIG. 1;
FIG. 3 is a flow diagram of some embodiments of a data processing method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of a data processing method according to the present disclosure;
FIG. 5 is a flow diagram of further embodiments of data processing methods according to the present disclosure;
FIG. 6 is a schematic block diagram of some embodiments of a data processing apparatus according to the present disclosure;
FIG. 7 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of a data processing method according to some embodiments of the present disclosure.
As shown in fig. 1, after the application program on the electronic device 101 is started, the electronic device 101 may set an automatic cache between the business logic layer and the database layer. The automatic caching may include a number of modules including cache interceptors, cache configuration, SQL (Structured Query Language) parsing, transaction processing, and caching services. The cache interceptor can be used for intercepting SQL of the database, automatically finishing data caching on the SQL of the database query method type and reducing the pressure of the database; the SQL of the database change method type automatically completes the clarity of the data in the cache. The cache configuration can be used for storing the data processing method identifier in the SQL and the corresponding to-be-processed data identifier, and the configuration of the configuration center can support local configuration and external configuration. The SQL parsing may be used to parse an SQL statement so as to parse information such as a data processing method identifier, a keyword, and a to-be-processed data identifier from the SQL statement. Transaction processing may be used to detect the status of transactions for related data. The caching service may define a caching interface and a related concurrency control interface, may configure an external cache as a memory implementation of the electronic device 101, and so on. After the electronic device 101 performs automatic caching, a cache data processing relation table may be obtained, as shown in the schematic diagram of the cache data processing relation table in fig. 2. The cache data processing relationship Table in fig. 2 may include data processing method identifiers (e.g., SelectMethod-1 and SelectMethod-2 in fig. 2) and to-be-processed data identifiers (e.g., Table-1, Table-2, and Table-3 in fig. 2). The data processing method identifier and the data identifier to be processed may correspond to the database query method and the database modification method in fig. 2, respectively.
After that, the electronic device 101 may perform data processing on the data corresponding to the application program in the cache according to the received target data processing method related to the application program and the cache data processing relation table in fig. 2. And in the data processing process of the target data processing method which is the database query method, the data to be processed corresponding to the data identifier to be processed is kept unchanged. In the data processing process of the target data processing method which is the database changing method, the data to be processed corresponding to the data identifier to be processed is modified in various ways, so that the data to be processed in the cache is different from the data to be processed in the database. Therefore, when the database change method processes data, the electronic device 101 may directly delete the corresponding to-be-processed data in the cache. Therefore, the data processing efficiency is improved, the changed data in the cache can be deleted in time, and the data processing error is avoided.
It should be understood that the number of electronic devices 101 in fig. 1 is merely illustrative. There may be any number of electronic devices 101, as desired for implementation.
With continued reference to fig. 3, fig. 3 illustrates aflow 300 of some embodiments of a data processing method according to the present disclosure. The data processing method comprises the following steps:
step 301, responding to the application program starting, generating a cache data processing relation table corresponding to the application program in the cache.
In some embodiments, an execution subject of the data processing method (e.g., the electronic device 101 shown in fig. 1) may detect whether the application program is started through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G/5G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
When detecting that the application program is started, the execution main body can scan and analyze various data processing methods of the application program to the database, and further generate a cache data processing relation table in the cache. The cache data processing relation table comprises the data processing method identification of the application program and the identification of the data to be processed in the database corresponding to the application program. The data processing method identifier and the to-be-processed data identifier have a corresponding relationship, and the generated cache data processing relationship table may be as shown in fig. 2.
Step 302, in response to detecting the target data processing method corresponding to the application program, performing data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table.
In some embodiments, on the basis of obtaining the cache data processing relationship table, the execution main body may receive a target data processing method in an application program data processing process, and perform data processing on data corresponding to the application program in the cache through the target data processing method and the cache data processing relationship table. As can be seen from the above description, different target data processing methods may obtain corresponding data to be processed through the cache data processing relation table, or delete corresponding data to be processed, so as to avoid data processing errors, and at the same time, improve data processing efficiency.
The data processing method disclosed by some embodiments of the disclosure processes data of an application program, so that the data processing efficiency is improved. Specifically, the reason why the data processing efficiency is not high is that: in the process of processing data by the application program, invalid data in the cache cannot be processed in time. Based on this, in the data processing method of some embodiments of the present disclosure, the data to be processed in the cache may be processed differently according to the type of the data processing method. And the data to be processed in the cache is processed differently according to the type of the data processing method, so that the data to be processed in the cache can be changed according to the type of the data processing method, and invalid data to be processed in the cache can be deleted in time. Therefore, the data processing efficiency is improved, and data processing errors caused by invalid data are reduced.
With continued reference to fig. 4, fig. 4 illustrates aflow 400 of some embodiments of a data processing method according to the present disclosure. The data processing method comprises the following steps:
step 401, in response to the application program starting, querying a data processing method identifier of the data processing method of the application program and a to-be-processed data identifier of to-be-processed data corresponding to the data processing method.
In some embodiments, an execution subject of the data processing method (for example, the electronic device 101 shown in fig. 1) may query, when detecting the start of the application program, a data processing method identifier of the data processing method of the application program and a to-be-processed data identifier of to-be-processed data corresponding to the data processing method. Specifically, when the application program is started, the execution main body may query various data processing methods of the application program on the database. Generally, various data processing methods are used for processing specified data to be processed, and correspond to data to be processed identifiers including the data to be processed. The execution subject may query a data processing method identification of the data processing method and a to-be-processed data identification of the to-be-processed data.
In some optional implementation manners of some embodiments, the data processing method includes a data processing statement, where the data processing statement includes a data processing method identifier, a keyword, and a to-be-processed data identifier, and the keyword and the to-be-processed data identifier have a corresponding positional relationship, and; the querying of the data processing method identifier of the data processing method of the application program and the to-be-processed data identifier of the to-be-processed data corresponding to the data processing method may include the following steps:
firstly, matching the data processing method identification of the data processing statement through a preset data processing method identification table.
Applications typically perform data processing through data processing statements. The data processing statement may include a data processing method identifier, a keyword, and a to-be-processed data identifier. As shown in FIG. 2, the data processing method identification may be "SelectMethod-1"; the keyword may be "from"; the data identifier to be processed can be Table-1, Table-2 and Table-3. Accordingly, the executing entity may first match the data processing method identifier of the data processing statement through a preset data processing method identifier table. The preset data processing method identification table may include all data processing method identifications of the application program.
And secondly, matching keywords of the data processing statement through a preset keyword table, and determining a to-be-processed data identifier based on a position relation corresponding to the keywords.
Typically, the key is then identified for the data to be processed. The execution main body can match the keywords of the data processing statement through a preset keyword table, and then determine the identifier of the data to be processed based on the position relation corresponding to the keywords. The cache data processing relation table may be obtained by analyzing a data processing method when a program is started.
Step 402, generating the cache data processing relation table in the cache based on the data processing method identifier and the to-be-processed data identifier.
After the data processing method identifier and the to-be-processed data identifier are obtained, the execution main body may generate the cache data processing relationship table in the cache according to the correspondence between the data processing method identifier and the to-be-processed data identifier.
Step 403, in response to that the target data processing method is a database change method, matching the database change method with the data processing method identifier in the cache data processing relation table.
When the execution subject detects that the target data processing method is the database change method, the database change method may be matched with the data processing method identifier in the cache data processing relationship table. Wherein, the database changing method comprises at least one of the following steps: data insertion, data deletion and data updating. Taking fig. 2 as an example: the data processing method identifier corresponding to the database change method may be "DeleteMethod". "DeleteMethod" is used to operate on "Table-2". The execution subject may match the "DeleteMethod" with the data processing method identification in the cache data processing relationship table.
Step 404, in response to the successful matching, deleting the first target data to be processed corresponding to the first target data processing method identifier matched with the database change method in the cache, and performing data processing on the first target data to be processed in the database according to the database change method.
When a first target data processing method identifier corresponding to the database change method exists in the cache data processing relation table, the execution main body may further determine a first target data to be processed identifier corresponding to the first target data processing method identifier, and may further find the first target data to be processed in the cache. Namely, the first target data to be processed identifies a data processing object representing a database change method. As can be seen from the above description, when data processing is performed on the cache data processing relationship table by the database change method, if the data processing object in the cache is directly processed, the data in the cache may be inconsistent with the data in the database, and further a data processing error may occur. For this, the execution subject may delete the corresponding first target data to be processed according to the database change method. Taking fig. 2 as an example, the data processing method identifier corresponding to the database change method may be "DeleteMethod". "DeleteMethod" is used to operate on "Table-2". The execution body may delete the data corresponding to "Table-2" from the cache. Therefore, invalid cache data can be automatically cleaned according to the cache data processing relation table, the complexity of manual processing is reduced, and the possibility of manual misoperation is reduced.
In some optional implementation manners of some embodiments, before the matching, in response to the target data processing method being a database change method, the database change method with the data processing method identifier in the cache data processing relationship table, the method may include the following steps:
and step one, analyzing a data processing statement corresponding to the database change method, and determining the first target data to be processed.
Before matching with the cache data processing relation table, the execution subject may first analyze a data processing statement corresponding to the database change method to determine the first target data to be processed.
And secondly, determining a database query method identifier to be matched corresponding to the first target data to be processed from the cache data processing relation table.
After the first target data to be processed is determined, the query method identifier of the database to be matched corresponding to the first target data to be processed may be determined from the cache data processing relation table. As shown in FIG. 2, the "DeleteMethod" is used for operating "Table-2", and the query method of the database to be matched corresponding to "Table-2" in the cache data processing relation Table is identified as "SelectMethod-1". And "SelectMethod-1" operates on "Table-1" and "Table-2" simultaneously.
In some optional implementation manners of some embodiments, the matching the database change method with the data processing method identifier in the cache data processing relationship table may include the following steps:
the first step, inquiring the first state information of the data to be processed corresponding to the database inquiry method identifier to be matched.
In practice, there may be a plurality of data operations on the data to be processed, and for this reason, when the data to be processed is operated, the first state information of the data to be processed may be queried. The first state information is used to represent the current state of the data to be processed, and the first state information may include unprocessed or processed data. "unprocessed" can be used to characterize that no change has occurred to the data being processed; "in-process" may be used to characterize that the data to be processed is changing.
And step two, responding to the unprocessed state information, and matching the query method identifier of the database to be matched with the data processing method identifier in the cache data processing relation table.
When the state information is unprocessed, it indicates that no other data processing method performs data processing on the data to be processed. At this time, the execution main body may match the identifier of the database to be matched with the identifier of the data processing method in the cache data processing relation table, and then delete the first target data to be processed from the cache after determining the first target data to be processed. As can be seen from the above description, the identifier of the database query method to be matched may be "SelectMethod-1", and "SelectMethod-1" operates on "Table-1" and "Table-2" simultaneously. The first target data to be processed may be "Table-1" and "Table-2". When the database changing method is "insert method", the executing entity may delete the corresponding data in the cache according to the above steps, and directly process the data in the database.
In some optional implementation manners of some embodiments, the matching the database change method with the data processing method identifier in the cache data processing relationship table may include: and responding to the state information as processing, and executing rollback operation on the database change method.
When the state information is in process, the other data processing methods are used for performing data processing on the data to be processed. At this time, the execution subject may perform a rollback operation on the database change method to wait for the other data processing methods to complete data processing on the data to be processed before performing the database change method. Therefore, concurrent control over the cache data is realized, and error processing on the data to be processed is avoided. Meanwhile, the data to be processed can be deleted from the cache in time, so that error data generation is avoided, and the data processing efficiency is improved.
With further reference to FIG. 5, aflow 500 of further embodiments of a data processing method is shown. Theflow 500 of the data processing method includes the following steps:
step 501, responding to the application program starting, and generating a cache data processing relation table corresponding to the application program in the cache.
The content ofstep 501 is the same as that of step 201, and is not described in detail here.
Step 502, in response to the target data processing method being a database query method, matching the database query method with the data processing method identifier in the cache data processing relation table.
When the target data processing method is a database query method, the database query method does not modify the data to be processed. The execution subject may first match the database query method with the data processing method identifier in the cache data processing relationship table.
Step 503, in response to the matching success, querying a second target to-be-processed data identifier corresponding to the second target data processing method identifier matched with the database querying method.
And when the database query method exists in the cache data processing relation table, the matching is successful. The execution subject may query a second target to-be-processed data identifier corresponding to a second target data processing method identifier matched with the database query method.
Step 504, obtaining second target data to be processed corresponding to the second target data to be processed identifier from the cache, and performing data processing on the second target data to be processed according to the database query method.
After the identifier of the second target data to be processed is determined, the execution main body may search the cache for the second target data to be processed corresponding to the identifier of the second target data to be processed, and perform data processing on the second target data to be processed according to a database query method. By the database query method, automatic data caching can be realized, and the database access pressure is reduced.
In some optional implementation manners of some embodiments, the performing, in response to detecting a target data processing method corresponding to the application program, data processing on data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table may include: and responding to the situation that second target data to be processed corresponding to the second target data to be processed does not exist in the cache, inquiring the second target data to be processed from the database, and storing the second target data to be processed into the cache.
When the second target data to be processed does not exist in the cache, the second target data to be processed is not called into the cache from the database. At this time, the execution subject may query the second target data to be processed from the database, and store the second target data to be processed in the cache. And then, carrying out related data processing on the data to be processed of the second target according to a database query method.
In some optional implementations of some embodiments, the database includes dynamic pending data, and; before the matching of the database query method and the data processing method identifier in the cache data processing relation table, the method may include the following steps:
the first step, responding to the matching between the database query method and the dynamic data to be processed, querying target dynamic data to be processed corresponding to the database query method from the database, and performing data processing on the target dynamic data to be processed, otherwise, querying second state information of second target data to be processed corresponding to the database query method.
The data in the database may be fixed or may change with time or a data processing method, and the data that may change in the database is dynamic data to be processed. When the database query method is matched with the dynamic data to be processed (i.e. the database query method is used for operating the dynamic data to be processed), even if the dynamic data to be processed is already stored in the cache, since the dynamic data to be processed may change at any time, in order to avoid data processing errors, the execution main body still needs to directly query the target dynamic data to be processed corresponding to the database query method from the database, and perform data processing on the target dynamic data to be processed. When the database query method is not matched with the dynamic data to be processed, the database query method is used for processing other unchanged data in the database. At this time, the execution subject may query second state information of the second target to-be-processed data corresponding to the database query method. Wherein the second status information includes unprocessed or processed information. Here, the meanings of "unprocessed" and "in-process" are the same as those of "unprocessed" and "in-process" included in the above-described first state information.
And secondly, responding to the second state information as unprocessed, matching the database query method with the data processing method identifier in the cache data processing relation table, and otherwise, querying the second target data to be processed according to the data acquisition type of the second target data to be processed.
And when the second state information is unprocessed, indicating that the second target data to be processed is not occupied by other data processing methods. At this time, the execution subject may return to step 502 to match the database query method with the data processing method identifier in the cache data processing relation table. And when the second state information is in process, the second target data to be processed is occupied by other data processing methods. The execution subject may further query the second target data to be processed according to the data acquisition type of the second target data to be processed. The data acquisition type comprises cache query or database query.
In some optional implementations of some embodiments, before matching the database query method with the data processing method identifier in the cache data processing relationship table, the method may include: and responding to the data acquisition type of cache query, matching the database query method with the data processing method identifier in the cache data processing relation table, and otherwise, querying second target data to be processed corresponding to the database query method from the database.
When the data acquisition type is cache query, it indicates that the second target data to be processed can be directly acquired from the cache. The executing agent may return to step 502 to match the database query method with the data processing method identifier in the cache data processing relationship table. When the data acquisition type is database query, it is described that although the second target to-be-processed data is currently occupied by other data processing methods, the second target to-be-processed data may also be directly acquired from the database. Therefore, the execution subject may query the second target data to be processed corresponding to the database query method from the database. Therefore, concurrent processing of data can be realized, and improvement of data processing efficiency is facilitated.
In some optional implementation manners of some embodiments, the querying, in response to that there is no second target to-be-processed data identified by the second target to-be-processed data in the cache, the second target to-be-processed data from the database may include:
and the first step, inquiring whether second target data to be processed corresponding to the database inquiring method exists in the cache again.
When the second target to-be-processed data needs to be queried from the database, the other data processing methods may end calling the second target to-be-processed data, and the second target to-be-processed data may be called by the database querying method in the cache. At this time, the execution main body may query again whether the cache has the second target data to be processed corresponding to the database query method.
And secondly, responding to the existence, performing data processing on the second target data to be processed according to the database query method, otherwise, querying the second target data to be processed from the database, importing the second target data to be processed into a cache, and performing data processing on the second target data to be processed.
When the second target data exists, the execution subject can directly perform data processing on the second target data to be processed according to the database query method. When the second target data to be processed does not exist, the execution main body can inquire the second target data to be processed from the database, import the second target data to be processed into the cache, and perform data processing on the second target data to be processed. Therefore, the cache can be utilized to the maximum extent for data processing, and the data processing efficiency is improved.
With further reference to fig. 6, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a data processing apparatus, which correspond to those shown in fig. 3, and which may be applied in particular to various electronic devices.
As shown in fig. 6, thedata processing apparatus 600 of some embodiments includes: a cache data processing relationshiptable generating unit 601 and adata processing unit 602. The cache data processing relationshiptable generating unit 601 is configured to generate, in response to the start of an application program, a cache data processing relationship table corresponding to the application program in a cache, where the cache data processing relationship table includes a data processing method identifier of the application program and a to-be-processed data identifier in a database corresponding to the application program, and the data processing method identifier and the to-be-processed data identifier have a corresponding relationship; and thedata processing unit 602 is configured to, in response to detecting the target data processing method corresponding to the application program, perform data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table.
In an optional implementation manner of some embodiments, the cache data processing relationshiptable generating unit 601 may include: an identification query subunit (not shown in the figure) and a cache data processing relationship table generation subunit (not shown in the figure). The identifier query subunit is configured to query a data processing method identifier of the data processing method of the application program and a to-be-processed data identifier of to-be-processed data corresponding to the data processing method; and the cache data processing relation table generating subunit is configured to generate the cache data processing relation table in the cache based on the data processing method identifier and the data to be processed identifier.
In an optional implementation manner of some embodiments, the data processing method includes a data processing statement, where the data processing statement includes a data processing method identifier, a keyword, and a to-be-processed data identifier, and the keyword and the to-be-processed data identifier have a corresponding positional relationship, and; the identifying query subunit may include: the data processing method identifies a matching module (not shown in the figure) and the data to be processed identifies a matching module (not shown in the figure). The data processing method identifier matching module is configured to match a data processing method identifier of the data processing statement through a preset data processing method identifier table; and the to-be-processed data identifier matching module is configured to match keywords of the data processing statement through a preset keyword table and determine the to-be-processed data identifier based on the position relationship corresponding to the keywords.
In an optional implementation manner of some embodiments, thedata processing unit 602 may include: a first matching subunit (not shown in the figure) and a first data processing subunit (not shown in the figure). Wherein, the first matching subunit is configured to, in response to that the target data processing method is a database change method, match the database change method with the data processing method identifier in the cache data processing relation table, where the database change method includes at least one of: data insertion, data deletion and data updating; and the first data processing subunit is configured to respond to successful matching, delete a first target data to be processed identifier corresponding to the first target data processing method identifier matched with the database change method in the cache, and perform data processing on the first target data to be processed in the database according to the database change method.
In an optional implementation manner of some embodiments, thedata processing unit 602 may further include: a data processing statement parsing subunit (not shown in the figure) and a database query method identification determination subunit (not shown in the figure) to be matched. The data processing statement analysis subunit is configured to analyze the data processing statement corresponding to the database change method and determine the first target data to be processed; and the database query method identifier to be matched determining subunit is configured to determine the database query method identifier to be matched corresponding to the first target data to be processed from the cache data processing relation table.
In an optional implementation manner of some embodiments, the first matching subunit may include: the first state information query module (not shown) and the first database query method to be matched identify the matching module (not shown). The first state information query module is configured to query first state information of to-be-processed data corresponding to the to-be-matched database query method identifier, wherein the first state information comprises unprocessed or processed data; and the first database query method identifier matching module to be matched is configured to respond to the condition information as unprocessed, and match the database query method identifier to be matched with the data processing method identifier in the cache data processing relation table.
In an optional implementation manner of some embodiments, the first matching subunit may include: and a second database query method identifier matching module (not shown) configured to perform a rollback operation on the database change method in response to the status information being in process.
In an optional implementation manner of some embodiments, thedata processing unit 602 may include: a second matching subunit (not shown in the figure), a second target to-be-processed data identification matching subunit (not shown in the figure), and a second data processing subunit (not shown in the figure). The second matching subunit is configured to, in response to the target data processing method being a database query method, match the database query method with the data processing method identifier in the cache data processing relation table; the second target data to be processed identification matching subunit is configured to respond to the matching success and query a second target data to be processed identification corresponding to a second target data processing method identification matched with the database query method; and the second data processing subunit is configured to acquire second target data to be processed corresponding to the second target data to be processed identifier from the cache, and perform data processing on the second target data to be processed according to the database query method.
In an optional implementation manner of some embodiments, thedata processing unit 602 may include: and a third data processing subunit (not shown in the figure), configured to, in response to that there is no second target to-be-processed data corresponding to the second target to-be-processed data identifier in the cache, query the second target to-be-processed data from the database, and store the second target to-be-processed data in the cache.
In an alternative implementation of some embodiments, the database includes dynamic pending data, and; thedata processing unit 602 may include: a dynamic pending data matching subunit (not shown in the figure) and a third matching subunit (not shown in the figure). A dynamic data matching subunit configured to, in response to the database query method being matched with the dynamic data to be processed, query target dynamic data to be processed corresponding to the database query method from the database, and perform data processing on the target dynamic data to be processed, otherwise, query second state information of second target data to be processed corresponding to the database query method, where the second state information includes unprocessed or processed data; and the third matching subunit is configured to, in response to that the second state information is unprocessed, match the database query method with the data processing method identifier in the cache data processing relation table, and otherwise, query the second target data to be processed according to a data acquisition type of the second target data to be processed, where the data acquisition type includes cache query or database query.
In an optional implementation manner of some embodiments, thedata processing unit 602 may include: and a fourth matching subunit (not shown in the figure), configured to, in response to that the data acquisition type is cache query, match the database query method with the data processing method identifier in the cache data processing relation table, and otherwise, query, from the database, second target data to be processed corresponding to the database query method.
In an optional implementation manner of some embodiments, the third data processing subunit may include: a secondary query module (not shown) and a data processing module (not shown). The secondary query module is configured to query whether second target data to be processed corresponding to the database query method exists in the cache again; and the data processing module is configured to respond to the existence, perform data processing on the second target data to be processed according to the database query method, and otherwise, query the second target data to be processed from the database, import the second target data to be processed into a cache, and perform data processing on the second target data to be processed.
It will be understood that the elements described in theapparatus 600 correspond to various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to theapparatus 600 and the units included therein, and are not described herein again.
As shown in fig. 7,electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded fromstorage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of theelectronic apparatus 700 are also stored. Theprocessing device 701, theROM 702, and the RAM703 are connected to each other by abus 704. An input/output (I/O)interface 705 is also connected tobus 704.
Generally, the following devices may be connected to the I/O interface 705:input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; anoutput device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like;storage 708 including, for example, magnetic tape, hard disk, etc.; and acommunication device 709. The communication means 709 may allow theelectronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates anelectronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via communications means 709, or may be installed fromstorage 708, or may be installed fromROM 702. The computer program, when executed by theprocessing device 701, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to the starting of an application program, generating a cache data processing relation table corresponding to the application program in a cache, wherein the cache data processing relation table comprises a data processing method identifier of the application program and a to-be-processed data identifier in a database corresponding to the application program, and the data processing method identifier and the to-be-processed data identifier have a corresponding relation; and in response to detecting the target data processing method corresponding to the application program, performing data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a cache data processing relationship table generating unit and a data processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the cache data processing relationship table generation unit may also be described as "a unit that generates a cache data processing relationship table in a cache".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (15)

1. A method of data processing, comprising:
responding to the starting of an application program, generating a cache data processing relation table corresponding to the application program in a cache, wherein the cache data processing relation table comprises a data processing method identifier of the application program and a to-be-processed data identifier in a database corresponding to the application program, and the data processing method identifier and the to-be-processed data identifier have a corresponding relation;
and in response to detecting a target data processing method corresponding to the application program, performing data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table.
2. The method of claim 1, wherein the generating a cache data processing relationship table in the cache corresponding to the application comprises:
inquiring a data processing method identifier of the data processing method of the application program and a to-be-processed data identifier of to-be-processed data corresponding to the data processing method;
and generating the cache data processing relation table in the cache based on the data processing method identifier and the to-be-processed data identifier.
3. The method according to claim 2, wherein the data processing method comprises a data processing statement, the data processing statement comprises a data processing method identifier, a keyword and a to-be-processed data identifier, the keyword and the to-be-processed data identifier have a corresponding positional relationship, and;
the querying of the data processing method identifier of the data processing method of the application program and the to-be-processed data identifier of the to-be-processed data corresponding to the data processing method includes:
matching a data processing method identifier of the data processing statement through a preset data processing method identifier table;
and matching keywords of the data processing statement through a preset keyword table, and determining a to-be-processed data identifier based on a position relation corresponding to the keywords.
4. The method of claim 3, wherein the performing data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table in response to detecting the target data processing method corresponding to the application program comprises:
in response to the target data processing method being a database change method, matching the database change method with the data processing method identifier in the cache data processing relationship table, the database change method including at least one of: data insertion, data deletion and data updating;
and in response to successful matching, deleting the first target data to be processed corresponding to the first target data processing method identification matched with the database change method in the cache, and performing data processing on the first target data to be processed in the database according to the database change method.
5. The method of claim 4, wherein prior to said matching the database change method with the data processing method identification in the cached data processing relationship table in response to the target data processing method being a database change method, comprising:
analyzing a data processing statement corresponding to the database change method, and determining the first target data to be processed;
and determining the query method identifier of the database to be matched corresponding to the first target data to be processed from the cache data processing relation table.
6. The method of claim 5, wherein said matching the database change method with a data processing method identification in the cached data processing relationship table comprises:
inquiring first state information of the to-be-processed data corresponding to the to-be-matched database inquiry method identifier, wherein the first state information comprises unprocessed or processed data;
and responding to the unprocessed state information, and matching the query method identifier of the database to be matched with the data processing method identifier in the cache data processing relation table.
7. The method of claim 5, wherein said matching the database change method with a data processing method identification in the cached data processing relationship table comprises:
and responding to the state information as processing, and executing rollback operation on the database change method.
8. The method of claim 1, wherein the performing data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table in response to detecting the target data processing method corresponding to the application program comprises:
responding to the target data processing method being a database query method, and matching the database query method with the data processing method identification in the cache data processing relation table;
responding to the matching success, and inquiring a second target data to be processed identification corresponding to a second target data processing method identification matched with the database inquiry method;
and acquiring second target data to be processed corresponding to the second target data to be processed identifier from a cache, and performing data processing on the second target data to be processed according to the database query method.
9. The method of claim 8, wherein the performing data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relationship table in response to detecting the target data processing method corresponding to the application program comprises:
and responding to the situation that second target data to be processed corresponding to the second target data to be processed does not exist in the cache, inquiring the second target data to be processed from the database, and storing the second target data to be processed to the cache.
10. The method of claim 8, wherein the database includes dynamic pending data, and;
before the matching of the database query method with the data processing method identifier in the cache data processing relation table, the method comprises the following steps:
responding to the matching of the database query method and the dynamic data to be processed, querying target dynamic data to be processed corresponding to the database query method from the database, and performing data processing on the target dynamic data to be processed, otherwise, querying second state information of second target data to be processed corresponding to the database query method, wherein the second state information comprises unprocessed or processed data;
and responding to the second state information as unprocessed, matching the database query method with the data processing method identifier in the cache data processing relation table, otherwise, querying the second target data to be processed according to the data acquisition type of the second target data to be processed, wherein the data acquisition type comprises cache query or database query.
11. The method of claim 10, wherein prior to said matching said database query method with a data processing method identification in said cached data processing relationship table, comprising:
and responding to the data acquisition type of cache query, matching the database query method with the data processing method identifier in the cache data processing relation table, and otherwise, querying second target data to be processed corresponding to the database query method from the database.
12. The method of claim 10, wherein the querying the database for the second target pending data in response to the absence of the second target pending data identified for the second target pending data in the cache comprises:
inquiring whether second target data to be processed corresponding to the database inquiry method exists in the cache again;
and responding to the existence, performing data processing on the second target data to be processed according to the database query method, otherwise, querying the second target data to be processed from the database, importing the second target data to be processed into a cache, and performing data processing on the second target data to be processed.
13. A data processing apparatus comprising:
the cache data processing relation table generating unit is configured to respond to starting of an application program, and generate a cache data processing relation table corresponding to the application program in a cache, wherein the cache data processing relation table comprises a data processing method identifier of the application program and a to-be-processed data identifier in a database corresponding to the application program, and the data processing method identifier and the to-be-processed data identifier have a corresponding relation;
and the data processing unit is configured to respond to the detection of the target data processing method corresponding to the application program, and perform data processing on the data corresponding to the application program in the cache based on the target data processing method and the cache data processing relation table.
14. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-12.
15. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1 to 12.
CN202110075949.8A2021-01-202021-01-20Data processing method and device, electronic equipment and computer readable mediumPendingCN113760984A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110075949.8ACN113760984A (en)2021-01-202021-01-20Data processing method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110075949.8ACN113760984A (en)2021-01-202021-01-20Data processing method and device, electronic equipment and computer readable medium

Publications (1)

Publication NumberPublication Date
CN113760984Atrue CN113760984A (en)2021-12-07

Family

ID=78786386

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110075949.8APendingCN113760984A (en)2021-01-202021-01-20Data processing method and device, electronic equipment and computer readable medium

Country Status (1)

CountryLink
CN (1)CN113760984A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115168388A (en)*2022-05-202022-10-11中国银行股份有限公司 A method and device for generating reverse SQL statement

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106815329A (en)*2016-12-292017-06-09网易无尾熊(杭州)科技有限公司A kind of data cached update method and device
CN109543080A (en)*2018-12-042019-03-29北京字节跳动网络技术有限公司A kind of caching data processing method, device, electronic equipment and storage medium
CN111506603A (en)*2020-04-232020-08-07上海达梦数据库有限公司Data processing method, device, equipment and storage medium
WO2020211570A1 (en)*2019-04-192020-10-22深圳前海微众银行股份有限公司Cache processing method and device, equipment, and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106815329A (en)*2016-12-292017-06-09网易无尾熊(杭州)科技有限公司A kind of data cached update method and device
CN109543080A (en)*2018-12-042019-03-29北京字节跳动网络技术有限公司A kind of caching data processing method, device, electronic equipment and storage medium
WO2020211570A1 (en)*2019-04-192020-10-22深圳前海微众银行股份有限公司Cache processing method and device, equipment, and computer readable storage medium
CN111506603A (en)*2020-04-232020-08-07上海达梦数据库有限公司Data processing method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115168388A (en)*2022-05-202022-10-11中国银行股份有限公司 A method and device for generating reverse SQL statement

Similar Documents

PublicationPublication DateTitle
CN111858518B (en)Method and device for updating reference document, electronic equipment and storage medium
CN111198751B (en)Service processing method and device
CN110909022A (en) A data query method and device
CN111881216A (en)Data acquisition method and device based on shared template
CN112948138A (en)Method and device for processing message
CN114637703A (en) Data access apparatus, method, readable medium and electronic device
CN112948409A (en)Data processing method and device, electronic equipment and storage medium
CN111309366B (en)Method, device, medium and electronic equipment for managing registration core
CN112099982A (en)Collapse information positioning method, device, medium and electronic equipment
CN113760984A (en)Data processing method and device, electronic equipment and computer readable medium
CN111241137A (en)Data processing method and device, electronic equipment and storage medium
CN114461247A (en) Hot update method, apparatus, electronic device and computer readable medium
CN113220281A (en)Information generation method and device, terminal equipment and storage medium
CN112286773A (en)Method, device, medium and electronic equipment for collecting crash information
CN111580890A (en)Method, apparatus, electronic device, and computer-readable medium for processing features
CN113342837B (en)Data transmission method, device, electronic equipment and computer readable medium
CN115934375A (en) An information processing method, device, electronic device, and computer-readable medium
CN113760960B (en) Information generating method, device and device for generating information
CN116975012A (en)File synchronization method, file updating method, device, electronic equipment and medium
CN114785770A (en)Mirror layer file sending method and device, electronic equipment and computer readable medium
CN114115941A (en) Resource sending method, page rendering method, apparatus, electronic device and medium
CN113971192A (en) Data processing method, apparatus, readable medium and electronic device
CN113742076A (en)Method, device, equipment, server and medium for acquiring data resources
CN112732457A (en)Image transmission method, image transmission device, electronic equipment and computer readable medium
CN113778850A (en)Data processing method and device, electronic equipment and computer readable medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp