CN111125095B - Method, device, electronic equipment and medium for adding data prefix - Google Patents

Method, device, electronic equipment and medium for adding data prefix Download PDF

Info

Publication number
CN111125095B
CN111125095B CN201911170882.5A CN201911170882A CN111125095B CN 111125095 B CN111125095 B CN 111125095B CN 201911170882 A CN201911170882 A CN 201911170882A CN 111125095 B CN111125095 B CN 111125095B
Authority
CN
China
Prior art keywords
key value
target key
prefix information
configuration file
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911170882.5A
Other languages
Chinese (zh)
Other versions
CN111125095A (en
Inventor
张国栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Wenyuanjia Technology Co ltd
Original Assignee
Beijing Wenyuanjia Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Wenyuanjia Technology Co ltd filed Critical Beijing Wenyuanjia Technology Co ltd
Priority to CN201911170882.5A priority Critical patent/CN111125095B/en
Publication of CN111125095A publication Critical patent/CN111125095A/en
Application granted granted Critical
Publication of CN111125095B publication Critical patent/CN111125095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/20Education
    • G06Q50/205Education administration or guidance
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • Educational Technology (AREA)
  • Educational Administration (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Human Resources & Organizations (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method, a device, electronic equipment and a medium for adding a data prefix. In the application, after the key value parameters which correspond to the key values and are used for representing the prefix information in the Redis system are obtained, the target key value which does not contain the prefix information in the key values can be selected based on the key value parameters which correspond to the key values, and the corresponding prefix information is added for the target key value based on the configuration file which corresponds to the target key value. By applying the technical scheme of the application, when the key value without prefix information is detected to be contained in the Redis system, the prefix information stored in the configuration file can be added to the corresponding key value. And the problem of low efficiency of searching the target key value when facing to massive key values in the related technology can be avoided.

Description

Method, device, electronic equipment and medium for adding data prefix
Technical Field
The present application relates to data processing technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for adding a data prefix
Background
Due to the rise of the communications age and society, more and more people will choose to learn new knowledge in a way that utilizes network online education.
Among them, in online education of networks, a server-side solution based on a distributed caching technology is basically indispensable in order to cope with a solution of a large number of concurrent accesses. For example, for better service users, developers typically choose to utilize the Redis system to process data. Redis is an open-source, high-performance key-value store (Key-value store) system. All key values of Redis are stored in the memory, and the single-machine read-write performance is high. The Key value Key of the Redis not only includes a string (strings) type, but also includes data types such as hashes (hashes), lists (lists), collections (sets), and ordered collections (sorted sets).
However, in the process of using Redis by developers, a huge number of key values are often generated and each serves a corresponding service. Due to the large number, the problem of low query efficiency easily occurs when a developer queries the key value in the later period.
Disclosure of Invention
The embodiment of the application provides a method, a device, electronic equipment and a medium for adding a data prefix.
According to an aspect of the embodiment of the present application, a method for adding a data prefix is provided, which is characterized in that the method includes:
obtaining a key value parameter corresponding to at least one key value in a Redis system, wherein the key value parameter is used for representing prefix information corresponding to the key value;
selecting a target key value based on a key value parameter corresponding to the at least one key value, wherein the target key value is a key value which does not contain prefix information in the at least one key value;
and adding corresponding prefix information for the target key value based on the configuration file corresponding to the target key value.
Optionally, in another embodiment of the above method according to the present application, adding prefix information to the target key value based on the configuration file corresponding to the target key value includes:
acquiring a configuration file corresponding to the target key value;
detecting whether the configuration file contains first prefix information of the target key value or not;
and if so, adding the first prefix information to the corresponding target key value.
Optionally, in another embodiment of the above method according to the present application, after the detecting whether prefix information of the target key value is included in the configuration file, the method further includes:
and when the prefix information of the target key value is not contained in the configuration file, generating a restarting instruction, wherein the restarting instruction is used for prompting a user to add the prefix information corresponding to the target key value in the configuration file.
Optionally, in another embodiment of the above method according to the present application, the method further includes:
acquiring a service identifier corresponding to the target key value, wherein the service identifier is used for representing a service served by the target key value;
and detecting whether the configuration file contains second prefix information of the target key value or not based on the service identifier.
Optionally, in another embodiment of the above method according to the present application, it comprises:
detecting the number of service identifiers corresponding to the target key value;
when the number of the service identifiers exceeds the preset number, detecting whether the configuration file contains second prefix information of the target key value or not;
and if so, detecting the quantity of the second prefix information.
Optionally, in another embodiment of the above method according to the present application, the method further includes:
when the number of the second prefix information is detected to be lower than the preset number, generating the second prefix information with the preset number based on the service identifications, wherein each second prefix information corresponds to each service identification;
and adding the second prefix information with the preset quantity to the corresponding target key value.
Optionally, in another embodiment of the above method according to the present application, the method further includes:
and when a query instruction aiming at the target key value is received, acquiring the target key value based on prefix information corresponding to the target key value.
According to another aspect of the embodiment of the present application, there is provided an apparatus for adding a data prefix, including:
the acquisition module is configured to acquire a key value parameter corresponding to at least one key value in the Redis system, wherein the key value parameter is used for representing prefix information corresponding to the key value;
the selecting module is configured to select a target key value based on a key value parameter corresponding to the at least one key value, wherein the target key value is a key value which does not contain prefix information in the at least one key value;
and the adding module is used for adding corresponding prefix information for the target key value based on the configuration file corresponding to the target key value.
According to still another aspect of an embodiment of the present application, there is provided an electronic apparatus including:
a memory for storing executable instructions; and
and the display is used for displaying with the memory to execute the executable instructions so as to finish the operation of any data prefix adding method.
According to yet another aspect of an embodiment of the present application, there is provided a computer-readable storage medium storing computer-readable instructions that, when executed, perform the operations of any of the above-described methods of data prefix addition.
In the application, after the key value parameters which are corresponding to the key values and are used for representing the prefix information in the Redis system are obtained, the target key value which does not contain the prefix information in the key values can be selected based on the key value parameters corresponding to the key values, and the corresponding prefix information is added for the target key value based on the configuration file corresponding to the target key value. By applying the technical scheme of the application, when the key value without prefix information is detected to be contained in the Redis system, the prefix information stored in the configuration file can be added to the corresponding key value. And the problem of low efficiency of searching the target key value when facing to massive key values in the related technology can be avoided.
The technical scheme of the application is further described in detail through the drawings and the embodiments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description, serve to explain the principles of the application.
The application may be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a diagram illustrating a system architecture for data prefix addition according to the present application;
fig. 2 is a schematic diagram of a method for adding a data prefix according to the present application;
FIG. 3 is a schematic diagram of an apparatus for adding a data prefix according to the present application;
fig. 4 is a schematic diagram showing the structure of an electronic device according to the present application.
Detailed Description
At least one exemplary embodiment of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application unless it is specifically stated otherwise.
Also, it should be understood that the dimensions of at least one of the portions shown in the drawings are not drawn to actual scale for ease of description.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
In addition, the technical solutions of at least one embodiment of the present application may be combined with each other, but it is necessary that the technical solutions are based on the fact that those skilled in the art can implement the present application, and when the technical solutions are contradictory or cannot implement the present application, the combination of the technical solutions should be considered as not existing, and not falling within the scope of protection claimed by the present application.
It should be noted that, in the embodiments of the present application, all directional indicators (such as up, down, left, right, front, and rear … …) are merely used to explain a relative positional relationship, a movement condition, and the like between at least one member in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicator is correspondingly changed.
A method for performing data prefix addition according to an exemplary embodiment of the present application is described below with reference to fig. 1-2. It should be noted that the following application scenarios are only shown for facilitating understanding of the spirit and principles of the present application, and embodiments of the present application are not limited in this respect. Rather, embodiments of the application may be applied to any scenario where applicable.
The application also provides a method, a device, a target terminal and a medium for adding the data prefix.
Fig. 1 schematically shows a flow diagram of a method of data prefix addition according to an embodiment of the present application. As shown in fig. 1, the method includes:
s101, obtaining a key value parameter corresponding to at least one key value in the Redis system, wherein the key value parameter is used for representing prefix information corresponding to the key value.
In the present application, the device for obtaining the key value parameter corresponding to at least one key value in the Redis system is not specifically limited, and may be, for example, an intelligent device or a server. The smart device may be a PC (Personal Computer ), or may be a smart phone, tablet computer, e-book reader, MP3 (Moving Picture Experts Group AudioLayer III, dynamic image expert compression standard audio layer 3) data prefix adder. MP4 (Moving Picture ExpertsGroup Audio Layer IV, MPEG audio layer 4) data prefix adding device, portable computer and other mobile terminal equipment with display function.
Further, the Redis is an open-source non-relational database written in ANSI language, supporting network, memory-based, supporting persistent log-type, key-Value storage (Key-Value), and the corresponding Value (Value) stored in the Redis database can be obtained through Key name or Key master (Key). The traditional relational databases such as Oracle, mySQL and SQLServer are used for classifying complex data structures into binary relations, namely, two-dimensional table forms, and the operation on the data is built in one or more relational tables and realizes data processing through operations such as classification, merging, connection, selection and the like among tables.
In the context of online education of the internet, some data that is frequently displayed and/or not frequently changed need to be stored in a memory (or a storage service) that is a cache with a faster access speed, and Redis is often used for storing the data due to the advantages of Redis in terms of key factors such as resource convenience performance optimization. For example, in storing video data of a lecture, when a user obtains video of the lecture according to the user name (Identity) of both parties participating in the lecture, the curriculum information and the user information can be cached in Redis. For viewing by the user.
In the application, the key value parameter corresponding to at least one key value in the Redis system can be obtained, wherein the key value parameter is used for representing whether the corresponding key value has prefix information or not. It will be appreciated that there are a large number of Key values keys in the Redis system. There will be a key containing prefix information and there will also be a key not containing prefix information. In the application, the key value parameter corresponding to each key value in the Redis system can be traversed at first, so that the corresponding key value is selected according to the key value parameter later.
S102, selecting a target key value based on a key value parameter corresponding to at least one key value, wherein the target key value is a key value which does not contain prefix information in at least one key value.
The method aims to solve the problem that in the related art, the efficiency of searching the target key value is low when the target key value faces to a large number of key values. The application can acquire the target key value which does not contain prefix information in at least one key value based on the key value parameter corresponding to the at least one key value.
It should be noted that, the method of selecting the target key value is not specifically limited in the present application, for example, the key value containing prefix information may be screened out from at least one key value, so as to obtain the target key value. Or selecting a key value which does not contain prefix information from at least one key value, thereby obtaining the target key value.
S103, adding corresponding prefix information for the target key value based on the configuration file corresponding to the target key value.
Further, in the present application, in order to add corresponding prefix information to each target key value, a plurality of prefix information may be extracted from a configuration file generated in advance. And adds each prefix information correspondence to the target key value. To ensure that each target key value is assigned corresponding prefix information.
In the application, after the key value parameters which are corresponding to the key values and are used for representing the prefix information in the Redis system are obtained, the target key value which does not contain the prefix information in the key values can be selected based on the key value parameters corresponding to the key values, and the corresponding prefix information is added for the target key value based on the configuration file corresponding to the target key value. By applying the technical scheme of the application, when the key value without prefix information is detected to be contained in the Redis system, the prefix information stored in the configuration file can be added to the corresponding key value. And the problem of low efficiency of searching the target key value when facing to massive key values in the related technology can be avoided.
Alternatively, in one possible implementation manner of the present application, in S103 of the present application (prefix information is added to the target key value based on the configuration file corresponding to the target key value), the method may be generated as follows:
acquiring a configuration file corresponding to the target key value;
detecting whether the configuration file contains first prefix information of a target key value or not;
if included, the first prefix information is added to the corresponding target key value.
Further, in the present application, in order to add corresponding prefix information to each target key value, a plurality of prefix information may be extracted from a configuration file generated in advance. And adding each prefix information to the target key value correspondingly to ensure that each target key value is distributed with the corresponding prefix information.
Furthermore, the present application may first obtain a configuration file corresponding to the target key value, and find whether the configuration file contains the first prefix information of the target key value. It can be appreciated that when the first prefix information including the target key value in the configuration file is detected, the first prefix information can be added to the corresponding target key value.
Further optionally, when the configuration file does not contain the prefix information of the target key value, a restart instruction is generated, where the restart instruction is used to prompt the user to add the prefix information corresponding to the target key value in the configuration file.
When the first prefix information of the target key value is not contained in the configuration file, in order to ensure that each target key value is configured with the prefix information, the application can generate a restarting instruction for prompting a user to add the prefix information corresponding to the target key value in the configuration file. It can be understood that the method and the device can be used for displaying for the user in a preset mode after the restart instruction is generated. For example, the reminding mode is that a reminding icon is displayed in a voice broadcasting mode.
In a possible embodiment of the present application, after the step S102 of the present application (selecting the target key value based on the key value parameter corresponding to at least one key value), the present application further proposes a method for adding a data prefix, as shown in fig. 2, where the method includes:
s201, obtaining a key value parameter corresponding to at least one key value in the Redis system.
S202, selecting a target key value based on the key value parameter corresponding to at least one key value.
S203, obtaining a service identifier corresponding to the target key value, wherein the service identifier is used for representing the service served by the target key value.
Further, after the target key value which does not contain prefix information is obtained, the method and the device can simultaneously correspond to a plurality of service businesses due to the fact that a certain key value possibly exists. That is, when the user queries the key, a situation may occur that a false deletion occurs due to the unaware of the service in which the key is located. For example, when the target key value X corresponds to the service a, the service B and the service C at the same time, and the user does not know the service where the key value X is located, if the user deletes the service a and the service B where the key value X is located after determining that they are completed, the disadvantage that the service C cannot operate may occur.
Therefore, in order to avoid the problem of influencing the service efficiency caused by the existence of the target key value and the simultaneous correspondence of a plurality of services, the service identifier corresponding to the target key value can be acquired first. It can be understood that the service identifier is used for representing the service served by the target key value. For example, there may be storage traffic, analysis traffic, processing traffic, and the like.
In addition, the number of service identifiers is not specifically limited in the present application, and may be, for example, 1 or more.
In addition, the method for acquiring the service identifier is not particularly limited in the same way, for example, the service identifier can be set in a key value parameter of a target key value, and the service identifier can also be obtained by a user after inquiring information stored in a server.
S204, based on the service identification, whether the configuration file contains second prefix information of the target key value is detected.
Optionally, in the process of detecting whether the configuration file contains the second prefix information of the target key value based on the service identifier, the method can be obtained through the following steps:
detecting the number of service identifiers corresponding to the target key value;
when the number of the service identifiers exceeds the preset number, detecting whether the configuration file contains second prefix information of the target key value or not;
if so, detecting the number of the second prefix information.
Furthermore, the application can further detect the number of the service identifiers after the service identifiers corresponding to the target key values are obtained. And detecting whether the configuration file contains second prefix information with the number or not when the number of the service identifiers exceeds the preset number.
It should be noted that the preset number is not specifically limited in the present application, and may be, for example, 2, 5, or the like.
It can be understood that the reason why the present application further obtains the amount of the second prefix information is to avoid the problem that the service efficiency is affected due to the fact that the target key value corresponds to a plurality of services at the same time. In other words, when it is detected that a target key value exists while corresponding to a plurality of services, a plurality of prefix information needs to be added to the target key value later so that the user can know all the traffic of the key value service. This also avoids that when the user uses redis, different services use keys without prefixes, resulting in at least one service being intermixed, which is inconvenient to manage and govern key values.
S205, when the number of second prefix information is detected to be lower than the preset number, generating the preset number of second prefix information based on the service identifiers, where each second prefix information corresponds to each service identifier.
Further, in the present application, when the number of the second prefix information is detected to be lower than the preset number, the preset number of the second prefix information can be generated for the target key value. It should be noted that, each second prefix information corresponds to each service identifier.
Furthermore, the method for generating the second prefix information is not particularly limited, and for example, a plurality of corresponding second prefix information can be generated according to the service type and the random code technology corresponding to each service identifier. Alternatively, a plurality of corresponding second prefix information may be generated according to the service name and the random code technique corresponding to each service identifier. It should be noted that, the mode of generating the preset amount of the second prefix information is changed, so that the protection scope of the present application is not affected.
S206, adding the second prefix information with the preset quantity to the corresponding target key value.
Furthermore, after generating the second prefix information with the preset quantity based on the service identifier, the application can respectively and correspondingly add the second prefix information into the target key value of the sub-category. So that the user can know the business information of the key value service according to a plurality of pieces of second prefix information contained in the target key value when inquiring or managing the target key value later.
S207, when a query instruction for the target key value is received, the target key value is acquired based on prefix information corresponding to the target key value.
Further, after adding the second prefix information with preset quantity to the corresponding target key value, when receiving the query instruction aiming at the target key value, the application can acquire the corresponding target key value according to the prefix information of the target key value. To help the developer to increase efficiency in subsequent queries or management of target key values.
In the application, after the key value parameter which corresponds to at least one key value in the Redis system and is used for representing the prefix information is obtained, a target key value which does not contain the prefix information in the at least one key value can be selected based on the key value parameter which corresponds to the at least one key value, and the corresponding prefix information is added for the target key value based on the configuration file which corresponds to the target key value. By applying the technical scheme of the application, when the key value without prefix information is detected to be contained in the Redis system, the prefix information stored in the configuration file can be added to the corresponding key value. And the problem of low efficiency of searching the target key value when facing to massive key values in the related technology can be avoided.
In another embodiment of the present application, as shown in fig. 4, the present application further provides a device for adding a data prefix. The device comprises an acquisition module 301, a selection module 302 and an addition module 303, wherein:
the acquiring module 301 is configured to acquire a key value parameter corresponding to at least one key value in the Redis system, where the key value parameter is used to characterize prefix information corresponding to the key value;
a selecting module 302, configured to select a target key value based on a key value parameter corresponding to the at least one key value, where the target key value is a key value that does not include prefix information in the at least one key value;
and an adding module 303, configured to add corresponding prefix information to the target key value based on the configuration file corresponding to the target key value.
In the application, after the key value parameters which are corresponding to the key values and are used for representing the prefix information in the Redis system are obtained, the target key value which does not contain the prefix information in the key values can be selected based on the key value parameters corresponding to the key values, and the corresponding prefix information is added for the target key value based on the configuration file corresponding to the target key value. By applying the technical scheme of the application, when the key value without prefix information is detected to be contained in the Redis system, the prefix information stored in the configuration file can be added to the corresponding key value. And the problem of low efficiency of searching the target key value when facing to massive key values in the related technology can be avoided.
In another embodiment of the present application, the adding module 303 includes:
an adding module 303, configured to obtain a configuration file corresponding to the target key value;
an adding module 303, configured to detect whether the configuration file contains the first prefix information of the target key value;
the adding module 303 is configured to add, if included, the first prefix information to a corresponding target key value.
In another embodiment of the present application, the method further includes a generating module 304, where:
the generating module 304 is configured to generate a restart instruction when detecting that the configuration file does not contain the prefix information of the target key value, where the restart instruction is used to prompt a user to add prefix information corresponding to the target key value in the configuration file.
In another embodiment of the present application, the selecting module 302 further includes:
a selection module 302, configured to obtain a service identifier corresponding to the target key value, where the service identifier is used to characterize a service served by the target key value;
and the selecting module 302 is configured to detect whether the configuration file contains the second prefix information of the target key value based on the service identifier.
In another embodiment of the present application, the selecting module 302 further includes:
a selection module 302, configured to detect the number of service identifiers corresponding to the target key value;
a selecting module 302, configured to detect whether the configuration file contains second prefix information of the target key value when the number of the service identifiers exceeds a preset number;
the selecting module 302 is configured to detect the number of the second prefix information if included.
In another embodiment of the present application, the selecting module 302 further includes:
a selection module 302, configured to generate, based on the service identifier, the preset number of second prefix information when the number of second prefix information is detected to be lower than the preset number, where each second prefix information corresponds to each service identifier;
the selecting module 302 is configured to add the preset number of second prefix information to the corresponding target key value.
In another embodiment of the present application, the selecting module 302 further includes:
the selecting module 302 is configured to obtain the target key value based on prefix information corresponding to the target key value when a query instruction for the target key value is received.
Fig. 4 is a block diagram of a logic structure of an electronic device, according to an example embodiment. For example, electronic device 400 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 4, an electronic device 400 may include one or more of the following components: a processor 401 and a memory 402.
Processor 401 may include one or more processing cores such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 401 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 401 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 402 is used to store at least one instruction for execution by processor 401 to implement the interactive special effect calibration method provided by the method embodiments of the present application.
In some embodiments, the electronic device 400 may further optionally include: a peripheral interface 403 and at least one peripheral. The processor 401, memory 402, and peripheral interface 403 may be connected by a bus or signal line. The individual peripheral devices may be connected to the peripheral device interface 403 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 404, a touch display 405, a camera 406, audio circuitry 407, a positioning component 408, and a power supply 409.
Peripheral interface 403 may be used to connect at least one Input/Output (I/O) related peripheral to processor 401 and memory 402. In some embodiments, processor 401, memory 402, and peripheral interface 403 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 401, memory 402, and peripheral interface 403 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 404 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuitry 404 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 404 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 404 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 404 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 404 may also include NFC (Near Field Communication ) related circuitry, which is not limiting of the application.
The display screen 405 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 405 is a touch display screen, the display screen 405 also has the ability to collect touch signals at or above the surface of the display screen 405. The touch signal may be input as a control signal to the processor 401 for processing. At this time, the display screen 405 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 405 may be one, providing a front panel of the electronic device 400; in other embodiments, the display screen 405 may be at least two, and disposed on different surfaces of the electronic device 400 or in a folded design; in still other embodiments, the display 405 may be a flexible display disposed on a curved surface or a folded surface of the electronic device 400. Even more, the display screen 405 may be arranged in an irregular pattern that is not rectangular, i.e. a shaped screen. The display 405 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 406 is used to capture images or video. Optionally, camera assembly 406 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, camera assembly 406 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 407 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 401 for processing, or inputting the electric signals to the radio frequency circuit 404 for realizing voice communication. For purposes of stereo acquisition or noise reduction, the microphone may be multiple and separately disposed at different locations of the electronic device 400. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 401 or the radio frequency circuit 404 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 407 may also include a headphone jack.
The location component 408 is used to locate the current geographic location of the electronic device 400 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 408 may be a positioning component based on the united states GPS (Global Positioning System ), the beidou system of china, the grainer system of russia, or the galileo system of the european union.
The power supply 409 is used to power the various components in the electronic device 400. The power supply 409 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When power supply 409 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device 400 further includes one or more sensors 410. The one or more sensors 410 include, but are not limited to: acceleration sensor 411, gyroscope sensor 412, pressure sensor 413, fingerprint sensor 414, optical sensor 415, and proximity sensor 416.
The acceleration sensor 411 may detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the electronic device 400. For example, the acceleration sensor 411 may be used to detect components of gravitational acceleration on three coordinate axes. The processor 401 may control the touch display screen 405 to display a user interface in a lateral view or a longitudinal view according to the gravitational acceleration signal acquired by the acceleration sensor 411. The acceleration sensor 411 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 412 may detect a body direction and a rotation angle of the electronic device 400, and the gyro sensor 412 may collect a 3D motion of the user on the electronic device 400 in cooperation with the acceleration sensor 411. The processor 401 may implement the following functions according to the data collected by the gyro sensor 412: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 413 may be disposed at a side frame of the electronic device 400 and/or at an underlying layer of the touch screen 405. When the pressure sensor 413 is disposed on a side frame of the electronic device 400, a grip signal of the user on the electronic device 400 may be detected, and the processor 401 performs a left-right hand recognition or a shortcut operation according to the grip signal collected by the pressure sensor 413. When the pressure sensor 413 is disposed at the lower layer of the touch display screen 405, the processor 401 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 405. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 414 is used to collect a fingerprint of the user, and the processor 401 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 414, or the fingerprint sensor 414 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 401 to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, etc. The fingerprint sensor 414 may be provided on the front, back, or side of the electronic device 400. When a physical key or vendor Logo is provided on the electronic device 400, the fingerprint sensor 414 may be integrated with the physical key or vendor Logo.
The optical sensor 415 is used to collect the ambient light intensity. In one embodiment, the processor 401 may control the display brightness of the touch display screen 405 according to the ambient light intensity collected by the optical sensor 415. Specifically, when the intensity of the ambient light is high, the display brightness of the touch display screen 405 is turned up; when the ambient light intensity is low, the display brightness of the touch display screen 405 is turned down. In another embodiment, the processor 401 may also dynamically adjust the shooting parameters of the camera assembly 406 according to the ambient light intensity collected by the optical sensor 415.
A proximity sensor 416, also referred to as a distance sensor, is typically provided on the front panel of the electronic device 400. The proximity sensor 416 is used to collect distance between the user and the front of the electronic device 400. In one embodiment, when the proximity sensor 416 detects a gradual decrease in the distance between the user and the front of the electronic device 400, the processor 401 controls the touch display 405 to switch from the bright screen state to the off screen state; when the proximity sensor 416 detects that the distance between the user and the front surface of the electronic device 400 gradually increases, the processor 401 controls the touch display screen 405 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 4 is not limiting of the electronic device 400 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as memory 404, including instructions executable by processor 420 of electronic device 400 to perform a method of data prefix addition as described above, the method comprising: obtaining a key value parameter corresponding to at least one key value in a Redis system, wherein the key value parameter is used for representing prefix information corresponding to the key value; selecting a target key value based on a key value parameter corresponding to the at least one key value, wherein the target key value is a key value which does not contain prefix information in the at least one key value; and adding corresponding prefix information for the target key value based on the configuration file corresponding to the target key value. Optionally, the above instructions may also be executed by the processor 420 of the electronic device 400 to perform the other steps involved in the above-described exemplary embodiments. Optionally, the above instructions may also be executed by the processor 420 of the electronic device 400 to perform the other steps involved in the above-described exemplary embodiments. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In an exemplary embodiment, there is also provided an application/computer program product comprising one or more instructions executable by the processor 420 of the electronic device 400 to perform the above-described method of data prefix addition, the method comprising: obtaining a key value parameter corresponding to at least one key value in a Redis system, wherein the key value parameter is used for representing prefix information corresponding to the key value; selecting a target key value based on a key value parameter corresponding to the at least one key value, wherein the target key value is a key value which does not contain prefix information in the at least one key value; and adding corresponding prefix information for the target key value based on the configuration file corresponding to the target key value. Optionally, the above instructions may also be executed by the processor 420 of the electronic device 400 to perform the other steps involved in the above-described exemplary embodiments. Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (8)

1. A method of data prefix addition, comprising:
obtaining a key value parameter corresponding to at least one key value in a Redis system, wherein the key value parameter is used for representing prefix information corresponding to the key value;
selecting a target key value based on a key value parameter corresponding to the at least one key value, wherein the target key value is a key value which does not contain prefix information in the at least one key value;
adding corresponding prefix information for the target key value based on a configuration file corresponding to the target key value;
the adding corresponding prefix information for the target key value based on the configuration file corresponding to the target key value includes:
acquiring a configuration file corresponding to the target key value;
detecting whether the configuration file contains first prefix information of the target key value or not;
if included, adding the first prefix information to a corresponding target key value, and,
acquiring a service identifier corresponding to the target key value, wherein the service identifier is used for representing a service served by the target key value;
and detecting whether the configuration file contains second prefix information of the target key value or not based on the service identifier.
2. The method as recited in claim 1, further comprising:
and when the prefix information of the target key value is not contained in the configuration file, generating a restarting instruction, wherein the restarting instruction is used for prompting a user to add the prefix information corresponding to the target key value in the configuration file.
3. The method of claim 1, wherein the detecting whether the configuration file contains the second prefix information of the target key value based on the service identification comprises:
detecting the number of service identifiers corresponding to the target key value;
when the number of the service identifiers exceeds the preset number, detecting whether the configuration file contains second prefix information of the target key value or not;
and if so, detecting the quantity of the second prefix information.
4. A method as recited in claim 3, further comprising:
when the number of the second prefix information is detected to be lower than the preset number, generating the second prefix information with the preset number based on the service identifications, wherein each second prefix information corresponds to each service identification;
and adding the second prefix information with the preset quantity to the corresponding target key value.
5. The method of any one of claims 1-4, further comprising:
and when a query instruction aiming at the target key value is received, acquiring the target key value based on prefix information corresponding to the target key value.
6. An apparatus for adding a data prefix, comprising:
the acquisition module is configured to acquire a key value parameter corresponding to at least one key value in the Redis system, wherein the key value parameter is used for representing prefix information corresponding to the key value;
the selecting module is configured to select a target key value based on a key value parameter corresponding to the at least one key value, wherein the target key value is a key value which does not contain prefix information in the at least one key value;
the adding module is used for adding corresponding prefix information for the target key value based on the configuration file corresponding to the target key value;
the adding module is specifically configured to:
acquiring a configuration file corresponding to the target key value;
detecting whether the configuration file contains first prefix information of the target key value or not;
if included, adding the first prefix information to a corresponding target key value, and,
acquiring a service identifier corresponding to the target key value, wherein the service identifier is used for representing a service served by the target key value;
and detecting whether the configuration file contains second prefix information of the target key value or not based on the service identifier.
7. An electronic device, comprising:
a memory for storing executable instructions; the method comprises the steps of,
a processor operative to display with the memory to execute the executable instructions to perform the operations of the method of data prefix addition of any of claims 1-5.
8. A computer readable storage medium storing computer readable instructions which, when executed, perform the operations of the method of data prefix addition of any of claims 1-5.
CN201911170882.5A 2019-11-26 2019-11-26 Method, device, electronic equipment and medium for adding data prefix Active CN111125095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911170882.5A CN111125095B (en) 2019-11-26 2019-11-26 Method, device, electronic equipment and medium for adding data prefix

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911170882.5A CN111125095B (en) 2019-11-26 2019-11-26 Method, device, electronic equipment and medium for adding data prefix

Publications (2)

Publication Number Publication Date
CN111125095A CN111125095A (en) 2020-05-08
CN111125095B true CN111125095B (en) 2023-11-10

Family

ID=70496679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911170882.5A Active CN111125095B (en) 2019-11-26 2019-11-26 Method, device, electronic equipment and medium for adding data prefix

Country Status (1)

Country Link
CN (1) CN111125095B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860782B (en) * 2022-07-04 2022-10-28 北京世纪好未来教育科技有限公司 Data query method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199957A (en) * 2014-09-17 2014-12-10 合一网络技术(北京)有限公司 Redis universal agent implementation method
CN107357794A (en) * 2016-05-10 2017-11-17 北京京东尚科信息技术有限公司 Optimize the method and apparatus of the data store organisation of key value database
CN107688611A (en) * 2017-08-03 2018-02-13 杭州铭师堂教育科技发展有限公司 A kind of Redis key assignments management system and method based on saltstack

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10496283B2 (en) * 2016-01-22 2019-12-03 Suraj Prabhakar WAGHULDE Adaptive prefix tree based order partitioned data storage system
US11016932B2 (en) * 2017-09-21 2021-05-25 Alibaba Group Holding Limited Systems, methods, and apparatuses for simplifying filesystem operations utilizing a key-value storage system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199957A (en) * 2014-09-17 2014-12-10 合一网络技术(北京)有限公司 Redis universal agent implementation method
CN107357794A (en) * 2016-05-10 2017-11-17 北京京东尚科信息技术有限公司 Optimize the method and apparatus of the data store organisation of key value database
CN107688611A (en) * 2017-08-03 2018-02-13 杭州铭师堂教育科技发展有限公司 A kind of Redis key assignments management system and method based on saltstack

Also Published As

Publication number Publication date
CN111125095A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN110841285B (en) Interface element display method and device, computer equipment and storage medium
CN111104402A (en) Method, device, electronic equipment and medium for searching data
CN109902089B (en) Query method and device using heterogeneous index, electronic equipment and medium
CN112052354A (en) Video recommendation method, video display method and device and computer equipment
CN113032587B (en) Multimedia information recommendation method, system, device, terminal and server
CN111192072A (en) User grouping method and device and storage medium
CN110471614B (en) Method for storing data, method and device for detecting terminal
CN110597801B (en) Database system and establishing method and device thereof
CN111475611B (en) Dictionary management method, dictionary management device, computer equipment and storage medium
CN110737692A (en) data retrieval method, index database establishment method and device
CN110853124B (en) Method, device, electronic equipment and medium for generating GIF dynamic diagram
CN111125095B (en) Method, device, electronic equipment and medium for adding data prefix
CN111428080B (en) Video file storage method, video file search method and video file storage device
CN112925922A (en) Method, device, electronic equipment and medium for obtaining address
CN113051485B (en) Group searching method, device, terminal and storage medium
CN113204724B (en) Method, device, electronic equipment and storage medium for creating interaction information
CN115134316B (en) Topic display method, device, terminal and storage medium
CN114329292A (en) Resource information configuration method and device, electronic equipment and storage medium
CN110717110B (en) Multimedia resource filtering method and device, electronic equipment and storage medium
CN112560472B (en) Method and device for identifying sensitive information
CN110968549B (en) File storage method, device, electronic equipment and medium
CN111191254B (en) Access verification method, device, computer equipment and storage medium
CN109918566B (en) Query method, query device, electronic equipment and medium
CN110928867B (en) Data fusion method and device
CN111641853A (en) Multimedia resource loading method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant