A user index information storage method, device, storage medium and server
By creating a mapping relationship between the data source table and the indicator data table in the user indicator storage system, the problem of duplicate writes in user indicator storage is solved, achieving more efficient storage and resource utilization.
Patent Information
- Application Number
- CN202210489713.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-06
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-05-06
AI Technical Summary
In existing technologies, the same business object is repeatedly written when storing user metrics, resulting in reduced storage speed and wasted resources.
By creating a mapping relationship between the data source table and the indicator data table, the duplicate writing of business object information is avoided. User indicator information is stored in a row-by-row recording manner, and a mapping relationship between user identity and business object is established.
It improves storage speed, avoids repeated writing of object information, saves writing resources, and enhances storage efficiency.
Smart Images

Figure CN114969032B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computers, in particular to a user index information storage method and device, a computer readable storage medium and a server. BACKGROUND
[0002] A user index is data describing the behavior characteristics of a user group in a specific system, and to some extent, it reveals the behavior and habits of users in the business system. Business system data is diverse and complex. Through relevant technical means, these data are analyzed in multiple aspects and dimensions to fully exploit the data's own value. Then, through operation, marketing and other means, positive feedback is given to business applications to expand the user group and quantity of the system, increase revenue and other enterprise activities, which is extremely valuable data. By collecting and analyzing logs, data and other content generated by the business system, user index data can be obtained.
[0003] In the prior art, when storing user indexes, the object information of the business object to which the user index belongs is written together with the user index, so that the business object to which each user index belongs can be known for subsequent user index analysis.
[0004] In the process of research and practice of the prior art, the inventors of the present application found that in the prior art, a business object generates user indexes in the order of millions or even billions, and many user indexes belong to the same business object, which causes repeated writing of object information when storing user indexes, reduces the storage rate, and wastes writing resources. SUMMARY
[0005] The embodiments of the present application provide a user index information storage method and device, which can avoid repeated writing of object information of user indexes belonging to the same business object when storing, improve the storage rate, and avoid wasting writing resources.
[0006] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0007] A user index information storage method comprises:
[0008] Obtaining user index information to be stored, user identity information corresponding to the user index information, and object information of a first business object to which the user index information belongs;
[0009] If the user index information of the first business object has not been stored in the storage system, creating a first data source table and a first index data table;
[0010] Storing the object information of the first business object to the first data source table;
[0011] store the user index information into the first index data table according to the user identity identification information;
[0012] generate mapping relationship information between the first data source table and the first index data table based on the user identity identification information and object information of the first service object.
[0013] A user index information storage device, comprising:
[0014] an acquisition module, configured to acquire user index information to be stored, user identity identification information corresponding to the user index information, and object information of a first service object to which the user index information belongs;
[0015] a creation module, configured to create a first data source table and a first index data table if the user index information of the first service object has not been stored in a storage system;
[0016] a first storage module, configured to store the object information of the first service object into the first data source table;
[0017] a second storage module, configured to store the user index information into the first index data table according to the user identity identification information;
[0018] a generation module, configured to generate mapping relationship information between the first data source table and the first index data table based on the user identity identification information and object information of the first service object.
[0019] In some embodiments, the object information comprises object type and object content of the first service object, the user identity identification information comprises identity identification type and identity identification content, and the generation module comprises:
[0020] a first generation submodule, configured to generate a first identification code based on the object type and the object content;
[0021] a second generation submodule, configured to generate a first association number based on the object type, the object content, the identity identification type, and the identity identification content;
[0022] a third generation submodule, configured to generate the mapping relationship information between the first data source table and the first index data table according to the first identification code and the first association number.
[0023] In some embodiments, the third generation submodule is configured to:
[0024] create and store a first relationship mapping table;
[0025] write the first identification code into the first data source table and the first relationship mapping table;
[0026] write the first association number into the first index data table and the first relationship mapping table;
[0027] establish a mapping relationship between the first data source table and the first index data table through the first relationship mapping table.
[0028] In some embodiments, the second storage module comprises:
[0029] a setting sub-module, configured to set a storage rule of the first index data table, the storage rule being to store user identity information and user index information corresponding to the user identity information in each column in sequence;
[0030] a first storage sub-module, configured to store the user index information into the first index data table according to the storage rule and the user identity information.
[0031] In some embodiments, the object information comprises an object type and an object content of the first business object, and the apparatus further comprises:
[0032] a determining module, configured to determine a second identification code generated based on the object type and the object content if the user index information of the first business object has been stored in the storage system;
[0033] a first screening module, configured to screen a target relationship mapping table in which the second identification code is written from a plurality of candidate relationship mapping tables stored, and acquire a second association number written in the target relationship mapping table;
[0034] a second screening module, configured to screen a target index data table in which the second association number is written from a plurality of candidate index data tables;
[0035] a third storage module, configured to store the user index information into the target index data table according to user dimension information.
[0036] In some embodiments, the third storage module comprises:
[0037] a determining sub-module, configured to determine an interface calling type;
[0038] a second storage sub-module, configured to store the user index information into a next row of the user index information already stored in the target index data table according to the user dimension information if the interface calling type is an insertion type.
[0039] In some embodiments, the user index information comprises an index type and an index content, and the third storage module further comprises:
[0040] a screening submodule, configured to, if the interface call type is an update type, screen out historical index data recorded with the same user dimension information and index type from the target index data table;
[0041] an updating submodule, configured to update the historical index data into index data in the index content.
[0042] A computer readable storage medium stores a plurality of instructions, which are adapted to be loaded by a processor to execute the steps in the user index information storage method.
[0043] A server comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps in the user index information storage method when executing the program.
[0044] The embodiments of the present application acquire user index information to be stored, user identity information corresponding to the user index information, and object information of a first business object to which the user index information belongs. If the user index information of the first business object has not been stored in a storage system, a first data source table and a first index data table are created. The object information of the first business object is stored in the first data source table. The user index information is stored in the first index data table according to the user identity information. The mapping relationship information between the first data source table and the first index data table is generated based on the user identity information and the object information of the first business object. In this way, the mapping relationship between the first data source table and the first index data table is established, so that when the user index information is stored, the user index information belonging to the first business object can be stored in the first index data table, without writing the object information of the first business object, avoiding repeated writing of the object information, improving the storage rate, and avoiding waste of writing resources. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0046] Figure 1a A scene diagram of the user index information storage method provided by the embodiments of the present application.
[0047] Figure 1b A flowchart of a user index information storage method provided by an embodiment of the present application.
[0048] Figure 1c A schematic diagram of mapping relationship between a first data source table and the first index data table through a first relationship mapping table provided by an embodiment of the present application.
[0049] Figure 1d An architecture schematic diagram provided by an embodiment of the present application.
[0050] Figure 2 A structure schematic diagram of a user index information storage apparatus provided by an embodiment of the present application.
[0051] Figure 3 A structure schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person skilled in the art without creative work fall within the protection scope of the present application.
[0053] The embodiments of the present application provide a user index information storage method, apparatus and computer readable storage medium.
[0054] Please refer to Figure 1a , Figure 1a A system schematic diagram of a user index information storage method provided by an embodiment of the present application, which can include at least one client 1000, at least one server 2000, at least one database 3000 and a network 4000. Each application corresponds to at least one server 2000, and the client 1000 can be a terminal device such as a mobile phone, a computer or a personal digital assistant. The client 1000 can be connected to the server 2000 or multiple servers 2000 through the network 4000. The network 4000 can be a wireless network or a wired network, such as a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different clients 1000 can also use their own Bluetooth networks or hotspot networks to connect to the server 2000, etc. In addition, the system can include a database 3000, which can be used to store user index information and other data of users.
[0055] The embodiments of the present application provide a user index information storage method, which can be executed by a server. As shown in FIG. 1, the method can include the following steps.Figure 1a As shown, the server 2000 obtains, from the client 1000, user indicator information to be stored, user identity information corresponding to the user indicator information, and object information of a first business object to which the user indicator information belongs. If the user indicator information of the first business object has not been stored in the storage system, a first data source table and a first indicator data table are created. The object information of the first business object is stored in the first data source table. The user indicator information is stored in the first indicator data table according to the user identity information. The mapping relationship information between the first data source table and the first indicator data table is generated based on the user identity information and the object information of the first business object. In this way, by establishing the mapping relationship between the first data source table and the first indicator data table, the user indicator information belonging to the first business object can be stored in the first indicator data table when storing the user indicator information, without writing the object information of the first business object, avoiding repeated writing of the object information, improving the storage rate, and avoiding waste of writing resources.
[0056] It should be noted that Figure 1a The scenario diagram of the user indicator information storage system shown is only an example. The user indicator information storage system and scenario described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, as the user indicator information storage system evolves and new business scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0057] In this embodiment, the user indicator information storage device will be described from the perspective of the user indicator information storage device, which can be integrated in a computer device having a storage unit and a microprocessor installed and having computing power.
[0058] Please refer to Figure 1b , Figure 1b The flowchart of the user indicator information storage method provided by the embodiments of the present application is shown. The user indicator information storage method includes the following steps.
[0059] In step 101, user indicator information to be stored, user identity information corresponding to the user indicator information, and object information of a first business object to which the user indicator information belongs are obtained.
[0060] The user index is behavior characteristic data describing a user group in a specific system, and to some extent, reveals the behavior and habits of the user in the business system. The business system data is diverse and complex, and through relevant technical means, the data is analyzed in multiple aspects and multiple dimensions to fully tap the value of the data itself, and then through operation, marketing and other means, it is fed back to the business application. The enterprise activities such as expanding the user group and quantity of the system, increasing revenue, etc. are extremely valuable data. Through the collection and analysis of logs, data and other content generated by the business system, user index data can be obtained.
[0061] Specifically, the obtained user index information is accompanied by user identity information corresponding to the user index information and object information of the first business object to which the user index information belongs. The first business object is the source of the user index information, for example, a game application: Wangzhe XX. The user identity information is the identity information used by the user in the first business object, such as an ID number: 23010XXX, or a name: Zhang San, etc. The user index information is the specific behavior operation record of the user in the first business object, such as a 200 yuan recharge.
[0062] In step 102, if the user index information of the first business object has not been stored in the storage system, a first data source table and a first index data table are created.
[0063] The storage system that stores the user index information can be a TiDB distributed storage system. Relying on the excellent distributed expansion capability of TiDB, the space capacity and access QPS can be flexibly expanded online as needed, and excellent real-time SQL access can be guaranteed while storing massive data. When accessing user index data, three tables, tag, tag_rel and metric, are accessed. When writing data, batch insertion can be used to achieve efficient writing, and when querying, multiple table associations can be achieved through join syntax. It can be ensured that the number of rows in the tag and tag_rel tables is small and will eventually converge, and TiDB has special optimization for join statements, which can also ensure high performance in multi-table join queries.
[0064] Specifically, when storing the user index information, it can be determined whether the user index information from the first business object has been stored in the storage system before. For example, whether the user index information from Wangzhe XX has been stored. If the user index information of the first business object has not been stored, a first data source table and a first index data table are created.
[0065] In step 103, the object information of the first business object is stored in the first data source table.
[0066] The first data source table is used for storing object information of the first service object, for example, storing a game application: King XX in the first data source table.
[0067] In step 104, the user index information is stored in the first index data table according to the user identity information.
[0068] The user index information is stored in the first index data table according to the user identity information, that is, the object information of the first service object and the user index information are stored in different tables, respectively.
[0069] In some embodiments, the step of storing the user index information in the first index data table according to the user identity information comprises:
[0070] (1) setting a storage rule of the first index data table, the storage rule being to store user identity information and user index information corresponding to the user identity information in each column in turn;
[0071] (2) storing the user index information in the first index data table according to the user identity information according to the storage rule.
[0072] Table 1
[0073]
[0074]
[0075] As shown in Table 1, the storage rule of the first index data table is set, the storage rule being to store user identity information and user index information corresponding to the user identity information in each column in turn; the user index information is stored in the first index data table according to the user identity information according to the storage rule. Different from the column-by-column recording mode of the prior art, since the column-by-column recording in the prior art will cause the column number of the table to reach the upper limit when recording to a preset column number, for example, 50 columns, a new table needs to be created for recording, which will increase the number of tables, causing storage burden, and when a specific user index information is queried subsequently, it also needs to be filtered one by one from multiple tables, which is low in query efficiency. Since there is no upper limit for the number of rows in the table, the multi-table problem is effectively avoided by the row-by-row recording mode, which can achieve single-table unlimited recording and is convenient for subsequent query.
[0076] In step 105, based on the user identity information and the object information of the first service object, the mapping relationship information of the first data source table and the first index data table is generated.
[0077] The mapping relationship information of the first data source table and the first index data table is generated according to the user identity information and the object information of the first service object. The purpose is that the service object will gradually converge over time, and the user index information will gradually increase over time, so the object information of the service object and the user index information are stored in separate tables to decouple the object information and the user index information, and when a large amount of user index information derived from the same service object is stored, the object information of the service object does not need to be repeatedly written, thereby improving the storage rate and avoiding the waste of writing resources.
[0078] In some embodiments, the object information includes the object type and the object content of the first service object, the user identity information includes the identity type and the identity content, and the step of generating the mapping relationship information of the first data source table and the first index data table based on the user identity information and the object information of the first service object includes:
[0079] (1) generating a first identification code based on the object type and the object content;
[0080] (2) generating a first association number based on the object type, the object content, the identity type, and the identity content;
[0081] (3) generating the mapping relationship information of the first data source table and the first index data table according to the first identification code and the first association number.
[0082] The object information and the user identity information can be recorded in the form of key-value pairs. The object type is the key of the key-value pair, the object content is the value of the key-value pair, the identity type is the key of the key-value pair, and the identity content is the value of the key-value pair. For example, the object information is a game application: King XX, and the user identity information is name: Zhang San. The object type is a game application, the object content is King XX, the identity type is name, and the identity content is Zhang San.
[0083] Specifically, based on the object type and the object content, a first identifier code is generated. This can be achieved by encapsulating the object type and object content into an ordered dictionary set, and then generating a corresponding MD5 hash value as the first identifier code using the MD5 algorithm. The method for generating the first association number is similar to that for generating the first identifier code; it involves encapsulating the object type, object content, identity identifier type, and identity identifier content into an ordered dictionary set, and then generating a corresponding MD5 hash value as the first association number using the MD5 algorithm. Thus, through the first identifier code and the first association number, the mapping relationship information between the first data source table and the first indicator data table is generated.
[0084] In some implementations, the step of generating the mapping relationship information between the first data source table and the first indicator data table based on the first identifier code and the first association number includes:
[0085] (1.1) Create and store a first relational mapping table;
[0086] (1.2) Write the first identifier code into the first data source table and the first relationship mapping table;
[0087] (1.3) Write the first association number into the first indicator data table and the first relationship mapping table;
[0088] (1.4) Establish the mapping relationship between the first data source table and the first indicator data table through the first relationship mapping table.
[0089] Among them, such as Figure 1c As shown, Figure 1c This diagram illustrates the establishment of a mapping relationship between a first data source table and a first indicator data table through a first relationship mapping table, as provided in this embodiment of the application. The mapping relationship information is generated by creating and storing a first relationship mapping table. This first relationship mapping table is used to establish the mapping relationship between the first data source table and the first indicator data table. The establishment method involves writing the first identifier code into both the first data source table and the first relationship mapping table; and writing the first association number into both the first indicator data table and the first relationship mapping table. Thus, the mapping relationship between the first data source table and the first indicator data table is established through the first relationship mapping table.
[0090] In some implementations, the object information includes the object type and object content of the first business object, and the method further includes:
[0091] (1) If the storage system has stored user indicator information of the first business object, then determine the second identifier code generated based on the object type and the object content;
[0092] (2) selecting a target relationship mapping table in which the second identification code is written from a plurality of stored candidate relationship mapping tables, and obtaining a second association number written in the target relationship mapping table;
[0093] (3) selecting a target index data table in which the second association number is written from a plurality of candidate index data tables;
[0094] (4) storing the user index information into the target index data table according to the user dimension information.
[0095] If the storage system has stored user index information derived from the first business object before, a second identification code is generated based on the object type and the object content, the second identification code is an ordered dictionary set encapsulating the object type and the object content, and an MD5 hash value corresponding to the second identification code is generated according to an MD5 algorithm as the second identification code. A target relationship mapping table in which the second identification code is written is selected from a plurality of stored candidate relationship mapping tables, a second association number written in the target relationship mapping table is obtained, a target index data table in which the second association number is written is selected from a plurality of candidate index data tables, and the user index information is stored into the target index data table according to the user dimension information.
[0096] In some embodiments, the step of storing the user index information into the target index data table according to the user dimension information comprises:
[0097] (1.1) determining an interface call type;
[0098] (1.2) if the interface call type is an insertion type, storing the user index information into a next row of the stored user index information in the target index data table according to the user dimension information.
[0099] As shown in FIG. 1, the system comprises a user index information storage module 100, a user index information query module 200, a user index information storage module 300, and a user index information query module 400. Figure 1d Figure 1d The architecture schematic diagram provided by the embodiments of the present application. The SDK layer provides complete interface services for the operation behavior of data, such as insert, update, insert on duplicate key update, delete / clear / drop, query and the like. If a new data needs to be stored, the user knows that it is the first time to write data, and then calls the insert interface operation; if it is not sure whether the data is the first time to write, and requires to update the specified field if the data exists, and if the data does not exist, it is the first time to write, then the insert on duplicate key update interface operation is called; if the user knows that the data already exists and needs to update part of the content, then the update interface is called to complete; if the data needs to be cleaned, if part of the data is deleted, the delete interface is called, if all the data is emptied, the clear interface is called, and if the underlying storage table structure and data are all deleted, the drop interface is called; the query interface is called to complete the query of the underlying storage data.
[0100] Specifically, the interface calling type is determined, if the interface calling type is an insert type, then the user index information is stored in the next row of the stored user index information in the target index data table according to the user dimension information.
[0101] In some embodiments, the user index information includes an index type and an index content, and the method further includes:
[0102] (1.1) if the interface calling type is an update type, then the historical index data with the same user dimension information and index type is filtered out from the target index data table;
[0103] (1.2) the historical index data is updated to the index data in the index content.
[0104] Table 2
[0105]
[0106] Wherein, as shown in Table 2, the user index information includes index type and index content, if the interface calling type is an update type, the historical index data with the same user dimension information and index type is filtered out from the target index data table. For example, the user identity information is name: Zhang San, and the index type is historical recharge amount, the index content 200 in the first row in Table 2 is the historical index data, and the historical index data is updated to the index content of the current user index information. For example, the index content of the current user index information is 400, the index content 200 in the first row is updated to 400, thereby achieving the effect of updating the user index information.
[0107] From the above, the embodiment of the application obtains the user index information to be stored, the user identity information corresponding to the user index information, and the object information of the first business object to which the user index information belongs. If the user index information of the first business object has not been stored in the storage system, a first data source table and a first index data table are created. The object information of the first business object is stored in the first data source table. The user index information is stored in the first index data table according to the user identity information. The mapping relationship information between the first data source table and the first index data table is generated based on the user identity information and the object information of the first business object. In this way, by establishing the mapping relationship between the first data source table and the first index data table, the user index information belonging to the first business object can be stored in the first index data table when storing the user index information, without writing the object information of the first business object, avoiding repeated writing of the object information, improving the storage rate, and avoiding waste of writing resources.
[0108] In order to better implement the user index information storage method provided by the embodiment of the application, the embodiment of the application further provides a device based on the above-mentioned user index information storage method. The meanings of the terms are the same as those in the above-mentioned user index information storage method, and the specific implementation details can be referred to the description in the method embodiment.
[0109] Please refer to Figure 2 , Figure 2 The structure diagram of the user index information storage device provided by the embodiment of the application. The user index information storage device can include an acquisition module 201, a creation module 202, a first storage module 203, a second storage module 204, and a generation module 205, etc.
[0110] The acquisition module 201 is configured to acquire the user index information to be stored, the user identity information corresponding to the user index information, and the object information of the first business object to which the user index information belongs.
[0111] The creating module 202 is configured to create a first data source table and a first index data table if the user index information of the first service object is not stored in the storage system;
[0112] The first storing module 203 is configured to store the object information of the first service object into the first data source table;
[0113] The second storing module 204 is configured to store the user index information into the first index data table according to the user identity information;
[0114] The generating module 205 is configured to generate the mapping relationship information between the first data source table and the first index data table based on the user identity information and the object information of the first service object.
[0115] In some embodiments, the object information includes an object type and an object content of the first service object, the user identity information includes an identity type and an identity content, and the generating module 205 includes:
[0116] The first generating sub-module is configured to generate a first identification code based on the object type and the object content;
[0117] The second generating sub-module is configured to generate a first association number based on the object type, the object content, the identity type and the identity content;
[0118] The third generating sub-module is configured to generate the mapping relationship information between the first data source table and the first index data table according to the first identification code and the first association number.
[0119] In some embodiments, the third generating sub-module is configured to:
[0120] create and store a first relationship mapping table;
[0121] write the first identification code into the first data source table and the first relationship mapping table;
[0122] write the first association number into the first index data table and the first relationship mapping table;
[0123] establish the mapping relationship between the first data source table and the first index data table through the first relationship mapping table.
[0124] In some embodiments, the second storing module 204 includes:
[0125] The setting sub-module is configured to set a storage rule of the first index data table, and the storage rule is to sequentially store user identity information and user index information corresponding to the user identity information in each column;
[0126] The first storage sub-module is configured to store the user index information into the first index data table according to the user identity information according to the storage rule.
[0127] In some embodiments, the object information includes an object type and object content of the first business object, and the apparatus further includes:
[0128] The determining module is configured to determine a second identification code generated based on the object type and the object content if the user index information of the first business object is stored in the storage system;
[0129] The first screening module is configured to screen a target relationship mapping table in which the second identification code is written from a plurality of stored candidate relationship mapping tables, and to obtain a second association number written in the target relationship mapping table.
[0130] The second screening module is configured to screen a target index data table in which the second association number is written from a plurality of candidate index data tables.
[0131] The third storage module is configured to store the user index information into the target index data table according to the user dimension information.
[0132] In some embodiments, the third storage module includes:
[0133] The determining sub-module is configured to determine an interface call type.
[0134] The second storage sub-module is configured to store the user index information into a next row of the stored user index information in the target index data table according to the user dimension information if the interface call type is an insertion type.
[0135] In some embodiments, the user index information includes an index type and index content, and the third storage module further includes:
[0136] The screening sub-module is configured to screen historical index data recorded in the target index data table and having the same user dimension information and index type as the user index information if the interface call type is an update type.
[0137] The updating sub-module is configured to update the historical index data into index data in the index content.
[0138] As described above, in this embodiment, the acquisition module 201 acquires the user indicator information to be stored, the user identity information corresponding to the user indicator information, and the object information of the first business object to which the user indicator information belongs. If the storage system has not stored the user indicator information of the first business object, the creation module 202 creates a first data source table and a first indicator data table. The first storage module 203 stores the object information of the first business object in the first data source table. The second storage module 204 stores the user indicator information in the first indicator data table according to the user identity information. The generation module 205 generates a mapping relationship between the first data source table and the first indicator data table based on the user identity information and the object information of the first business object. Thus, by establishing a mapping relationship between the first data source table and the first indicator data table, user indicator information belonging to the first business object can be stored in the first indicator data table when storing user indicator information, without needing to write the object information of the first business object, avoiding duplicate writing of object information, improving storage speed, and avoiding waste of writing resources.
[0139] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0140] Accordingly, embodiments of this application also provide a server, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of a server provided in an embodiment of this application. The server 2000 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 and the memory 402 are electrically connected. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0141] The processor 401 is the control center of the server 2000. It connects various parts of the server 2000 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the server 2000 and processes data, thereby monitoring the server 2000 as a whole.
[0142] In this embodiment, the processor 401 in the server 2000 loads the instructions corresponding to the processes of one or more applications into the memory 402 according to the following steps, and the processor 401 runs the applications stored in the memory 402 to achieve various functions:
[0143] obtain user index information to be stored, and user identity information corresponding to the user index information and object information of a first service object to which the user index information belongs; create a first data source table and a first index data table if the user index information of the first service object has not been stored in the storage system; store the object information of the first service object into the first data source table; store the user index information into the first index data table according to the user identity information; and generate mapping relationship information of the first data source table and the first index data table based on the user identity information and the object information of the first service object.
[0144] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described here.
[0145] Optionally, as shown in Figure 3 The server 2000 further includes an input unit 403 and a power supply 404. The processor 401 is electrically connected with the input unit 403 and the power supply 404 respectively. Those skilled in the art can understand that the server structure shown in Figure 3 The server structure shown in the foregoing embodiments does not constitute a limitation on the server, and can include more or fewer components than shown, or combine certain components, or different component arrangements.
[0146] The input unit 403 can be used to receive inputted digital, character information or user feature information (for example, fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0147] The power supply 404 is used to supply power to each component of the server 2000. Optionally, the power supply 404 can be logically connected with the processor 401 through a power management system, so as to realize functions such as management of charging, discharging and power consumption management through the power management system. The power supply 404 can further include one or more than one direct current or alternating current power supply, a recharging system, a power supply fault detection circuit, a power supply converter or inverter, a power supply state indicator and any other components.
[0148] Although Figure 3 The server 2000 can further include a camera, a sensor, a wireless fidelity module, a Bluetooth module and the like, which will not be described here.
[0149] In the foregoing embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can refer to the relevant description of other embodiments.
[0150] From the above, the server provided by the embodiment can acquire user index information to be stored, user identity information corresponding to the user index information, and object information of a first business object to which the user index information belongs. If the user index information of the first business object has not been stored in the storage system, a first data source table and a first index data table are created. The object information of the first business object is stored in the first data source table. The user index information is stored in the first index data table according to the user identity information. The mapping relationship information between the first data source table and the first index data table is generated based on the user identity information and the object information of the first business object. In this way, by establishing the mapping relationship between the first data source table and the first index data table, the user index information belonging to the first business object can be stored in the first index data table when the user index information is stored, without writing the object information of the first business object, avoiding repeated writing of the object information, improving the storage rate, and avoiding waste of writing resources.
[0151] In addition, since the column-by-column recording in the prior art causes the column number of the table to reach the upper limit when recording to a preset column number, for example, 50 columns, a new table needs to be created for recording, which increases the number of tables and causes storage burden, and when a specific user index information is queried subsequently, the user index information needs to be filtered one by one from multiple tables, which is low in query efficiency. Since the storage rule of the first index data table is set in the present application, the storage rule is to store user identity information and user index information corresponding to the user identity information in each column in turn. According to the storage rule, the user index information is stored in the first index data table according to the user identity information, and the upper limit of rows is not limited. Therefore, the multiple tables are effectively avoided by the row-by-row recording, and single-table unlimited recording can be achieved, which is convenient for subsequent query.
[0152] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by related hardware controlled by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0153] Therefore, the embodiment of the present application provides a computer readable storage medium, which stores a plurality of computer programs. The computer programs can be loaded by a processor to execute the steps in any of the user index information storage methods provided by the embodiments of the present application. For example, the computer programs can execute the following steps:
[0154] Obtaining user index information to be stored, user identity information corresponding to the user index information, and object information of a first business object to which the user index information belongs; creating a first data source table and a first index data table if the user index information of the first business object has not been stored in the storage system; storing the object information of the first business object into the first data source table; storing the user index information into the first index data table according to the user identity information; and generating mapping relationship information of the first data source table and the first index data table based on the user identity information and the object information of the first business object.
[0155] The specific implementation of each operation can refer to the foregoing embodiments, which will not be described here again.
[0156] The storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or the like.
[0157] The computer program stored in the storage medium can execute the steps of any one of the user index information storage methods provided in the embodiments of the present application, and thus can achieve the beneficial effects of any one of the user index information storage methods provided in the embodiments of the present application. Details are described in the foregoing embodiments, which will not be described here again.
[0158] The foregoing describes in detail a user index information storage method, device, computer readable storage medium, and server provided in the embodiments of the present application. The principles and implementation manners of the present application are described by applying specific examples. The foregoing description of the embodiments is only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, the specific implementation manner and application range can be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A user index information storage method characterized by comprising: The method comprises: obtaining user index information to be stored, user identity information corresponding to the user index information, and object information of a first business object to which the user index information belongs; if the user index information of the first business object has not been stored in a storage system, creating a first data source table and a first index data table; storing the object information of the first business object into the first data source table; storing the user index information into the first index data table according to the user identity information; generating mapping relationship information between the first data source table and the first index data table based on the user identity information and the object information of the first business object; the object information comprises an object type and object content of the first business object, and the method further comprises: if the user index information of the first business object has been stored in the storage system, determining a second identification code generated based on the object type and the object content; selecting a target relationship mapping table in which the second identification code is written from a plurality of stored candidate relationship mapping tables, and obtaining a second association number written in the target relationship mapping table; selecting a target index data table in which the second association number is written from a plurality of candidate index data tables; storing the user index information into the target index data table according to user dimension information.
2. The user profile information storage method of claim 1, wherein the object information comprises an object type and object content of the first business object, the user identity information comprises an identity type and identity content, and the step of generating the mapping relationship information between the first data source table and the first index data table based on the user identity information and the object information of the first business object comprises: generating a first identification code based on the object type and the object content; generating a first association number based on the object type, the object content, the identity type, and the identity content; generating the mapping relationship information between the first data source table and the first index data table according to the first identification code and the first association number.
3. The user profile information storage method of claim 2, wherein, the step of generating the mapping relationship information between the first data source table and the first index data table according to the first identification code and the first association number comprises: creating and storing a first relationship mapping table; writing the first identification code into the first data source table and the first relationship mapping table; writing the first association number into the first index data table and the first relationship mapping table; establishing the mapping relationship between the first data source table and the first index data table through the first relationship mapping table.
4. The user profile information storage method of claim 1, wherein the step of storing the user index information into the first index data table according to the user identity information comprises: setting a storage rule of the first index data table, the storage rule being to sequentially store user identity information and user index information corresponding to the user identity information in each column; According to the storage rule, the user index information is stored into the first index data table according to the user identity information.
5. The user profile information storage method of claim 1, wherein, The step of storing the user index information into the target index data table according to the user dimension information comprises: Determining an interface call type; If the interface call type is an insertion type, the user index information is stored into a next row of the stored user index information in the target index data table according to the user dimension information.
6. The user profile information storage method of claim 5, wherein, The user index information comprises an index type and index content, and the method further comprises: If the interface call type is an update type, historical index data with the same user dimension information and index type is filtered out from the target index data table; The historical index data is updated as the index data in the index content.
7. A user profile information storage device, characterized by comprising: Comprise: An acquisition module, configured to acquire user index information to be stored, user identity information corresponding to the user index information, and object information of a first business object to which the user index information belongs; A creation module, configured to create a first data source table and a first index data table if the user index information of the first business object has not been stored in a storage system; A first storage module, configured to store the object information of the first business object into the first data source table; A second storage module, configured to store the user index information into the first index data table according to the user identity information; A generation module, configured to generate mapping relationship information between the first data source table and the first index data table based on the user identity information and the object information of the first business object; The object information comprises an object type and object content of the first business object, and the apparatus further comprises: A determination module, configured to determine a second identification code generated based on the object type and the object content if the user index information of the first business object has been stored in the storage system; A first screening module, configured to screen a target relationship mapping table in which the second identification code is written from a plurality of stored candidate relationship mapping tables, and acquire a second association number written in the target relationship mapping table; A second screening module, configured to screen a target index data table in which the second association number is written from a plurality of candidate index data tables; A third storage module, configured to store the user index information into the target index data table according to the user dimension information.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions adapted to be loaded by the processor to execute the steps in the user index information storage method according to any one of claims 1 to 6.
9. A server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps in the user index information storage method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method and device, computer equipment and readable storage medium
CN113986932A