CN113704242A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN113704242A
CN113704242A CN202010429902.2A CN202010429902A CN113704242A CN 113704242 A CN113704242 A CN 113704242A CN 202010429902 A CN202010429902 A CN 202010429902A CN 113704242 A CN113704242 A CN 113704242A
Authority
CN
China
Prior art keywords
data
processed
type
processing
target method
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
CN202010429902.2A
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 Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010429902.2A priority Critical patent/CN113704242A/en
Publication of CN113704242A publication Critical patent/CN113704242A/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/454Multi-language systems; Localisation; Internationalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method and device, and relates to the technical field of computers. One embodiment of the method comprises: receiving access data, determining the current language type of the access data, and acquiring the access data of which the current language type is a non-local language; obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method; and performing corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing, and storing the data attribute into an internationalized table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed. The implementation mode reduces the occupied space of the storage resources, improves the expandability of the storage device, simplifies the data processing flow and improves the performance of the storage device.

Description

Data processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method and apparatus.
Background
In order to adapt to different language environments and better serve users with different language type requirements, the database generally stores data by constructing multiple databases (one database is respectively constructed for each language type), multiple tables (one data table is constructed for each language type), multiple fields (data of multiple language types are stored in one record of one data table, one field corresponds to each language type), multiple records (data of multiple language types are stored in one data table, one record corresponds to each language type) and the like.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. the existing storage device construction method causes large space occupation of storage resources and poor data expansibility for newly added language types;
2. data processing flows for different language types are complex and often load large amounts of extraneous data, resulting in lower performance of the storage device.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data processing method and apparatus, which can reduce the occupied space of storage resources, improve the expandability of a storage device, simplify the data processing flow, and improve the performance of the storage device.
To achieve the above object, according to a first aspect of embodiments of the present invention, there is provided a data processing method including:
receiving access data, determining the current language type of the access data, and acquiring the access data of which the current language type is a non-local language;
obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method;
and performing corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing, and storing the data attribute into an internationalized table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed.
Further, the step of determining the data to be processed in the local language table according to the annotation content includes: acquiring a target method corresponding to the access data by using the facet-oriented programming, acquiring an operation type of the target method, and acquiring data to be processed from a local language table according to the target method under the condition that the operation type is query operation; and under the condition that the operation type is non-query operation, continuously acquiring the operation parameters of the target method, wherein the operation type comprises query operation, new addition operation, updating operation and deleting operation, and the operation parameters indicate the data to be processed corresponding to the non-query operation.
Further, the step of obtaining the operating parameters of the target method comprises: and reflecting the section class corresponding to the target method to obtain corresponding operating parameters.
Further, the step of performing corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing, and storing the updated data attribute into the internationalized table includes: and according to the operation type and the index relation between the local language table and the internationalization table, performing corresponding operation processing on the data to be processed and the corresponding data in the internationalization table, updating the data attribute after the operation processing in the internationalization table, and storing the data attribute into the internationalization table, wherein the internationalization table and the local language table are both stored in the storage device.
Further, before the step of performing corresponding operation processing on the data to be processed according to the operation type, the data processing method further includes: and judging whether the data to be processed with the same operation type exists or not, and if so, placing the data to be processed with the same operation type in the same set to be processed.
Further, in the case that the current language type of the access data is the local language, the data processing method further includes: and processing the corresponding data in the local language table according to the target method corresponding to the access data.
Further, the data processing method further comprises: and sending the data after the operation processing to an initiating object corresponding to the access data.
According to a second aspect of the embodiments of the present invention, there is provided a data processing apparatus including:
the data acquisition module is used for receiving the access data, determining the current language type of the access data and acquiring the access data of which the current language type is a non-local language;
the data determining module is used for acquiring the marked content of the target method corresponding to the access data and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method;
and the data processing module is used for carrying out corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing and storing the data attribute into the internationalized table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement any of the data processing methods described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, implementing any one of the data processing methods described above.
One embodiment of the above invention has the following advantages or benefits: because the access data is received, the current language type of the access data is determined, and the access data with the current language type being the non-local language is obtained; obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method; the method comprises the steps of carrying out corresponding operation processing on data to be processed according to an operation type, updating data attributes after the operation processing and storing the data attributes into an internationalized table, wherein the data attributes indicate data contents corresponding to the data to be processed and a technical means of a current language type, so that the technical problems of large occupied space of storage resources, poor data expansibility on a newly added language type, complex data processing flows aiming at different language types and low performance of the storage device due to the fact that a large amount of irrelevant data is loaded frequently in the existing storage device construction method are solved, and the technical effects of reducing the occupied space of the storage resources, improving the expandability of the storage device, simplifying the data processing flows and improving the performance of the storage device are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a data processing method provided according to a first embodiment of the present invention;
FIG. 2a is a schematic diagram of a main flow of a data processing method according to a second embodiment of the present invention;
FIG. 2b is a schematic main flow chart of the method for obtaining the operating parameters of the target method in FIG. 2 a;
FIG. 3 is a schematic diagram of the main blocks of a data processing apparatus according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a data processing method provided according to a first embodiment of the present invention; as shown in fig. 1, the data processing method provided in the embodiment of the present invention mainly includes:
step S101, receiving the access data, determining the current language type of the access data, and acquiring the access data of which the current language type is a non-local language.
Specifically, according to the embodiment of the present invention, the access data refers to data indicating an operation on the storage data in the storage device, and may be initiated by a user through the front end. Through the setting, the current language type of the access data is determined firstly, so that different data processing flows can be executed on the access data with the current language type being the local language and the non-local language, the flow of executing data processing on the data in the storage device is greatly simplified, and the performance reduction of the storage device caused by loading irrelevant data in the processing process can be avoided.
The local language refers to a language type corresponding to the server deployment site.
Step S102, obtaining the marked content of the target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method.
Specifically, according to the embodiment of the present invention, the target method corresponding to the access data refers to a method corresponding to an operation instruction of the user on the data in the storage device in the access data. For example, the user order data is obtained, and the user order data is adjusted, which is only an example and is not a specific limitation to the embodiment of the present invention.
According to the embodiment of the present invention, the step of obtaining the annotation content of the target method corresponding to the access data by indicating the operation parameter of the target method and storing the annotation content into the to-be-processed data in the international table after determining the annotation content further includes: acquiring a target method corresponding to the access data by using the facet-oriented programming, acquiring an operation type of the target method, and acquiring data to be processed from a local language table according to the target method under the condition that the operation type is query operation; and under the condition that the operation type is non-query operation, continuously acquiring the operation parameters of the target method, wherein the operation type comprises query operation, new addition operation, updating operation and deleting operation, and the operation parameters indicate the data to be processed corresponding to the non-query operation.
Specifically, according to a specific implementation manner of the embodiment of the present invention, after the target method corresponding to the access data is obtained by using the facet-oriented programming and the operation type of the target method is obtained, the step of determining whether the operation type is the query operation is performed, and then different methods for determining the to-be-processed data are respectively performed on different access data for which the query operation and the non-query operation are performed. The access data indicating the query operation only needs to be obtained by querying the storage device to obtain the corresponding data, and the operation parameters corresponding to the target method do not need to be obtained continuously, so that the data to be processed is determined according to the operation parameters. Through the arrangement, different methods for determining the data to be processed are executed according to different types of data, so that the data processing flow is further simplified, and the problem that irrelevant data is loaded in the data processing process, so that the performance of the storage device is reduced is avoided.
Further, according to an embodiment of the present invention, the step of obtaining the operation parameters of the target method includes: and reflecting the section class corresponding to the target method to obtain corresponding operating parameters.
Specifically, according to a specific implementation manner of the embodiment of the present invention, the annotation content in the target method includes a plurality of annotations (indicating operation types and operation parameters), and the operation types are mainly embodied in an international method annotation (specifically indicating an operation type) and an international entity annotation (only an entity that marks the annotation is to-be-determined data to be processed).
According to a specific implementation manner of the embodiment of the present invention, the operation parameters are mainly embodied in an internationalized attribute annotation (specifically, the operation parameters are indicated) and an internationalized primary key annotation (the purpose of associating the local language table with the internationalized table by key value pairs), and the two annotations are marked on the tangent class, and the corresponding operation parameters can be obtained by reflection processing of the tangent class.
And S103, performing corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing, and storing the data attribute into an internationalized table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed.
Specifically, according to the embodiment of the present invention, the step of performing corresponding operation processing on the data to be processed according to the operation type, and updating and storing the data attribute after the operation processing into the internationalized table includes: and according to the operation type and the index relation between the local language table and the internationalization table, performing corresponding operation processing on the data to be processed and the corresponding data in the internationalization table, updating the data attribute after the operation processing in the internationalization table, and storing the data attribute into the internationalization table, wherein the internationalization table and the local language table are both stored in the storage device.
The data to be processed in the local language table is determined according to the marked content, but the data in the local language table and the data in the internationalized table are correlated, so that for the data which needs to be internationalized, the data in the local language table cannot be processed, and the corresponding data of the data to be processed in the internationalized table also needs to be correspondingly processed according to the index relationship between the internationalized table and the local language table, so that the data with the correlation relationship between the two tables is still corresponding after the data processing is executed, and the performance of the storage device is also improved through the arrangement.
According to another implementation manner of the embodiment of the present invention, corresponding data of the data to be processed in the internationalization table may also be directly determined according to the operation type and the index relationship between the local language table and the internationalization table, then only corresponding operation processing is performed on the corresponding data in the internationalization table, then the data attribute after operation processing in the internationalization table is updated, and then the updated data attribute is stored in the internationalization table. Through the arrangement, only the data in the internationalized table is internationalized, the original data in the local language table is kept unchanged, and the data tracing according to the data in the local language table is facilitated.
According to the embodiment of the invention, the indexing relationship between the local language table and the internationalized table can be realized by a b + tree (a database indexing method) and a hash index (mainly by key value pairs), wherein the retrieval efficiency of the hash index is higher and the time complexity is lower.
According to an embodiment of the present invention, before the step of performing corresponding operation processing on the data to be processed according to the operation type, the data processing method further includes: and judging whether the data to be processed with the same operation type exists or not, and if so, placing the data to be processed with the same operation type in the same set to be processed.
Through the arrangement, the data of the same operation type can be arranged in the same set for batch data processing, so that the data processing efficiency is improved, and the situation of data omission can be avoided.
Further, according to an embodiment of the present invention, in a case that the current language type of the access data is a local language, the data processing method further includes: and processing the corresponding data in the local language table according to the target method corresponding to the access data.
For the access data with the current language type of the local language, corresponding data in the local language table can be processed directly according to a target method corresponding to the access data, data in an international table does not need to be processed, and a data processing flow is simplified.
According to an embodiment of the present invention, the data processing method further includes: and sending the data after the operation processing to an initiating object corresponding to the access data.
According to the technical scheme of the embodiment of the invention, the access data is received, the current language type of the access data is determined, and the access data with the current language type being the non-local language is obtained; obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method; the method comprises the steps of carrying out corresponding operation processing on data to be processed according to an operation type, updating data attributes after the operation processing and storing the data attributes into an internationalized table, wherein the data attributes indicate data contents corresponding to the data to be processed and a technical means of a current language type, so that the technical problems of large occupied space of storage resources, poor data expansibility on a newly added language type, complex data processing flows aiming at different language types and low performance of the storage device due to the fact that a large amount of irrelevant data is loaded frequently in the existing storage device construction method are solved, and the technical effects of reducing the occupied space of the storage resources, improving the expandability of the storage device, simplifying the data processing flows and improving the performance of the storage device are achieved.
FIG. 2a is a schematic diagram of a main flow of a data processing method according to a second embodiment of the present invention; as shown in fig. 2a, the data processing method provided in the embodiment of the present invention mainly includes:
step S201, receiving the access data, and determining whether the current language type of the access data is the local language. If yes, namely when the current language type of the access data is the local language, executing step S202; if not, that is, if the current language type of the access data is the non-local language, go to step S203.
Specifically, according to the embodiment of the present invention, the language context class may be obtained by an Aspect Oriented Programming (AOP) interceptor to determine a current language type corresponding to the access data.
According to a specific implementation manner of the embodiment of the present invention, a language context class may be customized using a local variable (Thread local variable, also called Thread local storage) of a Thread (Thread), which has a global static variable class, Thread < local > holder, and a language may be set into the local variable Thread < local > of the current Thread. The local language refers to a language type corresponding to the server deployment site.
Step S202, the corresponding data in the local language table is processed according to the target method corresponding to the access data.
For the access data with the current language type of the local language, corresponding data in the local language table can be processed directly according to a target method corresponding to the access data, data in an international table does not need to be processed, and a data processing flow is simplified.
Step S203, using the facet-oriented programming to obtain the target method corresponding to the access data, and obtaining the operation type of the target method.
For the access data of the non-local language type, internationally processing corresponding data in the database (namely determining to-be-processed data in a local language table through section-oriented programming, determining to-be-processed internationalized data according to an index relation between the local language table and an internationalized language table, performing corresponding operation processing on the internationalized data according to a target method corresponding to the access data, and updating data attributes, wherein the data attributes indicate data content and current language type of the to-be-processed data).
Specifically, according to the embodiment of the present invention, the obtaining of the annotation content corresponding to the target method by using the facet-oriented programming includes a plurality of annotations, which mainly include:
an internationalized method (I18n method, where I18n is Internationalization), where the annotation acts on a target method, where openatetype (operation type) is indicated to represent the type of an intercepted method operation database, and includes four operation types, namely, SELECT (query), INSERT (new addition), UPDATE (UPDATE), and DELETE (deletion), and it needs to be noted that if the openatetype is not specified, the operation is defaulted to operation;
an internationalized entity (I18nEntity), wherein the annotation is marked on an entity needing internationalization, and only the parameter marked with the annotation needs to be internationalized, namely, the data to be processed can be determined according to the operation parameter;
the international attribute (I18nField), the annotation acts on the attribute of the tangent class, the attribute marking the annotation carries out international processing, wherein the international attribute indicates metadata information and mainly comprises the current language type and specific content (such as content information including a user number, a user age, a specific article and the like in a user order);
the international primary key (I18nPrimarykey) is acted on the attribute of the tangent class, and the attribute of the annotation is marked to uniquely identify a piece of data as a unique index of the data in the local language table and the international table. It should be noted that, the use of hash index (key value pair) as the index relationship between the local language table and the international table is only one application example of the present invention.
Step S204, determining whether the operation type corresponding to the target method is a query operation, if so, that is, the operation type is a query operation, executing step S205; if not, i.e., the operation type is a non-query operation (i.e., an add operation, an update operation, or a delete operation), go to step S206.
And step S205, acquiring data to be processed from the local language table according to the target method.
The access data indicating the query operation only needs to be obtained by querying the storage device to obtain the corresponding data, and the operation parameters corresponding to the target method do not need to be obtained continuously, so that the data to be processed is determined according to the operation parameters. Through the arrangement, different methods for determining the data to be processed are executed according to different types of data, so that the data processing flow is further simplified, and the problem that irrelevant data is loaded in the data processing process, so that the performance of the storage device is reduced is avoided.
Step S206, continuously obtaining the operation parameters of the target method, where the operation parameters indicate the to-be-processed data corresponding to the non-query operation.
The method for acquiring the operation parameters mainly includes acquiring an internationalized attribute annotation (specifically indicating the operation parameters) and an internationalized primary key annotation (aiming at associating the local language table with the internationalized table through a key value pair) of the labeled content corresponding to the target method, wherein the two annotations are labeled on the tangent class, and the corresponding operation parameters can be acquired through reflection processing of the tangent class.
Specifically, according to the embodiment of the present invention, as shown in fig. 2b, the step of acquiring the operation parameters of the target method in step S206 mainly includes:
in step S2061, the operation parameters of the section class are acquired by the reflection processing.
In step S2062, all the operation parameters of the tangent class are obtained from the memory of jvm (Java Virtual Machine).
Step S2063, determine whether the acquisition result is empty. If not, namely the obtaining result is not empty, executing step S2064; if not, the obtaining result is empty, and the process goes to step S2067.
Step S2064, acquiring all the operation parameters of the section class itself, and adding the operation parameters to the list.
Step S2065, determine whether the parent class of the current cut-to-plane class is empty. If yes, namely the parent class is empty, executing step S2066; if not, i.e. the parent class is not empty, go to step S2064.
In step S2066, all the acquired operation parameters are stored in the memory jvm.
Step S2067, return to the operation parameter.
Through the setting, all the operation parameters corresponding to the target method can be obtained, the data to be processed is accurately determined, and data omission is avoided.
Step S207, judging whether the data to be processed with the same operation type exists, if so, judging that the data to be processed with the same operation type exists, and executing step S208; if not, that is, there is no pending data with the same operation type, go to step S209.
Step S208, the data to be processed with the same operation type is placed in the same set to be processed.
Specifically, according to the embodiment of the present invention, the data to be processed with the same operation type may form a list type, and the list is traversed to encapsulate the attribute of the data to be processed with the same operation type into a map (set) by determining whether the data to be processed belongs to the list type, so as to perform the subsequent batch processing.
Step S209, according to the operation type and the index relationship between the local language table and the internationalization table, corresponding operation processing is performed on the data to be processed and the corresponding data in the internationalization table, and after the data attribute after operation processing in the internationalization table is updated, the data attribute is stored in the internationalization table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed.
And step S210, sending the data after the operation processing to an initiating object corresponding to the access data.
According to the technical scheme of the embodiment of the invention, the access data is received, the current language type of the access data is determined, and the access data with the current language type being the non-local language is obtained; obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method; the method comprises the steps of carrying out corresponding operation processing on data to be processed according to an operation type, updating data attributes after the operation processing and storing the data attributes into an internationalized table, wherein the data attributes indicate data contents corresponding to the data to be processed and a technical means of a current language type, so that the technical problems of large occupied space of storage resources, poor data expansibility on a newly added language type, complex data processing flows aiming at different language types and low performance of the storage device due to the fact that a large amount of irrelevant data is loaded frequently in the existing storage device construction method are solved, and the technical effects of reducing the occupied space of the storage resources, improving the expandability of the storage device, simplifying the data processing flows and improving the performance of the storage device are achieved.
FIG. 3 is a schematic diagram of the main blocks of a data processing apparatus according to an embodiment of the present invention; as shown in fig. 3, a data processing apparatus 300 according to an embodiment of the present invention mainly includes:
the data obtaining module 301 is configured to receive the access data, determine a current language type of the access data, and obtain the access data of which the current language type is a non-local language.
Specifically, according to the embodiment of the present invention, the access data refers to data indicating an operation on the storage data in the storage device, and may be initiated by a user through the front end. Through the setting, the current language type of the access data is determined firstly, so that different data processing flows can be executed on the access data with the current language type being the local language and the non-local language, the flow of executing data processing on the data in the storage device is greatly simplified, and the performance reduction of the storage device caused by loading irrelevant data in the processing process can be avoided.
The local language refers to a language type corresponding to the server deployment site.
The data determining module 302 is configured to obtain annotation content of a target method corresponding to the access data, and determine to-be-processed data in the local language table according to the annotation content, where the annotation content indicates an operation type of the target method.
Specifically, according to the embodiment of the present invention, the target method corresponding to the access data refers to a method corresponding to an operation instruction of the user on the data in the storage device in the access data. For example, the user order data is obtained, and the user order data is adjusted, which is only an example and is not a specific limitation to the embodiment of the present invention.
According to an embodiment of the present invention, the above mentioned labeled content further indicates an operation parameter of the target method, and the data determining module 302 is further configured to: acquiring a target method corresponding to the access data by using the facet-oriented programming, acquiring an operation type of the target method, and acquiring data to be processed from a local language table according to the target method under the condition that the operation type is query operation; and under the condition that the operation type is non-query operation, continuously acquiring the operation parameters of the target method, wherein the operation type comprises query operation, new addition operation, updating operation and deleting operation, and the operation parameters indicate the data to be processed corresponding to the non-query operation.
Specifically, according to a specific implementation manner of the embodiment of the present invention, after the target method corresponding to the access data is obtained by using the facet-oriented programming and the operation type of the target method is obtained, the data determining module 302 is further configured to determine whether the operation type is a query operation, and then perform different methods for determining to-be-processed data on different access data for which the query operation and the non-query operation are performed, respectively. The access data indicating the query operation only needs to be obtained by querying the storage device to obtain the corresponding data, and the operation parameters corresponding to the target method do not need to be obtained continuously, so that the data to be processed is determined according to the operation parameters. Through the above arrangement, the data determining module 302 is further configured to determine the data to be processed by executing different processing flows for different types of data, so that the data processing flow is further simplified, and the situation that irrelevant data is loaded in the data processing process is avoided, thereby reducing the performance of the storage device.
Further, according to an embodiment of the present invention, the data determining module 302 is further configured to: and reflecting the section class corresponding to the target method to obtain corresponding operating parameters.
Specifically, according to a specific implementation manner of the embodiment of the present invention, the annotation content in the target method includes a plurality of annotations (indicating operation types and operation parameters), and the operation types are mainly embodied in an international method annotation (specifically indicating an operation type) and an international entity annotation (only an entity that marks the annotation is to-be-determined data to be processed).
According to a specific implementation manner of the embodiment of the present invention, the operation parameters are mainly embodied in an internationalized attribute annotation (specifically, the operation parameters are indicated) and an internationalized primary key annotation (the purpose of associating the local language table with the internationalized table by key value pairs), and the two annotations are marked on the tangent class, and the corresponding operation parameters can be obtained by reflection processing of the tangent class.
The data processing module 303 is configured to perform corresponding operation processing on the data to be processed according to the operation type, update the data attribute after the operation processing, and store the updated data attribute in the internationalization table, where the data attribute indicates the data content and the current language type corresponding to the data to be processed.
Specifically, according to an embodiment of the present invention, the data processing module 303 is further configured to: and according to the operation type and the index relation between the local language table and the internationalization table, performing corresponding operation processing on the data to be processed and the corresponding data in the internationalization table, updating the data attribute after the operation processing in the internationalization table, and storing the data attribute into the internationalization table, wherein the internationalization table and the local language table are both stored in the storage device.
The data to be processed in the local language table is determined according to the marked content, but the data in the local language table and the data in the internationalized table are correlated, so that for the data which needs to be internationalized, the data in the local language table cannot be processed, and the corresponding data of the data to be processed in the internationalized table also needs to be correspondingly processed according to the index relationship between the internationalized table and the local language table, so that the data with the correlation relationship between the two tables is still corresponding after the data processing is executed, and the performance of the storage device is also improved through the arrangement.
According to another implementation manner of the embodiment of the present invention, the data processing module 303 may also be configured to: and determining corresponding data of the data to be processed in the internationalized table directly according to the operation type and the index relation between the local language table and the internationalized table, then performing corresponding operation processing on the corresponding data in the internationalized table, updating the data attribute after the operation processing in the internationalized table, and then storing the updated data attribute into the internationalized table. Through the arrangement, only the data in the internationalized table is internationalized, the original data in the local language table is kept unchanged, and the data tracing according to the data in the local language table is facilitated.
According to the embodiment of the present invention, the data processing apparatus 300 further includes a determining module, before the step of performing corresponding operation processing on the data to be processed according to the operation type, the determining module is configured to: and judging whether the data to be processed with the same operation type exists or not, and if so, placing the data to be processed with the same operation type in the same set to be processed.
Through the arrangement, the data of the same operation type can be arranged in the same set for batch data processing, so that the data processing efficiency is improved, and the situation of data omission can be avoided.
Further, according to the embodiment of the present invention, the data processing apparatus 300 further includes a local language processing module, and in the case that the current language type of the access data is a local language, the local language processing module is configured to: and processing the corresponding data in the local language table according to the target method corresponding to the access data.
For the access data with the current language type of the local language, corresponding data in the local language table can be processed directly according to a target method corresponding to the access data, data in an international table does not need to be processed, and a data processing flow is simplified.
According to an embodiment of the present invention, the data processing apparatus 300 further includes a sending module, configured to send the data after the operation processing to an initiating object corresponding to the access data.
According to the technical scheme of the embodiment of the invention, the access data is received, the current language type of the access data is determined, and the access data with the current language type being the non-local language is obtained; obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method; the method comprises the steps of carrying out corresponding operation processing on data to be processed according to an operation type, updating data attributes after the operation processing and storing the data attributes into an internationalized table, wherein the data attributes indicate data contents corresponding to the data to be processed and a technical means of a current language type, so that the technical problems of large occupied space of storage resources, poor data expansibility on a newly added language type, complex data processing flows aiming at different language types and low performance of the storage device due to the fact that a large amount of irrelevant data is loaded frequently in the existing storage device construction method are solved, and the technical effects of reducing the occupied space of the storage resources, improving the expandability of the storage device, simplifying the data processing flows and improving the performance of the storage device are achieved.
Fig. 4 shows an exemplary system architecture 400 of a data processing method or data processing apparatus to which embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405 (this architecture is merely an example, and the components included in a particular architecture may be adapted according to application specific circumstances). The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The background management server may analyze and perform other processing on the received data such as the access data, and feed back a processing result (for example, to-be-processed data, data after operation processing, just an example) to the terminal device.
It should be noted that the data processing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the data processing apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, 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 such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can 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 the present invention, 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 the present invention, 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: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
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 invention. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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 modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a data acquisition module, a data determination module, and a data processing module. The names of these modules do not limit the modules themselves in some cases, for example, the data acquisition module may also be described as a "module for receiving access data, determining the current language type of the access data, and acquiring access data of which the current language type is a non-native language".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving access data, determining the current language type of the access data, and acquiring the access data of which the current language type is a non-local language; obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method; and performing corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing, and storing the data attribute into an internationalized table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed.
According to the technical scheme of the embodiment of the invention, the access data is received, the current language type of the access data is determined, and the access data with the current language type being the non-local language is obtained; obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in the local language table according to the marked content, wherein the marked content indicates the operation type of the target method; the method comprises the steps of carrying out corresponding operation processing on data to be processed according to an operation type, updating data attributes after the operation processing and storing the data attributes into an internationalized table, wherein the data attributes indicate data contents corresponding to the data to be processed and a technical means of a current language type, so that the technical problems of large occupied space of storage resources, poor data expansibility on a newly added language type, complex data processing flows aiming at different language types and low performance of the storage device due to the fact that a large amount of irrelevant data is loaded frequently in the existing storage device construction method are solved, and the technical effects of reducing the occupied space of the storage resources, improving the expandability of the storage device, simplifying the data processing flows and improving the performance of the storage device are achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A data processing method, comprising:
receiving access data, determining the current language type of the access data, and acquiring the access data of which the current language type is a non-local language;
obtaining the marked content of a target method corresponding to the access data, and determining the data to be processed in a local language table according to the marked content, wherein the marked content indicates the operation type of the target method;
and performing corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing, and storing the data attribute into an internationalization table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed.
2. The data processing method according to claim 1, wherein the annotation content further indicates an operation parameter of the target method, the step of obtaining the annotation content of the target method corresponding to the access data, and the step of determining the data to be processed in the local language table according to the annotation content comprises: acquiring a target method corresponding to the access data by using a facet-oriented programming, acquiring an operation type of the target method, and acquiring data to be processed from a local language table according to the target method under the condition that the operation type is a query operation; and under the condition that the operation type is a non-query operation, continuously acquiring the operation parameters of the target method, wherein the operation type comprises a query operation, a new adding operation, an updating operation and a deleting operation, and the operation parameters indicate to-be-processed data corresponding to the non-query operation.
3. The data processing method of claim 2, wherein the step of obtaining the operating parameters of the target method comprises: and reflecting the section class corresponding to the target method to obtain corresponding operating parameters.
4. The data processing method according to claim 1, wherein the step of performing corresponding operation processing on the data to be processed according to the operation type, and updating and storing the data attribute after the operation processing into an internationalized table includes: and according to the operation type and the index relation between the local language table and the internationalization table, performing corresponding operation processing on the data to be processed and the corresponding data in the internationalization table, updating the data attribute after the operation processing in the internationalization table, and storing the data attribute into the internationalization table, wherein the internationalization table and the local language table are both stored in a storage device.
5. The data processing method according to claim 1, wherein before the step of performing the corresponding operation processing on the data to be processed according to the operation type, the data processing method further comprises: and judging whether the data to be processed with the same operation type exists or not, and if so, placing the data to be processed with the same operation type in the same set to be processed.
6. The data processing method according to claim 1, wherein in a case where the current language type of the access data is a local language, the data processing method further comprises: and processing corresponding data in the local language table according to the target method corresponding to the access data.
7. The data processing method of claim 1, further comprising: and sending the data after the operation processing to an initiating object corresponding to the access data.
8. A data processing apparatus, comprising:
the data acquisition module is used for receiving access data, determining the current language type of the access data and acquiring the access data of which the current language type is a non-local language;
the data determining module is used for acquiring the marked content of a target method corresponding to the access data and determining the data to be processed in a local language table according to the marked content, wherein the marked content indicates the operation type of the target method;
and the data processing module is used for carrying out corresponding operation processing on the data to be processed according to the operation type, updating the data attribute after the operation processing and storing the data attribute into an internationalized table, wherein the data attribute indicates the data content and the current language type corresponding to the data to be processed.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010429902.2A 2020-05-20 2020-05-20 Data processing method and device Pending CN113704242A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010429902.2A CN113704242A (en) 2020-05-20 2020-05-20 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010429902.2A CN113704242A (en) 2020-05-20 2020-05-20 Data processing method and device

Publications (1)

Publication Number Publication Date
CN113704242A true CN113704242A (en) 2021-11-26

Family

ID=78645502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010429902.2A Pending CN113704242A (en) 2020-05-20 2020-05-20 Data processing method and device

Country Status (1)

Country Link
CN (1) CN113704242A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114491137A (en) * 2022-02-15 2022-05-13 平安科技(深圳)有限公司 Data storage method, related device and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050548A1 (en) * 2003-08-28 2005-03-03 Sun Microsystems, Inc. Application internationalization using dynamic proxies
CN103699655A (en) * 2013-12-27 2014-04-02 福建星网视易信息系统有限公司 Method and device for internationalizing databases and method and system for converting data
CN110209695A (en) * 2018-02-06 2019-09-06 北京京东尚科信息技术有限公司 Method and apparatus towards multilingual data buffer storage

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050050548A1 (en) * 2003-08-28 2005-03-03 Sun Microsystems, Inc. Application internationalization using dynamic proxies
CN103699655A (en) * 2013-12-27 2014-04-02 福建星网视易信息系统有限公司 Method and device for internationalizing databases and method and system for converting data
CN110209695A (en) * 2018-02-06 2019-09-06 北京京东尚科信息技术有限公司 Method and apparatus towards multilingual data buffer storage

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114491137A (en) * 2022-02-15 2022-05-13 平安科技(深圳)有限公司 Data storage method, related device and medium
CN114491137B (en) * 2022-02-15 2024-03-26 平安科技(深圳)有限公司 Data storage method, related equipment and medium

Similar Documents

Publication Publication Date Title
CN110019080B (en) Data access method and device
CN109614402B (en) Multidimensional data query method and device
CN107480205B (en) Method and device for partitioning data
CN110689268B (en) Method and device for extracting indexes
CN110555030A (en) SQL statement processing method and device
CN110765187A (en) Data source route management method and device
CN110795315A (en) Method and device for monitoring service
CN111400304A (en) Method and device for acquiring total data of section dates, electronic equipment and storage medium
CN110909022A (en) Data query method and device
CN113760948A (en) Data query method and device
CN111401684A (en) Task processing method and device
CN112783887A (en) Data processing method and device based on data warehouse
CN108959294B (en) Method and device for accessing search engine
CN113656737A (en) Webpage content display method and device, electronic equipment and storage medium
CN113761565B (en) Data desensitization method and device
CN113704242A (en) Data processing method and device
CN112100168A (en) Method and device for determining data association relationship
CN112783914B (en) Method and device for optimizing sentences
CN113760969A (en) Data query method and device based on elastic search
CN113127416A (en) Data query method and device
CN112988857A (en) Service data processing method and device
CN113742321A (en) Data updating method and device
CN113704222A (en) Method and device for processing service request
CN111737218A (en) File sharing method and device
CN112835609A (en) Method and device for modifying dependent package download address

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