Data processing method, device and electronic equipment
By receiving and converting native command data of the Redis system and generating target command data, data redundancy and exception problems are solved, and the processing effect of the data processing system is improved.
Patent Information
- Application Number
- CN202110084208.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-21
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-01-21
AI Technical Summary
The Redis data synchronization method in the prior art may lead to problems of data redundancy and data exceptions.
By receiving native command data sent by the client, we judge whether conversion is needed, convert according to the command type and generate target command data, and store target command data to improve the processing effect of the data processing system.
Effectively reduce data redundancy, optimize data abnormalities, and improve the processing efficiency and accuracy of data processing systems.
Smart Images

Figure CN114817383B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art
[0002] Currently, Redis is a widely used NoSQL database, applicable in caching systems, counters, message queue systems, leaderboards, social networks, and real-time systems. Redis uses a master-slave data synchronization method to ensure inter-node data synchronization. For example, the Redis Serialization Protocol (RESP) can be used to implement master-slave data synchronization. However, this method can lead to problems such as data redundancy and data anomalies. Summary of the Invention
[0003] This application aims to solve, at least to a certain extent, one of the technical problems of data redundancy and data anomaly in the related art.
[0004] To this end, a first embodiment of the present application proposes a data processing method, which receives native command data for a data processing system sent by a client, obtains a native command data set that requires conversion, determines whether the native command data set includes the native command data, and if so, converts the native command data to generate target command data, and stores the target command data. Thus, by determining whether the native command data set includes the native command data, it is determined whether the native command data set requires conversion; if so, the native command data set requires conversion to generate target command data, thereby converting the native command data that requires conversion, thereby improving the processing effect of command data in the data processing system.
[0005] A second embodiment of the present application provides a data processing device.
[0006] A third embodiment of the present application provides an electronic device.
[0007] The fourth embodiment of the present application proposes a computer-readable storage medium.
[0008] The first aspect of the present application proposes a data processing method, including: receiving native command data for a data processing system sent by a client; obtaining a native command data set that needs to be converted; determining whether the native command data set includes the native command data; if the native command data set includes the native command data, converting the native command data to generate target command data; and storing the target command data.
[0009] According to the data processing method of an embodiment of the present application, native command data for a data processing system sent by a client is received, a native command data set that needs to be converted is obtained, and it is determined whether the native command data set includes the native command data. If the native command data set includes the native command data, the native command data is converted to generate target command data, and the target command data is stored. Thus, by determining whether the native command data set includes the native command data, it is determined whether the native command data is converted. If the native command data set includes the native command data, the native command data is converted to generate target command data, thereby converting the native command data that needs to be converted, which helps improve the processing effect of command data in the data processing system.
[0010] In addition, the data processing method according to the above embodiment of the present application may also have the following additional technical features:
[0011] In one embodiment of the present application, the converting of the native command data to generate target command data includes: identifying the command type of the native command data based on a keyword of the native command data; and converting the native command data based on the command type to generate target command data.
[0012] In one embodiment of the present application, the native command data is converted based on the command type to generate target command data, including: obtaining a mapping relationship corresponding to the command type, wherein the mapping relationship includes the native command data to be converted and the converted command data under the command type; and obtaining the converted command data that matches the native command data from the mapping relationship as the target command data.
[0013] In one embodiment of the present application, storing the target command data includes: writing the target command data into a copy buffer of a memory; and sending the target command data to a slave node for storage.
[0014] In one embodiment of the present application, the storing of the target command data further includes: in response to the data processing system being configured with an additional file AOF, writing the target command data into the AOF.
[0015] In one embodiment of the present application, after receiving native command data for the data processing system sent by the client, it also includes: obtaining the data to be stored from the native command data; establishing a mapping relationship between the data to be stored and storing it in the memory.
[0016] The second aspect embodiment of the present application proposes a data processing device, including: a receiving module, used to receive native command data for a data processing system sent by a client; an acquisition module, used to obtain a native command data set that needs to be converted; a conversion module, used to determine whether the native command data set includes the native command data, and if the native command data set includes the native command data, convert the native command data to generate target command data; a first storage module, used to store the target command data.
[0017] The data processing device of an embodiment of the present application receives native command data for a data processing system sent by a client, obtains a native command data set that requires conversion, determines whether the native command data set includes the native command data, and if so, converts the native command data to generate target command data, and stores the target command data. Thus, by determining whether the native command data set includes the native command data, it is determined whether the native command data set requires conversion. If the native command data set includes the native command data, the native command data is converted to generate target command data, thereby converting the native command data that requires conversion, thereby improving the processing effect of command data in the data processing system.
[0018] In addition, the data processing device according to the above embodiment of the present application may also have the following additional technical features:
[0019] In one embodiment of the present application, the conversion module includes: an identification unit for identifying the command type of the native command data based on a keyword of the native command data; and a conversion unit for converting the native command data based on the command type to generate target command data.
[0020] In one embodiment of the present application, the conversion unit is specifically used to: obtain a mapping relationship corresponding to the command type, wherein the mapping relationship includes the native command data to be converted and the converted command data under the command type; and obtain the converted command data that matches the native command data from the mapping relationship as the target command data.
[0021] In one embodiment of the present application, the first storage module is specifically used to: write the target command data into a copy buffer of the memory; and send the target command data to the slave node for storage.
[0022] In one embodiment of the present application, the first storage module is further configured to: in response to the data processing system being configured with an additional file AOF, write the target command data into the AOF.
[0023] In one embodiment of the present application, it further includes: a second storage module, which is used to: obtain the data to be stored from the native command data; establish a mapping relationship between the data to be stored and store it in the memory.
[0024] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the data processing method described in the first aspect of the present application is implemented.
[0025] The electronic device of an embodiment of the present application executes a computer program stored in a memory via a processor, receives native command data for a data processing system sent by a client, obtains a native command data set that needs to be converted, determines whether the native command data set includes the native command data, and if so, converts the native command data to generate target command data, and stores the target command data. Thus, by determining whether the native command data set includes the native command data, determining whether to convert the native command data, and if so, converting the native command data to generate target command data, the native command data can be converted, thereby improving the processing effect of command data in the data processing system.
[0026] The fourth embodiment of the present application proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the data processing method described in the first embodiment is implemented.
[0027] The computer-readable storage medium of an embodiment of the present application stores a computer program and is executed by a processor, receives native command data for a data processing system sent by a client, obtains a native command data set that needs to be converted, determines whether the native command data set includes the native command data, and if so, converts the native command data to generate target command data, and stores the target command data. Thus, by determining whether the native command data set includes the native command data, determining whether to convert the native command data, and if so, converting the native command data to generate target command data, the native command data can be converted, thereby helping to improve the processing effect of command data in the data processing system.
[0028] Additional aspects and advantages of the present application will be given in part in the following description and in part will become obvious from the following description or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0030] Figure 1 1 is a flow chart of a data processing method according to an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a process for converting native command data to generate target command data in a data processing method according to an embodiment of the present application;
[0032] Figure 3 1 is a structural diagram of a data processing device according to an embodiment of the present application;
[0033] Figure 4 is a structural diagram of a data processing device according to another embodiment of the present application; and
[0034] Figure 5 Schematic diagram of the structure of an electronic device according to one embodiment of the present application. DETAILED DESCRIPTION
[0035] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0036] The data processing method, device, electronic device, and storage medium of the embodiments of the present application are described below with reference to the accompanying drawings.
[0037] Figure 1 The figure is a flowchart of a data processing method according to an embodiment of the present application.
[0038] like Figure 1 As shown, the data processing method of the embodiment of the present application includes:
[0039] S101, receiving native command data for a data processing system sent by a client.
[0040] It should be noted that the execution subject of the data processing method of the embodiment of the present application may be a data processing device, and the data processing device of the embodiment of the present application may be configured in any electronic device so that the electronic device can execute the data processing method of the embodiment of the present application. Among them, the electronic device may be a personal computer (PC), a cloud device, a mobile device, etc., and the mobile device may be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a vehicle-mounted device, or other hardware device with various operating systems, touch screens and / or display screens. Optionally, the execution subject of the data processing method of the embodiment of the present application may be a remote dictionary server (Remote Dictionary Server, Redis) system.
[0041] In an embodiment of the present application, native command data for a data processing system sent by a client may be received. It is understood that the data processing system may be a database, such as a Redis database, and the native command data includes native commands and data corresponding to the native commands.
[0042] It should be noted that in the embodiments of the present application, the content and format of the native command data are not limited. For example, the native command data may be in a binary data format or in a command + data format. For example, the native command data may be in the SET Key Value data format, where SET is the command keyword, and Key and Value are the command data. For example, suppose the native command data is SET hello world, where SET is the command keyword, hello is the value corresponding to Key, and world is the value corresponding to Value.
[0043] S102: Obtain a native command data set that needs to be converted.
[0044] Optionally, the native command data set that needs to be converted can be set according to actual conditions. It can be understood that the native command data set includes at least one native command data that needs to be converted.
[0045] S103: Determine whether the native command data set includes native command data. If so, convert the native command data to generate target command data. In an embodiment of the present application, determine whether the native command data set includes native command data. If so, it indicates that the native command data needs to be converted. Then, convert the native command data to generate target command data.
[0046] As another possible implementation, if the native command data set does not include the native command data, it indicates that the native command data does not need to be converted, and the native command data may not be converted.
[0047] Optionally, converting the native command data to generate target command data may include converting the native command data to generate first target command data in response to the native command data being first native command data that does not meet a preset condition, and not transmitting and storing the first target command data.
[0048] It is understood that if the native command data is first native command data that does not meet the preset conditions, the native command data can be directly ignored and not transmitted or stored. Therefore, if the native command data is first native command data that does not meet the preset conditions, the native command data can be converted into first target command data and the first target command data is not transmitted or stored. This can effectively solve the data redundancy and excessive traffic problems of related art data processing systems and help save computing resources of the data processing system.
[0049] Optionally, converting the native command data to generate target command data may include converting the native command data to generate second target command data in response to the native command data being abnormal.
[0050] It is understood that when the native command data is abnormal second native command data, the abnormal native command data can be converted into normal second target command data. Thus, if the native command data is abnormal first native command data, it can be converted into normal second target command data, thereby optimizing the native command data, effectively resolving data anomalies in the data processing system, and preventing the formation of dirty data.
[0051] S104, storing target command data.
[0052] It will be appreciated that the target command data may be stored for subsequent use.
[0053] In summary, according to the data processing method of the embodiment of the present application, native command data for a data processing system sent by a client is received, a native command data set that needs to be converted is obtained, and a determination is made as to whether the native command data set includes the native command data. If the native command data set includes the native command data, the native command data is converted to generate target command data, and the target command data is stored. Thus, by determining whether the native command data set includes the native command data, it is determined whether the native command data needs to be converted. If the native command data set includes the native command data, the native command data is converted to generate target command data. Thus, the native command data that needs to be converted can be converted, which helps improve the processing effect of command data in the data processing system.
[0054] Based on any of the above embodiments, Figure 2 As shown, in step S103, the native command data is converted to generate target command data, which may include:
[0055] S201 : Identify the command type of the native command data according to a keyword of the native command data.
[0056] In the embodiment of the present application, the command type of the native command data can be identified based on the keywords of the native command data. It is understandable that the native command data carries keywords, and different keywords can correspond to different command types.
[0057] For example, the native command data may be in the data format of SETNX Key Value, where SETNX is a keyword, identifying the command type of the native command data as a String type. Alternatively, the native command data may be in the data format of HSETNX KeyField Value, where HSETNX is a keyword, identifying the command type of the native command data as a Hash type. Alternatively, the native command data may be in the data format of PEXPIRE Key Milliseconds, where PEXPIRE is a keyword, identifying the command type of the native command data as a Key type.
[0058] Optionally, a mapping relationship or mapping table between keywords in the native command data and command types can be pre-established. After obtaining the keywords in the native command data, the mapping relationship or mapping table can be queried to determine the command type corresponding to the keyword. It should be noted that the above mapping relationship or mapping table can be set according to actual circumstances.
[0059] S202: Convert the native command data based on the command type to generate target command data.
[0060] In the embodiment of the present application, the native command data may be converted based on the command type to generate the target command data. It is understandable that different command types may correspond to different conversion methods.
[0061] Optionally, converting native command data based on the command type to generate target command data may include obtaining a mapping relationship corresponding to the command type, wherein the mapping relationship includes the native command data to be converted and the converted command data under the command type, and obtaining the converted command data that matches the native command data from the mapping relationship as the target command data. Thus, the method can pre-set a mapping relationship between the native command data to be converted and the converted command data corresponding to the command type, and then, based on the mapping relationship, obtain the converted command data that matches the native command data as the target command data, thereby converting the native command data into the target command data.
[0062] Optionally, the mapping relationship corresponding to the command type can be set according to actual conditions. For example, the mapping relationship corresponding to the command type can be set with reference to Table 1.
[0063] Table 1
[0064]
[0065] As shown in Table 1, command types can include String, Hash, and Key. Each command type can correspond to at least one mapping relationship between the native command data to be converted and the converted command data. For example, if the original command data is SETNXhelloworld, the command type of the native command data can be identified as String based on the keyword SETNX, and the mapping relationship corresponding to the String type can be obtained. The converted command data matching SETNXhelloworld can be obtained from the mapping relationship. As shown in Table 1, the converted command data matching SETNXhelloworld is NOTHING or SEThelloworld. NOTHING or SEThelloworld can be used as the target command data.
[0066] Therefore, the method can identify the command type of the native command data according to the keyword of the native command data, and convert the native command data based on the command type to generate target command data, so as to realize the conversion of the native command data into target command data.
[0067] Based on any of the above embodiments, after receiving the native command data for the data processing system sent by the client in step S101, it also includes obtaining the data to be stored from the native command data, establishing a mapping relationship between the data to be stored and storing it in the memory, thereby storing the mapping relationship between the data to be stored in the native command data in the memory.
[0068] For example, the native command data obtained is SET hello world, where SET is the command keyword, hello is the value corresponding to Key, and world is the value corresponding to Value. The data to be stored can be hello and world obtained from the native command data, and a mapping relationship between hello and world can be established and stored in the memory. Alternatively, if the native command data obtained is SET hello beijing, a mapping relationship between hello and beijing can be established and stored in the memory.
[0069] Therefore, this method can obtain the data to be stored from the native command data, establish a mapping relationship between the data to be stored and store it in the memory. Compared with directly storing the data to be stored in the memory, storing the mapping relationship between the data to be stored in the memory can improve storage efficiency.
[0070] Based on any of the above embodiments, storing the target command data in step S104 includes writing the target command data into a copy buffer of the memory and sending the target command data to the slave node for storage.
[0071] It can be understood that a master node may correspond to a unique memory copy buffer, and writing target command data into the memory copy buffer may help improve data processing efficiency.
[0072] It can be understood that a master node may correspond to at least one slave node, and sending the target command data to the slave node for storage may include sending the target command data to all corresponding slave nodes for storage, so that the slave node can obtain and store the target command data to ensure data synchronization between the master node and the slave node.
[0073] Therefore, this method can write the target command data into the copy buffer of the memory, which helps to improve the data processing efficiency. It can also send the target command data to the slave node for storage, so that the slave node can obtain and store the target command data to ensure data synchronization between the master node and the slave node.
[0074] Based on any of the above embodiments, storing the target command data in step S104 may further include writing the target command data into an append only file (AOF) in response to the data processing system being configured with the AOF.
[0075] It is understood that the AOF configuration can be obtained based on the system configuration of the data processing system. Generally, the AOF is disabled by default when the data processing system is started, and can be manually enabled in the data processing system configuration file. The AOF configuration can be dynamically modified during operation of the data processing system. For example, the AOF configuration of the data processing system can be set by receiving a CONFIG SETAPPENDONLY yes / no command sent by the client.
[0076] Therefore, the method can write the target command data into the AOF when the data processing system is configured with an additional file AOF, so as to ensure that the target command data is stored in the AOF, which is convenient for data recovery.
[0077] With the above Figures 1 to 2 Corresponding to the data processing method provided in the embodiment, the present disclosure also provides a data processing device. Since the data processing device provided in the embodiment of the present disclosure is consistent with the above Figures 1 to 2 The data processing method provided in the embodiment corresponds to the embodiment, so the implementation of the data processing method is also applicable to the data processing device provided in the embodiment of the present disclosure, and will not be described in detail in the embodiment of the present disclosure.
[0078] Figure 3 Schematic diagram of the structure of a data processing device according to an embodiment of the present application.
[0079] like Figure 3 As shown, the data processing device 100 of the embodiment of the present application may include: a receiving module 110 , an acquisition module 120 , a conversion module 130 , and a first storage module 140 .
[0080] The receiving module 110 is configured to receive native command data sent by the client to the data processing system;
[0081] An acquisition module 120 is used to acquire a native command data set that needs to be converted;
[0082] a conversion module 130, configured to determine whether the native command data set includes the native command data, and if so, convert the native command data to generate target command data;
[0083] The first storage module 140 is configured to store the target command data.
[0084] In one embodiment of the present application, Figure 4 As shown, the conversion module 130 includes: an identification unit 1301, which is used to identify the command type of the native command data according to the keyword of the native command data; a conversion unit 1302, which is used to convert the native command data based on the command type to generate target command data.
[0085] In one embodiment of the present application, the conversion unit 1302 is specifically used to: obtain a mapping relationship corresponding to the command type, wherein the mapping relationship includes the native command data to be converted and the converted command data under the command type; and obtain the converted command data that matches the native command data from the mapping relationship as the target command data.
[0086] In one embodiment of the present application, the first storage module 140 is specifically configured to: write the target command data into a copy buffer of a memory; and send the target command data to a slave node for storage.
[0087] In one embodiment of the present application, the first storage module 140 is further configured to: in response to the data processing system being configured with an additional file AOF, write the target command data into the AOF.
[0088] In one embodiment of the present application, Figure 4 As shown, the data processing device 100 further includes: a second storage module 150, which is used to: obtain the data to be stored from the native command data; establish a mapping relationship between the data to be stored and store it in the memory.
[0089] The data processing device of an embodiment of the present application receives native command data for a data processing system sent by a client, obtains a native command data set that requires conversion, determines whether the native command data set includes the native command data, and if so, converts the native command data to generate target command data, and stores the target command data. Thus, by determining whether the native command data set includes the native command data, it is determined whether the native command data set requires conversion. If the native command data set includes the native command data, the native command data is converted to generate target command data, thereby converting the native command data that requires conversion, thereby improving the processing effect of command data in the data processing system.
[0090] In order to implement the above embodiment, Figure 5 As shown, the present application also proposes an electronic device 200, comprising: a memory 210, a processor 220, and a computer program stored in the memory 210 and executable on the processor 220. When the processor 220 executes the program, it implements the data processing method proposed in the aforementioned embodiment of the present application.
[0091] The electronic device of an embodiment of the present application executes a computer program stored in a memory via a processor, receives native command data for a data processing system sent by a client, obtains a native command data set that needs to be converted, determines whether the native command data set includes the native command data, and if so, converts the native command data to generate target command data, and stores the target command data. Thus, by determining whether the native command data set includes the native command data, determining whether to convert the native command data, and if so, converting the native command data to generate target command data, the native command data can be converted, thereby improving the processing effect of command data in the data processing system.
[0092] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the data processing method proposed in the above embodiments of the present application is implemented.
[0093] The computer-readable storage medium of an embodiment of the present application stores a computer program and is executed by a processor, receives native command data for a data processing system sent by a client, obtains a native command data set that needs to be converted, determines whether the native command data set includes the native command data, and if so, converts the native command data to generate target command data, and stores the target command data. Thus, by determining whether the native command data set includes the native command data, determining whether to convert the native command data, and if so, converting the native command data to generate target command data, the native command data can be converted, thereby helping to improve the processing effect of command data in the data processing system.
[0094] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.
[0095] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0096] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0097] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.
[0098] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0099] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0100] In addition, the functional units in the various embodiments of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into a module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0101] The storage medium mentioned above may be a read-only memory, a magnetic disk, or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
Claims
1. A data processing method, characterized in that: include: Receive native command data sent by a client to a data processing system, wherein the data processing system is a Redis database; Get the native command dataset that needs to be converted; determining whether the native command data set includes the native command data, and if the native command data set includes the native command data, converting the native command data to generate target command data; storing the target command data; The converting the native command data to generate target command data includes: identifying a command type of the native command data according to a keyword of the native command data; Based on the command type, convert the native command data to generate target command data; Get the mapping relationship corresponding to the command type, where: The mapping relationship includes the native command data to be converted and the converted command data under the command type, and the mapping relationship of each command type is that multiple native command data to be converted corresponds to one converted command data and / or one native command data to be converted corresponds to one converted command data; Acquire, from the mapping relationship, the converted command data that matches the native command data as the target command data; The converting the native command data to generate target command data further includes: In response to the native command data being first native command data that does not meet a preset condition, the native command data is converted to generate first target command data, and the first target command data is not transmitted or stored.
2. The data processing method according to claim 1, wherein: The storing of the target command data comprises: Writing the target command data into a copy buffer of the memory; The target command data is sent to the slave node for storage.
3. The data processing method according to claim 2, characterized in that: The storing of the target command data further comprises: In response to the data processing system being configured with an append-only file (AOF), the target command data is written into the AOF.
4. The data processing method according to claim 1, wherein: After receiving the native command data for the data processing system sent by the client, the method further includes: Acquire data to be stored from the native command data; A mapping relationship between the data to be stored is established and stored in the memory.
5. A data processing device, characterized in that: include: A receiving module, configured to receive native command data sent by a client to a data processing system, wherein the data processing system is a Redis database; The acquisition module is used to obtain the native command data set that needs to be converted; a conversion module, configured to determine whether the native command data set includes the native command data, and if the native command data set includes the native command data, convert the native command data to generate target command data; A first storage module, configured to store the target command data; The conversion module is specifically used to: identifying a command type of the native command data according to a keyword of the native command data; Obtaining a mapping relationship corresponding to the command type, wherein the mapping relationship includes native command data to be converted and converted command data under the command type, and the mapping relationship for each command type is that multiple native command data to be converted corresponds to one type of converted command data and / or one type of native command data to be converted corresponds to one type of converted command data; Acquire, from the mapping relationship, the converted command data that matches the native command data as the target command data; The conversion module is further configured to: In response to the native command data being first native command data that does not meet a preset condition, the native command data is converted to generate first target command data, and the first target command data is not transmitted or stored.
6. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method implements the data processing method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data processing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
System interaction method and device, apparatus and storage medium
CN110245002A