A data processing method and device

By receiving access data and determining its language type, and using aspect-oriented programming to obtain operating parameters, it solves the problems of large resource usage and poor scalability of existing storage devices, and achieves simplified data processing procedures and performance improvement.

CN113704242BActive Publication Date: 2024-10-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010429902.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-20
Publication Date
2024-10-18
Estimated Expiration
2040-05-20

AI Technical Summary

Technical Problem

Existing storage device construction methods result in storage resources occupying a large space, poor scalability, complex data processing procedures, and often loading irrelevant data, resulting in low performance.

Method used

By receiving the access data, determine its language type, obtain the annotation content to determine the operation type of the data to be processed, use aspect-oriented programming to obtain the operation parameters of the target method, perform corresponding processing in the internationalization table according to the operation type, and update the data attributes. Avoid loading irrelevant data.

Benefits of technology

The space occupied by storage resources is reduced, the scalability of the storage device is improved, the data processing process is simplified, and the performance of the storage device is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113704242B_ABST
    Figure CN113704242B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method and device, and relates to the field of computer technology. A specific implementation of the method includes: receiving access data, determining the current language type of the access data, and obtaining access data whose current language type is a non-local language; obtaining the annotation 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 annotation content, wherein the annotation content indicates the operation type of the target method; performing corresponding operation processing on the data to be processed according to the operation type, and updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and current language type corresponding to the data to be processed. This implementation reduces the space occupied by storage resources, improves the scalability of the storage device, simplifies the data processing process, and improves the performance of the storage device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data processing method and device. Background Art

[0002] In order to adapt to different language environments and better serve users with different language requirements, databases generally store data through methods such as building multiple databases (building a database for each language type), multiple tables (building a data table for each language type), multiple fields (storing data of multiple language types in a record of a data table, with each language type corresponding to a field), and multiple records (storing data of multiple language types in a data table, with each language type corresponding to a record).

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] 1. The existing storage device construction method results in large storage resource space occupation and poor data scalability for newly added language types;

[0005] 2. The data processing flow for different language types is complicated, and a large amount of irrelevant data is often loaded, resulting in low performance of the storage device. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a data processing method and device, which can reduce the space occupied by storage resources, improve the scalability of the storage device, simplify the data processing process, and improve the performance of the storage device.

[0007] To achieve the above object, according to a first aspect of an embodiment of the present invention, a data processing method is provided, comprising:

[0008] receiving access data, determining a current language type of the access data, and obtaining access data whose current language type is a non-native language;

[0009] Obtaining the annotation 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 annotation content, wherein the annotation content indicates the operation type of the target method;

[0010] The data to be processed is processed according to the operation type, and the attributes of the data after the operation are updated and stored in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed.

[0011] Furthermore, the annotation content also indicates the operation parameters of the target method, and the step of obtaining the annotation 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 annotation content includes: using aspect-oriented programming to obtain the target method corresponding to the access data, and obtaining the operation type of the target method. When the operation type is a query operation, the data to be processed is obtained from the local language table according to the target method; when the operation type is a non-query operation, the operation parameters of the target method are continued to be obtained, wherein the operation types include query operations, new operations, update operations and delete operations, and the operation parameters indicate the data to be processed corresponding to the non-query operation.

[0012] Furthermore, the step of obtaining the operation parameters of the target method includes: obtaining the corresponding operation parameters by performing reflection processing on the aspect class corresponding to the target method.

[0013] Furthermore, the steps of performing corresponding operation processing on the data to be processed according to the operation type, updating the data attributes after the operation processing and storing them in the internationalization table include: performing corresponding operation processing on the data to be processed and its corresponding data in the internationalization table according to the operation type and the index relationship between the local language table and the internationalization table, updating the data attributes after the operation processing in the internationalization table and storing them in the internationalization table, wherein the internationalization table and the local language table are both stored in a storage device.

[0014] Furthermore, before the step of performing corresponding operation processing on the data to be processed according to the operation type, the data processing method also includes: determining whether there is data to be processed with the same operation type, and if so, placing the data to be processed with the same operation type in the same set to be processed.

[0015] Furthermore, in the case where the current language type of the access data is the local language, the data processing method further comprises: processing corresponding data in the local language table according to the target method corresponding to the access data.

[0016] Furthermore, the data processing method further includes: sending the processed data to an initiating object corresponding to the access data.

[0017] According to a second aspect of an embodiment of the present invention, there is provided a data processing device, including:

[0018] A data acquisition module, used for receiving access data, determining the current language type of the access data, and acquiring access data whose current language type is a non-native language;

[0019] A data determination module, used to obtain the annotation content of the target method corresponding to the access data, and determine the data to be processed in the local language table according to the annotation content, wherein the annotation content indicates the operation type of the target method;

[0020] The data processing module is used to perform corresponding operations on the data to be processed according to the operation type, and update the data attributes after the operation processing and store them in the internationalization table, wherein the data attributes indicate the data content and current language type corresponding to the data to be processed.

[0021] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, including:

[0022] one or more processors;

[0023] a storage device for storing one or more programs,

[0024] When one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned data processing methods.

[0025] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored. When the program is executed by a processor, any of the above-mentioned data processing methods is implemented.

[0026] An embodiment of the above invention has the following advantages or beneficial effects: because it adopts the method of receiving access data, determining the current language type of the access data, and obtaining the access data whose current language type is a non-local language; obtaining the annotation 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 annotation content, wherein the annotation content indicates the operation type of the target method; performing corresponding operation processing on the data to be processed according to the operation type, and updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed. Therefore, the technical means overcomes the large storage resource space occupied by the existing storage device construction method, the poor data scalability for newly added language types, the complex data processing process for different language types, and the frequent loading of a large amount of irrelevant data, resulting in low performance of the storage device, thereby achieving the technical effect of reducing the space occupied by storage resources, improving the scalability of the storage device, simplifying the data processing process, and improving the performance of the storage device.

[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0029] Figure 1 is a schematic diagram of the main flow of a data processing method provided according to a first embodiment of the present invention;

[0030] Figure 2a is a schematic diagram of the main flow of a data processing method provided according to a second embodiment of the present invention;

[0031] Figure 2b yes Figure 2a A schematic diagram of the main process of obtaining the operating parameters of the target method;

[0032] Figure 3 is a schematic diagram of main modules of a data processing device provided according to an embodiment of the present invention;

[0033] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0034] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0035] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0036] Figure 1 is a schematic diagram of the main flow of the data processing method provided according to the first embodiment of the present invention; Figure 1 As shown, the data processing method provided by the embodiment of the present invention mainly includes:

[0037] Step S101, receiving access data, determining the current language type of the access data, and acquiring access data whose current language type is a non-native language.

[0038] Specifically, according to an embodiment of the present invention, access data refers to data that indicates operations on the storage data in the storage device, which can be initiated by the user through the front end. Through the above settings, the current language type of the access data is first determined, so as to facilitate the subsequent execution of different data processing processes for the access data whose current language type is the local language and the non-local language, which greatly simplifies the process of executing data processing on the data in the storage device, and can also avoid loading irrelevant data during the processing process, resulting in reduced performance of the storage device.

[0039] The local language refers to the language type corresponding to the server deployment site.

[0040] Step S102, obtaining the annotation 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 annotation content, wherein the annotation content indicates the operation type of the target method.

[0041] Specifically, according to an embodiment of the present invention, the target method corresponding to the access data refers to the method corresponding to the operation instruction of the user on the data in the storage device in the access data, for example, obtaining user order data, adjusting user order data, etc. The above is only an example and does not serve as a specific limitation on the embodiment of the present invention.

[0042] According to an embodiment of the present invention, the above-mentioned annotation content also indicates the operation parameters of the target method, and the annotation content of the target method corresponding to the access data is obtained. The step of determining the data to be processed and storing it in the internationalization table according to the annotation content includes: using aspect-oriented programming to obtain the target method corresponding to the access data, and obtaining the operation type of the target method. When the operation type is a query operation, the data to be processed is obtained from the local language table according to the target method; when the operation type is a non-query operation, the operation parameters of the target method are continued to be obtained, wherein the operation types include query operations, new operations, update operations and delete operations, and the operation parameters indicate the data to be processed corresponding to the non-query operation.

[0043] Specifically, according to a specific implementation of an embodiment of the present invention, after using aspect-oriented programming to obtain the target method corresponding to the access data and obtaining the operation type of the target method, the step of determining whether the operation type is a query operation is performed, and then different methods of determining the data to be processed are respectively performed for different access data that perform query operations and non-query operations. Since the access data indicating the query operation only needs to obtain the corresponding data through query in the storage device, there is no need to continue to obtain the operation parameters corresponding to the target method, and then determine the data to be processed according to the operation parameters. Through the above settings, different methods of determining the data to be processed are executed for different types of data, which further simplifies the data processing process and avoids loading irrelevant data during the data processing process, thereby reducing the performance of the storage device.

[0044] Further, according to an embodiment of the present invention, the step of obtaining the operating parameters of the target method includes: obtaining the corresponding operating parameters by performing reflection processing on the aspect class corresponding to the target method.

[0045] Specifically, according to a specific implementation of an embodiment of the present invention, the annotation content in the target method includes multiple annotations (indicating the operation type and operation parameters), and the operation type is mainly reflected in the internationalization method annotation (specifically indicating the operation type) and the internationalization entity annotation (only the entity annotated with the annotation is the data to be determined and processed).

[0046] According to a specific implementation of an embodiment of the present invention, the operation parameters are mainly reflected in the internationalization attribute annotation (specifically indicating the operation parameters) and the internationalization primary key annotation (whose purpose is to associate the local language table with the internationalization table through a key-value pair), and the two annotations are marked on the aspect class. Specifically, the corresponding operation parameters can be obtained through reflection processing of the aspect class.

[0047] Step S103, performing corresponding operation processing on the data to be processed according to the operation type, updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed.

[0048] Specifically, according to an embodiment of the present invention, the above-mentioned step of performing corresponding operation processing on the data to be processed according to the operation type, and updating the data attributes after the operation processing and storing them in the internationalization table includes: performing corresponding operation processing on the data to be processed and its corresponding data in the internationalization table according to the operation type and the index relationship between the local language table and the internationalization table, and storing the data attributes after the operation processing in the internationalization table in the internationalization table after updating, wherein the internationalization table and the local language table are both stored in a storage device.

[0049] As mentioned above, the data to be processed in the local language table is determined according to the marked content. However, since the data in the local language table and the data in the internationalization table are interrelated, for the data that needs to be internationalized, it is not necessary to process the data in the local language table. It is also necessary to process the corresponding data of the data to be processed in the internationalization table according to the index relationship between the internationalization table and the local language table. This ensures that after the data processing is executed, the data that are associated with each other in the two tables are still corresponding. The above settings also improve the performance of the storage device.

[0050] According to another implementation of the embodiment of the present invention, the corresponding data of the data to be processed in the internationalization table can also be directly determined according to the operation type and the index relationship between the local language table and the internationalization table, and then only the corresponding data in the internationalization table is processed accordingly, and then the data attributes after the operation in the internationalization table are updated, and then the updated data attributes are stored in the internationalization table. Through the above setting, only the data in the internationalization table is internationalized, and the original data in the local language table is kept unchanged, which is conducive to subsequent data tracing based on the data in the local language table.

[0051] According to an embodiment of the present invention, the index relationship between the local language table and the internationalization table can be implemented by a b+ tree (a database indexing method) or a hash index (mainly through key-value pairs), wherein the hash index has higher retrieval efficiency and lower time complexity.

[0052] According to an embodiment of the present invention, before the above-mentioned step of performing corresponding operation processing on the data to be processed according to the operation type, the data processing method also includes: determining whether there is data to be processed with the same operation type, and if so, placing the data to be processed with the same operation type in the same set to be processed.

[0053] Through the above settings, data of the same operation type can be placed in the same set for batch data processing, which not only improves data processing efficiency but also avoids data omissions.

[0054] Further, according to an embodiment of the present invention, when the current language type of the access data is the local language, the data processing method further includes: processing corresponding data in the local language table according to a target method corresponding to the access data.

[0055] For access data whose current language type is the local language, the corresponding data in the local language table can be directly processed according to the target method corresponding to the access data. There is no need to process the data in the internationalization table, which simplifies the data processing process.

[0056] According to an embodiment of the present invention, the above data processing method further includes: sending the data after the operation processing to the initiating object corresponding to the access data.

[0057] According to the technical solution of the embodiment of the present invention, because it adopts the method of receiving access data, determining the current language type of the access data, obtaining the access data whose current language type is a non-local language; obtaining the annotation content of the target method corresponding to the access data, determining the data to be processed in the local language table according to the annotation content, wherein the annotation content indicates the operation type of the target method; performing corresponding operation processing on the data to be processed according to the operation type, updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed. Therefore, the technical problems of large storage resource space occupied, poor data scalability for newly added language types, complex data processing flow for different language types, and often loading a large amount of irrelevant data, resulting in low performance of the storage device, are overcome, thereby achieving the technical effect of reducing the space occupied by storage resources, improving the scalability of the storage device, simplifying the data processing flow, and improving the performance of the storage device.

[0058] Figure 2a is a schematic diagram of the main flow of the data processing method provided according to the second embodiment of the present invention; Figure 2a As shown, the data processing method provided by the embodiment of the present invention mainly includes:

[0059] Step S201, receiving access data, and determining whether the current language type of the access data is a local language. If so, that is, when the current language type of the access data is a local language, step S202 is executed; if not, that is, when the current language type of the access data is a non-local language, step S203 is executed.

[0060] Specifically, according to an embodiment of the present invention, a language context class may be obtained through an aspect-oriented programming (AOP) interceptor to determine the current language type corresponding to the access data.

[0061] According to a specific implementation of an embodiment of the present invention, a thread-local variable (ThreadLocal, also known as thread-local storage) can be used to customize the LuggageContextHolder (language context) class, which has a global static variable class ThreadLocal <locale>holder, you can set the language to the local variable ThreadLocal of the current thread <locale>The local language refers to the language type corresponding to the server deployment site.

[0062] Step S202: Process the corresponding data in the local language table according to the target method corresponding to the access data.

[0063] For access data whose current language type is the local language, the corresponding data in the local language table can be directly processed according to the target method corresponding to the access data. There is no need to process the data in the internationalization table, which simplifies the data processing process.

[0064] Step S203, using aspect-oriented programming to obtain a target method corresponding to the access data, and obtain an operation type of the target method.

[0065] For access data of non-local language types, internationalization processing is performed on the corresponding data in the database (i.e., the data to be processed in the local language table is determined through aspect-oriented programming, and then the internationalized data to be processed is determined according to the index relationship between the local language table and the internationalized language table, and the internationalized data is processed accordingly according to the target method corresponding to the access data, and the data attributes are updated, where the data attributes indicate the data content and current language type of the data to be processed).

[0066] Specifically, according to an embodiment of the present invention, the annotation content corresponding to the target method obtained by aspect-oriented programming includes multiple annotations, mainly including:

[0067] Internationalization method (I18nMethod, where I18n stands for Internationalization), this annotation acts on the target method, in which the operationType indicates the type of database operation by the intercepted method, including SELECT, INSERT, UPDATE, and DELETE. It should be noted that if the operationType is not specified, the default is the operation;

[0068] Internationalized entity (I18nEntity), this annotation is marked on the entity that needs to be internationalized. Only the parameters marked with this annotation need to be internationalized. That is, the data to be processed can be determined based on the operation parameters;

[0069] Internationalization attribute (I18nField), this annotation acts on the attributes of the aspect class. The attributes marked with this annotation will be internationalized. The internationalization attribute indicates metadata information, mainly including the current language type and specific content (such as user number, user age, specific items, etc. included in the user order);

[0070] Internationalization primary key (I18nPrimarykey), this annotation acts on the attributes of the aspect class. The attribute marked with this annotation can uniquely identify a piece of data as the unique index of the data in the local language table and the internationalization table. It should be noted that the use of a hash index (key-value pair) as the index relationship between the local language table and the internationalization table is only an application embodiment of the present invention.

[0071] Step S204, determine whether the operation type corresponding to the target method is a query operation. If so, that is, the operation type is a query operation, execute step S205; if not, that is, the operation type is a non-query operation (that is, a add operation, an update operation, or a delete operation), go to step S206.

[0072] Step S205, obtaining the data to be processed from the local language table according to the target method.

[0073] Since the access data indicating the query operation only needs to obtain the corresponding data through query in the storage device, there is no need to continue to obtain the operation parameters corresponding to the target method, and then determine the data to be processed according to the operation parameters. Through the above settings, different methods for determining the data to be processed are executed for different types of data, which further simplifies the data processing process and avoids loading irrelevant data during the data processing process, thereby reducing the performance of the storage device.

[0074] Step S206 , continue to obtain the operation parameters of the target method, wherein the operation parameters indicate the to-be-processed data corresponding to the non-query operation.

[0075] The way to obtain the operation parameters here is mainly to obtain the internationalization attribute annotation (specifically indicating the operation parameters) and the internationalization primary key annotation (whose purpose is to associate the local language table with the internationalization table through key-value pairs) of the annotation content corresponding to the target method, and these two annotations are annotated on the aspect class. Specifically, the corresponding operation parameters can be obtained through reflection processing of the aspect class.

[0076] Specifically, according to an embodiment of the present invention, Figure 2b As shown, the step of obtaining the operation parameters of the target method in step S206 mainly includes:

[0077] Step S2061, obtaining the operation parameters of the aspect class through reflection processing.

[0078] Step S2062, obtaining all operation parameters of the aspect class from the jvm (Java Virtual Machine) memory.

[0079] Step S2063, determine whether the acquisition result is empty. If not, that is, the acquisition result is not empty, then execute step S2064; if not, that is, the acquisition result is empty, then go to step S2067.

[0080] Step S2064, obtain all operation parameters of the aspect class itself, and add the operation parameters to the list.

[0081] Step S2065, determine whether the parent class of the current aspect class is empty. If yes, that is, the parent class is empty, then execute step S2066; if no, that is, the parent class is not empty, then go to step S2064.

[0082] Step S2066, storing all the acquired operation parameters into the jvm memory.

[0083] Step S2067, return the operation parameters.

[0084] Through the above settings, all operating parameters corresponding to the target method can be obtained, thereby accurately determining the data to be processed and avoiding data omission.

[0085] Step S207, determine whether there is data to be processed with the same operation type. If so, that is, there is data to be processed with the same operation type, execute step S208; if not, that is, there is no data to be processed with the same operation type, go to step S209.

[0086] Step S208, placing the to-be-processed data of the same operation type into the same to-be-processed set.

[0087] Specifically, according to an embodiment of the present invention, the data to be processed of the same operation type will constitute a list type. By determining whether the data to be processed belongs to the list type, the list is traversed to encapsulate the attributes of the data to be processed of the same operation type into a map (collection) for subsequent batch processing.

[0088] Step S209, according to the operation type and the index relationship between the local language table and the internationalization table, corresponding operations are performed on the data to be processed and its corresponding data in the internationalization table, and the data attributes after the operation processing in the internationalization table are updated and stored in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed.

[0089] Step S210: sending the processed data to the initiating object corresponding to the access data.

[0090] According to the technical solution of the embodiment of the present invention, because it adopts the method of receiving access data, determining the current language type of the access data, obtaining the access data whose current language type is a non-local language; obtaining the annotation content of the target method corresponding to the access data, determining the data to be processed in the local language table according to the annotation content, wherein the annotation content indicates the operation type of the target method; performing corresponding operation processing on the data to be processed according to the operation type, updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed. Therefore, the technical problems of large storage resource space occupied, poor data scalability for newly added language types, complex data processing flow for different language types, and often loading a large amount of irrelevant data, resulting in low performance of the storage device, are overcome, thereby achieving the technical effect of reducing the space occupied by storage resources, improving the scalability of the storage device, simplifying the data processing flow, and improving the performance of the storage device.

[0091] Figure 3 is a schematic diagram of main modules of a data processing device provided according to an embodiment of the present invention; Figure 3 As shown, the data processing device 300 provided in this embodiment of the present invention mainly includes:

[0092] The data acquisition module 301 is used to receive access data, determine the current language type of the access data, and acquire the access data whose current language type is a non-native language.

[0093] Specifically, according to an embodiment of the present invention, access data refers to data that indicates operations on the storage data in the storage device, which can be initiated by the user through the front end. Through the above settings, the current language type of the access data is first determined, so as to facilitate the subsequent execution of different data processing processes for the access data whose current language type is the local language and the non-local language, which greatly simplifies the process of executing data processing on the data in the storage device, and can also avoid loading irrelevant data during the processing process, resulting in reduced performance of the storage device.

[0094] The local language refers to the language type corresponding to the server deployment site.

[0095] The data determination module 302 is used to obtain the annotation content of the target method corresponding to the access data, and determine the data to be processed in the local language table according to the annotation content, wherein the annotation content indicates the operation type of the target method.

[0096] Specifically, according to an embodiment of the present invention, the target method corresponding to the access data refers to the method corresponding to the operation instruction of the user on the data in the storage device in the access data, for example, obtaining user order data, adjusting user order data, etc. The above is only an example and does not serve as a specific limitation on the embodiment of the present invention.

[0097] According to an embodiment of the present invention, the above-mentioned annotation content also indicates the operation parameters of the target method, and the data determination module 302 is also used to: use aspect-oriented programming to obtain the target method corresponding to the access data, and obtain the operation type of the target method. When the operation type is a query operation, obtain the data to be processed from the local language table according to the target method; when the operation type is a non-query operation, continue to obtain the operation parameters of the target method, wherein the operation type includes query operation, new operation, update operation and delete operation, and the operation parameters indicate the data to be processed corresponding to the non-query operation.

[0098] Specifically, according to a specific implementation of an embodiment of the present invention, after using aspect-oriented programming to obtain the target method corresponding to the access data and obtaining the operation type of the target method, the data determination module 302 is also used to determine whether the operation type is a query operation, and then different methods of determining the data to be processed are respectively executed for different access data that perform query operations and non-query operations. Since the access data indicating the query operation only needs to obtain the corresponding data through query in the storage device, there is no need to continue to obtain the operation parameters corresponding to the target method, and then determine the data to be processed according to the operation parameters. Through the above settings, the data determination module 302 is also used to execute different processing flows for different types of data to determine the data to be processed, which further simplifies the data processing flow and avoids loading irrelevant data during the data processing process, thereby reducing the performance of the storage device.

[0099] Further, according to an embodiment of the present invention, the data determination module 302 is also used to obtain corresponding operation parameters by performing reflection processing on the aspect class corresponding to the target method.

[0100] Specifically, according to a specific implementation of an embodiment of the present invention, the annotation content in the target method includes multiple annotations (indicating the operation type and operation parameters), and the operation type is mainly reflected in the internationalization method annotation (specifically indicating the operation type) and the internationalization entity annotation (only the entity annotated with the annotation is the data to be determined and processed).

[0101] According to a specific implementation of an embodiment of the present invention, the operation parameters are mainly reflected in the internationalization attribute annotation (specifically indicating the operation parameters) and the internationalization primary key annotation (whose purpose is to associate the local language table with the internationalization table through a key-value pair), and the two annotations are marked on the aspect class. Specifically, the corresponding operation parameters can be obtained through reflection processing of the aspect class.

[0102] The data processing module 303 is used to perform corresponding operation processing on the data to be processed according to the operation type, and update the data attributes after the operation processing and store them in the internationalization table, wherein the data attributes indicate the data content and current language type corresponding to the data to be processed.

[0103] Specifically, according to an embodiment of the present invention, the above-mentioned data processing module 303 is also used to: perform corresponding operation processing on the data to be processed and its corresponding data in the internationalization table according to the operation type and the index relationship between the local language table and the internationalization table, and store the data attributes after the operation processing in the internationalization table into the internationalization table after updating, wherein the internationalization table and the local language table are both stored in a storage device.

[0104] As mentioned above, the data to be processed in the local language table is determined according to the marked content. However, since the data in the local language table and the data in the internationalization table are interrelated, for the data that needs to be internationalized, it is not necessary to process the data in the local language table. It is also necessary to process the corresponding data of the data to be processed in the internationalization table according to the index relationship between the internationalization table and the local language table. This ensures that after the data processing is executed, the data that are associated with each other in the two tables are still corresponding. The above settings also improve the performance of the storage device.

[0105] According to another implementation of the embodiment of the present invention, the data processing module 303 can also be used to: directly determine the corresponding data of the data to be processed in the internationalization table according to the operation type and the index relationship between the local language table and the internationalization table, and then only perform corresponding operation processing on the corresponding data in the internationalization table, and then update the data attributes after the operation processing in the internationalization table, and then store the updated data attributes in the internationalization table. Through the above setting, only the data in the internationalization table is internationalized, and the original data in the local language table is kept unchanged, which is conducive to subsequent data tracing based on the data in the local language table.

[0106] According to an embodiment of the present invention, the above-mentioned data processing device 300 also includes a judgment module. Before the step of performing corresponding operation processing on the data to be processed according to the operation type, the judgment module is used to: determine whether there is data to be processed with the same operation type. If so, place the data to be processed with the same operation type in the same set to be processed.

[0107] Through the above settings, data of the same operation type can be placed in the same set for batch data processing, which not only improves data processing efficiency but also avoids data omissions.

[0108] Further, according to an embodiment of the present invention, the above-mentioned data processing device 300 also includes a local language processing module. When the current language type of the access data is the local language, the local language processing module is used to: process the corresponding data in the local language table according to the target method corresponding to the access data.

[0109] For access data whose current language type is the local language, the corresponding data in the local language table can be directly processed according to the target method corresponding to the access data. There is no need to process the data in the internationalization table, which simplifies the data processing process.

[0110] According to an embodiment of the present invention, the data processing device 300 further includes a sending module, which is used to send the data after the operation is processed to the initiating object corresponding to the access data.

[0111] According to the technical solution of the embodiment of the present invention, because it adopts the method of receiving access data, determining the current language type of the access data, obtaining the access data whose current language type is a non-local language; obtaining the annotation content of the target method corresponding to the access data, determining the data to be processed in the local language table according to the annotation content, wherein the annotation content indicates the operation type of the target method; performing corresponding operation processing on the data to be processed according to the operation type, updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed. Therefore, the technical problems of large storage resource space occupied, poor data scalability for newly added language types, complex data processing flow for different language types, and often loading a large amount of irrelevant data, resulting in low performance of the storage device, are overcome, thereby achieving the technical effect of reducing the space occupied by storage resources, improving the scalability of the storage device, simplifying the data processing flow, and improving the performance of the storage device.

[0112] Figure 4 An exemplary system architecture 400 is shown to which the data processing method or data processing device according to the embodiment of the present invention can be applied.

[0113] like Figure 4 As shown, the system architecture 400 may include terminal devices 401, 402, 403, a network 404 and a server 405 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 404 is used to provide a medium for a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0114] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0115] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0116] The server 405 may be a server that provides various services, such as a background management server (only for example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The background management server may analyze and process the received access data and other data, and feed back the processing results (such as data to be processed, data after operation processing - only for example) to the terminal device.

[0117] It should be noted that the data processing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the data processing device is generally disposed in the server 405 .

[0118] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0119] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0120] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which 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 part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0121] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0122] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0123] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0124] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0125] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it 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 constitute a limitation on 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 whose current language type is a non-native language".

[0126] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: receiving access data, determining the current language type of the access data, and obtaining access data whose current language type is a non-local language; obtaining the annotation 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 annotation content, wherein the annotation content indicates the operation type of the target method; performing corresponding operation processing on the data to be processed according to the operation type, and updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and current language type corresponding to the data to be processed.

[0127] According to the technical solution of the embodiment of the present invention, because it adopts the method of receiving access data, determining the current language type of the access data, obtaining the access data whose current language type is a non-local language; obtaining the annotation content of the target method corresponding to the access data, determining the data to be processed in the local language table according to the annotation content, wherein the annotation content indicates the operation type of the target method; performing corresponding operation processing on the data to be processed according to the operation type, updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed. Therefore, the technical problems of large storage resource space occupied, poor data scalability for newly added language types, complex data processing flow for different language types, and often loading a large amount of irrelevant data, resulting in low performance of the storage device, are overcome, thereby achieving the technical effect of reducing the space occupied by storage resources, improving the scalability of the storage device, simplifying the data processing flow, and improving the performance of the storage device.

[0128] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.< / locale> < / locale>

Claims

1. A data processing method, characterized in that: include: receiving access data, determining a current language type of the access data, and acquiring access data whose current language type is a non-native language; Obtaining the annotation 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 annotation content, wherein the annotation content indicates the operation type of the target method; specifically comprising: using aspect-oriented programming to obtain the target method corresponding to the access data, and obtaining the operation type of the target method; Performing corresponding operation processing on the data to be processed according to the operation type, updating the data attributes after the operation processing and storing them in the internationalization table, wherein the data attributes indicate the data content and the current language type corresponding to the data to be processed; specifically including: performing corresponding operation processing on the data to be processed and its corresponding data in the internationalization table according to the operation type and the index relationship between the local language table and the internationalization table, and updating the data attributes after the operation processing in the internationalization table and storing them in the internationalization table.

2. The data processing method according to claim 1, characterized in that: The annotation content also indicates the operation parameters of the target method. The step of obtaining the annotation 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 annotation content also includes: when the operation type is a query operation, obtaining the data to be processed from the local language table according to the target method; when the operation type is a non-query operation, continuing to obtain the operation parameters of the target method, wherein the operation types include query operations, new operations, update operations and delete operations, and the operation parameters indicate the data to be processed corresponding to the non-query operation.

3. The data processing method according to claim 2, characterized in that: The step of obtaining the operation parameters of the target method includes: obtaining the corresponding operation parameters by performing reflection processing on the aspect class corresponding to the target method.

4. The data processing method according to claim 1, characterized in that: The internationalization table and the local language table are both stored in a storage device.

5. The data processing method according to claim 1, characterized in that: Before the step of performing corresponding operation processing on the data to be processed according to the operation type, the data processing method also includes: determining whether there is data to be processed with the same operation type, 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, characterized in that: In the case that the current language type of the access data is a local language, the data processing method further comprises: processing corresponding data in a local language table according to a target method corresponding to the access data.

7. The data processing method according to claim 1, characterized in that: The data processing method further includes: sending the processed data to an initiating object corresponding to the access data.

8. A data processing device, characterized in that: include: A data acquisition module, configured to receive access data, determine a current language type of the access data, and acquire access data whose current language type is a non-native language; a data determination module, used to obtain the annotation content of the target method corresponding to the access data, and determine the data to be processed in the local language table according to the annotation content, wherein the annotation content indicates the operation type of the target method; specifically used to obtain the target method corresponding to the access data by using aspect-oriented programming, and obtain the operation type of the target method; A data processing module is used to perform corresponding operation processing on the data to be processed according to the operation type, and update the data attributes after the operation processing and store them in the internationalization table, wherein the data attributes indicate the data content and current language type corresponding to the data to be processed; specifically, it is used to perform corresponding operation processing on the data to be processed and its corresponding data in the internationalization table according to the operation type and the index relationship between the local language table and the internationalization table, and update the data attributes after the operation processing in the internationalization table and store them in the internationalization table.

9. An electronic device, characterized in that: include: 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 implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and device for internationalizing databases and method and system for converting data

    CN103699655A

  • Multi-language-oriented data caching method and device

    CN110209695A