A method, device, electronic device and storage medium for storing business data

By identifying the business domain identifier of the business data and storing it in the corresponding isolated sub-storage area, the problem of low data storage efficiency in the existing technology is solved, and efficient business data storage and query are realized.

CN114625729BActive Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011472401.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-14
Publication Date
2024-10-15
Estimated Expiration
2040-12-14

AI Technical Summary

Technical Problem

Existing data storage methods are inefficient in storing massive business data, especially storage methods based on wide tables, resulting in low data storage efficiency.

Method used

By identifying the business domain identifier of business data, the target business domain is determined, and the data is stored in an isolated sub-storage area in the corresponding preset storage area to improve data storage efficiency.

Benefits of technology

It achieves efficient storage and reading of business data, reduces storage and query time, and improves the system's scalability and anti-pollution capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625729B_ABST
    Figure CN114625729B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and storage medium for storing business data; the embodiment of the present application obtains the business data to be stored, the business data includes business basic data and business domain data, the business domain data includes business domain identification and business content data; identifies the target business domain corresponding to the business data according to the business domain identification; determines the preset storage area where the business data needs to be stored based on the business basic data; determines the target sub-storage area corresponding to the target business domain from the preset storage area, the preset storage area includes: multiple mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business domain; stores the business data in the target sub-storage area. The embodiment of the present application can store business data based on the business domain identification, thereby improving the storage efficiency of business data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for storing business data. Background Art

[0002] With the development of network technology, the Internet can provide more and more services, and the amount of data generated by various services has also expanded rapidly. With the explosive growth of business data, how data storage systems store massive amounts of business data during business processing has become a research focus in the field of data storage.

[0003] The current data storage method is to store business data through a large dedicated wide table. Although this data storage method can meet the high storage requirements of massive data, the data storage efficiency is low because it is based on wide tables. Summary of the invention

[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for storing business data, which can improve the storage efficiency of business data.

[0005] The present application provides a method for storing business data, including:

[0006] Acquire business data to be stored, the business data including business basic data and business domain data, the business domain data including business domain identifier and business content data;

[0007] Identifying a target business domain corresponding to the business data according to the business domain identifier;

[0008] Determine, based on the business basic data, a preset storage area in which the business data needs to be stored;

[0009] Determining a target sub-storage area corresponding to the target business field from the preset storage area, the preset storage area comprising: a plurality of mutually isolated sub-storage areas, each sub-storage area being used to store business data of a corresponding business field;

[0010] The business data is stored in the target sub-storage area.

[0011] Accordingly, an embodiment of the present application provides a storage device for business data, including:

[0012] An acquisition unit, used to acquire business data to be stored, wherein the business data includes business basic data and business domain data, and the business domain data includes a business domain identifier and business content data;

[0013] an identification unit, configured to identify a target business domain corresponding to the business data according to the business domain identifier;

[0014] A first determining unit, configured to determine, based on the business basic data, a preset storage area where the business data needs to be stored;

[0015] A second determining unit is used to determine a target sub-storage area corresponding to the target business field from the preset storage area, wherein the preset storage area includes: a plurality of mutually isolated sub-storage areas, each sub-storage area is used to store business data of a corresponding business field;

[0016] A storage unit is used to store the business data in the target sub-storage area.

[0017] Optionally, in some embodiments of the present application, the business domain data further includes an event identifier of a business event to which the business data belongs; and the storage unit may include a verification subunit and a storage subunit, as follows:

[0018] The verification subunit is used to verify the event identifier in the business domain data based on the current event identifier of the business event;

[0019] The storage subunit is used to store the business data into the target sub-storage area when the event identifier verification passes.

[0020] Optionally, in some embodiments of the present application, the storage unit may further include an updating subunit, as follows:

[0021] The updating subunit is used to update the current event identifier of the business event to the event identifier in the business domain data.

[0022] Optionally, in some embodiments of the present application, the storage unit may include a writing subunit, a first storage subunit, and a second storage subunit, as follows:

[0023] The writing subunit is used to write the storage operation information corresponding to the business data into the operation log;

[0024] A first storage subunit, used for storing the business data in the target sub-storage area;

[0025] The second storage subunit is used to store the business data again in the target sub-storage area based on the storage operation information corresponding to the business data in the operation log when the business data is not successfully stored in the target sub-storage area.

[0026] Optionally, in some embodiments of the present application, the first storage subunit may be specifically used to store the business data in the target sub-storage area, and generate target storage operation information corresponding to the business data;

[0027] The storage unit may further include a comparison subunit and a first determination subunit, as follows:

[0028] The comparison subunit is used to compare the target storage operation information with the storage operation information corresponding to the business data in the operation log;

[0029] The first determining subunit is used to determine whether the business data is successfully stored in the target sub-storage area based on the comparison result.

[0030] Optionally, in some embodiments of the present application, the target sub-storage area includes a basic data storage block and a domain data storage block, and the basic data storage block and the domain data storage block have the same storage structure; the storage unit may include a third storage sub-unit and a fourth storage sub-unit, as follows:

[0031] The third storage subunit is used to store the business basic data in the basic data storage block;

[0032] The fourth storage subunit is used to store the business domain data in the domain data storage block.

[0033] Optionally, in some embodiments of the present application, the preset storage area further includes: a data index directory and a data node, and the second determination unit may include a first acquisition subunit and a second determination subunit, as follows:

[0034] The first acquisition subunit is used to acquire the data node index corresponding to the target business field from the data index directory;

[0035] The second determining subunit is used to determine the target data node based on the data node index, and use the sub-storage area corresponding to the target data node as the target sub-storage area.

[0036] Optionally, in some embodiments of the present application, the storage unit may further include a generation subunit and an addition subunit, as follows:

[0037] The generating subunit is configured to generate metadata corresponding to the business data based on the storage location of the business data in the target sub-storage area, wherein the metadata indicates the storage location of the business data;

[0038] The adding subunit is used to add the metadata to the target data node.

[0039] Optionally, in some embodiments of the present application, the storage device for business data may further include a receiving unit, a third determining unit, a fourth determining unit and a data acquiring unit, as follows:

[0040] The receiving unit is used to receive a request for obtaining target business data, wherein the request includes a business domain identifier and a data identifier of the target business data;

[0041] A third determining unit, configured to determine a preset storage area corresponding to the target service data;

[0042] A fourth determining unit, configured to determine a target sub-storage area corresponding to the business domain identifier from the preset storage area;

[0043] A data acquisition unit is used to acquire the target business data from the target sub-storage area according to the data identifier.

[0044] Optionally, in some embodiments of the present application, the preset storage area further includes: a data index directory and a data node, the data node includes metadata of the sub-storage area, and the metadata indicates a storage location of the business data;

[0045] The fourth determining unit may include a second obtaining subunit and a third determining subunit, as follows:

[0046] The second acquisition subunit is used to acquire the data node index corresponding to the business domain identifier from the data index directory;

[0047] The third determination subunit is used to determine the target data node based on the data node index, and use the sub-storage area corresponding to the target data node as the target sub-storage area.

[0048] The data acquisition unit may include an extraction subunit and a third acquisition subunit, as follows:

[0049] The extraction subunit is used to extract metadata corresponding to the target business data from the target data node according to the data identifier;

[0050] The third acquisition subunit is used to acquire the target business data from the target sub-storage area based on the metadata.

[0051] Optionally, in some embodiments of the present application, the preset storage area includes multiple data storage areas, each data storage area stores business data within a corresponding target time, and each data storage area includes multiple mutually isolated sub-storage areas; the acquisition request also includes time information;

[0052] The fourth determining unit may include a fourth determining subunit and a fifth determining subunit, as follows:

[0053] The fourth determining subunit is used to determine a target data storage area corresponding to the time information from the preset storage area;

[0054] The fifth determining subunit is configured to determine a target sub-storage area corresponding to the business domain identifier from the target data storage area.

[0055] An electronic device provided in an embodiment of the present application includes a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps in the business data storage method provided in the embodiment of the present application.

[0056] In addition, an embodiment of the present application further provides a storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the steps in the business data storage method provided in the embodiment of the present application are implemented.

[0057] The embodiments of the present application provide a method, device, electronic device and storage medium for storing business data, which can obtain business data to be stored, wherein the business data includes business basic data and business domain data, wherein the business domain data includes a business domain identifier and business content data; identify the target business domain corresponding to the business data according to the business domain identifier; determine the preset storage area where the business data needs to be stored based on the business basic data; determine the target sub-storage area corresponding to the target business domain from the preset storage area, wherein the preset storage area includes: multiple mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business domain; and store the business data in the target sub-storage area. The embodiments of the present application can store business data based on the business domain identifier, thereby improving the storage efficiency of business data. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1a It is a scenario diagram of a method for storing business data provided in an embodiment of the present application;

[0060] Figure 1b is a flowchart of a method for storing business data provided by an embodiment of the present application;

[0061] Figure 1c It is a structural diagram of a method for storing business data provided in an embodiment of the present application;

[0062] Figure 1d It is a schematic diagram of a model of a method for storing business data provided in an embodiment of the present application;

[0063] Figure 1e is another structural diagram of the method for storing business data provided in an embodiment of the present application;

[0064] Figure 2a is another flow chart of the method for storing business data provided by an embodiment of the present application;

[0065] Figure 2b is an illustration of a method for storing business data provided in an embodiment of the present application;

[0066] Figure 2c It is a page schematic diagram of a method for storing business data provided in an embodiment of the present application;

[0067] Figure 2d This is another page schematic diagram of the method for storing business data provided by an embodiment of the present application;

[0068] Figure 3a It is a schematic diagram of the structure of a storage device for business data provided in an embodiment of the present application;

[0069] Figure 3b is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0070] Figure 3c is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0071] Figure 3d is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0072] Figure 3e is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0073] Figure 3f is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0074] Figure 3g is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0075] Figure 3h is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0076] Figure 3iis another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0077] Figure 3j is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0078] Figure 3k is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0079] Figure 3l is another structural schematic diagram of a storage device for business data provided in an embodiment of the present application;

[0080] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0081] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0082] The embodiment of the present application provides a method, device, electronic device and storage medium for storing business data. The business data storage device can be integrated in an electronic device, which can be a terminal or a server.

[0083] It is understandable that the service data storage method of this embodiment can be executed on the terminal, can be executed on the server, or can be executed by the terminal and the server together. The above examples should not be understood as limiting the present application.

[0084] like Figure 1a As shown, a terminal and a server jointly perform a storage method for business data as an example. The business data storage system provided in the embodiment of the present application includes a terminal 10 and a server 11, etc. The terminal 10 and the server 11 are connected via a network, such as a wired or wireless network connection, etc., wherein the storage device for business data can be integrated in the server.

[0085] Among them, the server 11 can be used to: receive the business data to be stored sent by the terminal 10, the business data includes business basic data and business domain data, the business domain data includes business domain identification and business content data; identify the target business domain corresponding to the business data according to the business domain identification; determine the preset storage area where the business data needs to be stored based on the business basic data; determine the target sub-storage area corresponding to the target business domain from the preset storage area, the preset storage area includes: multiple mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business domain; store the business data in the target sub-storage area. Among them, the server 11 can be a single server, or a server cluster or cloud server composed of multiple servers.

[0086] The terminal 10 may send the service data to be stored to the server 11. The service data may be billing data, etc. The terminal 10 may include a mobile phone, a smart TV, a tablet computer, a laptop computer, or a personal computer (PC). A client may also be set on the terminal 10, and the client may be an application client or a browser client, etc.

[0087] The step of storing business data in the server 11 may also be executed by the terminal 10 .

[0088] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0089] This embodiment will be described from the perspective of a storage device for business data. The storage device for business data may be integrated into an electronic device, which may be a server, a terminal or other device.

[0090] The business data storage method of the embodiment of the present application can be applied to various data storage scenarios. For example, the business data storage method provided in this embodiment can be used to store bill data, which can improve the storage efficiency of bill data and the reading speed of bill data.

[0091] like Figure 1b As shown, the specific process of the storage method of the business data can be as follows:

[0092] 101. Acquire business data to be stored, where the business data includes basic business data and business domain data, and the business domain data includes a business domain identifier and business content data.

[0093] In this embodiment, the business data may specifically be billing data, and the billing data may be generated by an instant messaging client or a shopping client during a transaction, and this embodiment does not impose any limitation on this.

[0094] Among them, the business basic data may include a user identifier, time information, and data identifier corresponding to the business data; the data identifier may specifically be a business order number identifier.

[0095] Among them, business domain refers to different business types. For example, in the payment transaction scenario, business domains may include red envelopes, transfers, top-ups, and withdrawals. Business domain identifiers are used to uniquely identify a business domain. Business content data may include specific business content. For example, in the payment transaction scenario, business content data may include consumption at Hotel A, consumption of tickets to Location C, etc.

[0096] 102. Identify a target business domain corresponding to the business data according to the business domain identifier.

[0097] The target business domain is the business domain to which the business data to be stored belongs. In the payment transaction scenario, the business data is bill data, and the target business domain can be the payment domain, red envelope domain, transfer domain, face-to-face transaction domain, refund domain, or industry domain, etc.

[0098] 103. Determine, based on the business basic data, a preset storage area where the business data needs to be stored.

[0099] In some embodiments, the business basic data includes a user identifier corresponding to the business data, and the preset storage area where the business data needs to be stored can be determined based on the user identifier. The preset storage area stores the business data corresponding to the user identifier.

[0100] The storage architecture of the business data may be to divide the storage area according to the user identification, and different user identifications correspond to different preset storage areas.

[0101] 104. Determine a target sub-storage area corresponding to the target business domain from the preset storage area, wherein the preset storage area includes: a plurality of mutually isolated sub-storage areas, each sub-storage area being used to store business data of a corresponding business domain.

[0102] In this embodiment, the preset storage area is divided according to the business field to obtain a plurality of mutually isolated sub-storage areas, and each sub-storage area stores business data of a different business field.

[0103] Optionally, in some embodiments, the preset storage area further includes: a data index directory and a data node, and the step of “determining the target sub-storage area corresponding to the target business field from the preset storage area” may include:

[0104] Obtaining a data node index corresponding to the target business domain from the data index directory;

[0105] A target data node is determined based on the data node index, and a sub-storage area corresponding to the target data node is used as a target sub-storage area.

[0106] Among them, the data index directory includes data node indexes corresponding to each business field, and the data node index corresponding to the target business field can be found from the data index directory according to the target business field. Optionally, the data node corresponding to the data node index can store address information of the target sub-storage area corresponding to the target business field. The data index directory can also be regarded as a collection of data node indexes. The data index directory includes a mapping relationship between business fields and data node indexes.

[0107] The data index directory may be stored in a buffer to facilitate reading of the data index directory.

[0108] Wherein, each data node in the data structure corresponds to a storage unit. In some embodiments, the data node may store the address information of the corresponding sub-storage area and the specific storage location of each business data in the sub-storage area. The data node may also determine the remaining empty storage location in the target sub-storage area based on the storage location of the business data currently stored in the target sub-storage area, and indicate the specific storage location in the target sub-storage area of ​​the next business data to be stored. Based on the specific storage location in the target sub-storage area indicated by the data node, the business data is stored in the specific storage location in the target sub-storage area.

[0109] 105. Store the business data in the target sub-storage area.

[0110] There are multiple business data stored in the target sub-storage area, wherein the business data can be stored in time order. In the above embodiment, the business data to be stored can be stored in a storage location adjacent to the storage location of the last stored business data in the target sub-storage area.

[0111] Optionally, in some embodiments, the business domain data further includes an event identifier of a business event to which the business data belongs; before the step of “storing the business data in the target sub-storage area”, the following may also be included:

[0112] Based on the current event identifier of the business event, verifying the event identifier in the business domain data;

[0113] The storing the business data into the target sub-storage area includes:

[0114] When the event identification verification passes, the business data is stored in the target sub-storage area.

[0115] Wherein, after the step of "when the event identifier verification passes, storing the business data in the target sub-storage area", the following may also be included:

[0116] The current event identifier of the business event is updated to the event identifier in the business domain data.

[0117] Among them, a business event may include multiple links, and multiple business data will be generated. Different business data belonging to the same business event corresponds to different event identifiers. Among them, the event identifier is the data version (Data Version), and the Data Version is used as an optimistic lock, that is, the correct Data Version is required every time the business data of the target sub-storage area is written or modified.

[0118] Among them, optimistic locking is also called optimistic concurrency control. It is a method used by the database to ensure data concurrency security and prevent update loss. Optimistic locking can be implemented through Data Version.

[0119] For example, in the payment transaction scenario, the business data is billing data. The process of the same transaction may include initiating a transfer, accepting a transfer / returning a transfer. In other words, this business event includes initiating a transfer and accepting a transfer / returning a transfer. The event identifier of the business data generated by initiating a transfer is different from the event identifier of the business data generated by receiving a transfer.

[0120] Among them, the current event identifier of the business event is the event identifier of the business data that has been stored in the target sub-storage area for the most recent time for the business event. The process of verifying the business event can specifically be to verify whether the current event identifier of the business event and the event identifier in the business domain data are the same. If they are the same, the event identifier verification fails; if they are different, the event identifier verification passes. Specifically, for different business data belonging to the same business event, the Data Version of the business data written later must be larger than the Data Version of the business data written earlier in order to be successfully written into the corresponding storage area.

[0121] In some embodiments, the event identifier in the business domain data is determined based on the current event identifier of the business event to which the business data belongs. For example, if the target sub-storage area does not originally store business data under a certain business event, the current event identifier of the business event may be 0, and the event identifier in the business domain data may be set to 1.

[0122] In a specific embodiment, user 1 initiates a transfer to user 2, and this bill data needs to be written into the corresponding storage area. Since there is no relevant bill data for this transaction (business event) in the storage area, the current event identifier can be recorded as 0, and the event identifier of the bill data for initiating the transfer can be substituted with 1. Now, writing a bill data with Data Version = 1 can be successfully written, and after successful writing, the current event identifier is updated to 1. When the status of the business event changes and another business data needs to be written, such as a refund operation, a second write operation is required. The Data Version substituted in the second write operation must be different from 1 to be successfully written. For example, the Data Version corresponding to the refund operation can be 2.

[0123] This embodiment verifies the event identifier to avoid repeated storage of business data. For example, when the business data is billing data, after initiating a transfer, when clicking to collect payment, due to network jitter, multiple collection requests are generated. At this time, the interface for storing billing data will be called three times, and three identical billing data will be written, but these three billing data should not all be written to the storage area. Generally speaking, the event identifiers of these three billing data are the same. After these three billing data are sent to the server, the current event identifier is the event identifier corresponding to initiating the transfer, which is different from the event identifiers of these three billing data. Therefore, one of the billing data is updated into the storage area, and the event identifier at this time is also updated to the event identifier corresponding to the collection. The event identifiers of the remaining two redundant billing data are the same and will not be written to the storage area.

[0124] In addition, checking the event identifier can also prevent data intrusion. For example, in the case of program anomalies, if the business data belonging to business domain A wants to be stored in the target sub-storage area of ​​business domain B, it cannot perform data intrusion operations because it does not have the correct DataVersion.

[0125] Optionally, in some embodiments, before the step of “storing the business data in the target sub-storage area”, the following may also be included:

[0126] Writing storage operation information corresponding to the business data into an operation log;

[0127] After storing the business data in the target sub-storage area, the method further includes:

[0128] When the business data is not successfully stored in the target sub-storage area, the business data is stored again in the target sub-storage area based on the storage operation information corresponding to the business data in the operation log.

[0129] Among them, in some embodiments, before storing the business data in the target sub-storage area, an operation record may be written into the operation log first, that is, the storage operation information corresponding to the business data is written into the operation log, and the storage operation information may include storage content (i.e., business data), etc. For example, the content of the storage operation information may be that user 1 initiates a transfer of 10 yuan to user 2 at time a. In this embodiment, the storage operation information corresponding to the business data may be written into the operation log, and then the business data is operated to store the business data in the target sub-storage area, so that the storage operation information of the business data can be backed up, so that when the data storage system does not actually write the business data, the business data in the target sub-storage area can be restored or re-stored according to the storage operation information corresponding to the business data in the operation log.

[0130] In some embodiments, the step of “storing the business data in the target sub-storage area” may include:

[0131] Storing the business data in the target sub-storage area, and generating target storage operation information corresponding to the business data;

[0132] When the business data is not successfully stored in the target sub-storage area, based on the storage operation information corresponding to the business data in the operation log, before re-storing the business data in the target sub-storage area, the method further includes:

[0133] Comparing the target storage operation information with the storage operation information corresponding to the business data in the operation log;

[0134] Based on the comparison result, it is determined whether the business data is successfully stored in the target sub-storage area.

[0135] The target storage operation information records the real storage operation information of the business data, that is, the business data actually stored in the target sub-storage area; the storage operation information in the operation log is the expected storage operation information of the business data. By comparing the two, it can be determined whether the business data is actually stored in the target sub-storage area. If the two are the same, it means that the business data is successfully stored in the target sub-storage area. If the two are different, it means that the business data is not successfully stored in the target sub-storage area.

[0136] The target storage operation information and the storage operation information in the operation log can be compared by using diff. The diff can be used to compare the differences between two text files; the diff can compare the similarities and differences of the text files line by line.

[0137] In a specific embodiment, the storage architecture of business data can adopt ElasticSearch, such as Figure 1c As shown, the application layer is responsible for receiving various requests from users, such as the application layer can receive a request to verify whether the business data is successfully written into the target sub-storage area. The application layer forwards the storage operation information of the business data to the Dao layer of ElasticSearch, and the Dao layer of ElasticSearch writes the storage operation information into the operation log (op log, Operation log). After the business data is stored in the target sub-storage area, it is verified whether the business data is actually stored in the target sub-storage area. The target storage operation information corresponding to the business data is obtained through routing management, and the target storage operation information is compared with the storage operation information in the operation log. If the two are different, it means that the business data is not successfully written, and a request is made to rewrite the business data. Based on the storage operation information in the operation log, the business data can be rewritten into the target sub-storage area. In this embodiment, the operation log generated by the ElasticSearch Dao is used to reconcile business data to ensure the accuracy of the data.

[0138] exist Figure 1c In the process, the operation platform can be responsible for the configuration management / console / detection alarm of ElasticSearch Dao.

[0139] ElasticSearch is an open source search framework. It is a search server that provides a distributed multi-user full-text search engine that can easily enable large amounts of data to be searched, analyzed, and explored. The Dao layer of ElasticSearch can be used to interact with the database, and it can be responsible for the CURD operations of the data. CURD stands for Create, Update, Retrieve, and Delete operations.

[0140] Optionally, in some embodiments, the target sub-storage area includes a basic data storage block and a domain data storage block, and the basic data storage block and the domain data storage block have the same storage structure; the step of “storing the business data in the target sub-storage area” may include:

[0141] Storing the business basic data in the basic data storage block;

[0142] The business domain data is stored in the domain data storage block.

[0143] The business data may include two parts, namely business basic data and business domain data, which may be stored in different storage blocks. It should be understood that the division of business data may be set according to actual conditions, and this embodiment does not limit this.

[0144] Among them, the business basic data may include a user identifier, time information, and data identifier corresponding to the business data; the data identifier may specifically be a business order number identifier.

[0145] Optionally, in some embodiments, the business data may be divided into three parts, namely, record basic information, order basic information, and business domain data; the record basic information may include a user identifier of the business data, the order basic information may include time information and data identifier of the business data, and the business domain data may include a business domain identifier, business content data, and an event identifier of a business event to which the business data belongs. When storing the business data, the three parts may be stored in different storage blocks, and the storage structures of the three storage blocks may be the same.

[0146] When there are new business requirements or business data structure adjustments, the data blocks in the sub-storage area can be adjusted accordingly. For example, if new business information is added to the business data, a new storage block can be added to the sub-storage area to store the new business information. This can increase the scalability of the storage system and facilitate the addition and deletion of business data.

[0147] Among them, scalability can refer to the expansion capability provided by the system to cope with future changes in demand. When new demands arise, the system can support them with no or only a small amount of modification, without the need to reconstruct or rebuild the entire system.

[0148] Optionally, in some embodiments, after the step of “storing the business data in the target sub-storage area”, the following steps may also be included:

[0149] Based on the storage location of the business data in the target sub-storage area, generating metadata corresponding to the business data, wherein the metadata indicates the storage location of the business data;

[0150] The metadata is added to the target data node.

[0151] Metadata is mainly information describing data attributes, used to support functions such as indicating storage location, historical data, resource search, file records, etc. Metadata is a kind of electronic directory, which is information about the organization of data, data domains and their relationships. In short, metadata is data about data.

[0152] In this embodiment, the metadata can record the specific storage location of the business data in the target sub-storage area, and adding the metadata to the target data node can facilitate subsequent access to the business data. The target data node stores the metadata of each business data in the target sub-storage area, that is, the specific storage location.

[0153] The storage architecture of the business data storage method provided in this embodiment can also be used in the business data access process, which can improve data access efficiency.

[0154] Optionally, the business data storage method may further include:

[0155] Receive a request for obtaining target business data, wherein the request includes a business domain identifier and a data identifier of the target business data;

[0156] Determine a preset storage area corresponding to the target business data;

[0157] Determine a target sub-storage area corresponding to the business domain identifier from the preset storage area;

[0158] According to the data identifier, the target business data is acquired from the target sub-storage area.

[0159] The target business data is the business data to be read. Specifically, the acquisition request may also include a user identifier of the target business data, and the preset storage area corresponding to the target business data may be determined based on the user identifier, and then the target sub-storage area may be determined from the preset storage area based on the business domain identifier, and then the specific storage location of the target business data may be determined from the target sub-storage area based on the data identifier to acquire the target business data.

[0160] The data identifier may be an order number identifier of the business data. If the business data is bill data, the data identifier may be a bill number.

[0161] Optionally, in some embodiments, the preset storage area further includes: a data index directory and a data node, the data node includes metadata of the sub-storage area, and the metadata indicates a storage location of the business data;

[0162] The step of “determining the target sub-storage area corresponding to the business domain identifier from the preset storage area” may include:

[0163] Obtaining the data node index corresponding to the business domain identifier from the data index directory;

[0164] Determine a target data node based on the data node index, and use the sub-storage area corresponding to the target data node as the target sub-storage area;

[0165] The step of “obtaining the target business data from the target sub-storage area according to the data identifier” may include:

[0166] Extracting metadata corresponding to the target business data from the target data node according to the data identifier;

[0167] Based on the metadata, the target business data is acquired from the target sub-storage area.

[0168] The data index directory includes data node indexes corresponding to each business domain, and the corresponding data node index can be found from the data index directory according to the business domain identifier. Optionally, the target data node corresponding to the data node index can store address information of the target sub-storage area corresponding to the business domain identifier. The data index directory can also be regarded as a collection of data node indexes. The data index directory includes a mapping relationship between the business domain identifier and the data node index.

[0169] The data node may store the specific storage location of each business data in the sub-storage area corresponding to the data node, that is, the metadata corresponding to each business data. The data node may include a mapping relationship between the metadata of the business data and the data identifier.

[0170] Optionally, in some embodiments, the preset storage area includes a plurality of data storage areas, each data storage area stores business data corresponding to the target time, and each data storage area includes a plurality of mutually isolated sub-storage areas; the acquisition request also includes time information;

[0171] The step of “determining the target sub-storage area corresponding to the business domain identifier from the preset storage area” may include:

[0172] Determine a target data storage area corresponding to the time information from the preset storage area;

[0173] Determine the target sub-storage area corresponding to the business domain identifier from the target data storage area.

[0174] Each data storage area stores business data of different time periods, and the user identifiers of the business data in the data storage areas belonging to the same preset storage area are the same.

[0175] Each data storage area includes sub-storage areas corresponding to each business domain. The data storage area where the target business data is stored can be determined based on the time information of the target business data, and then based on the business domain identifier, the target sub-storage area corresponding to the business domain identifier can be determined from the data storage area.

[0176] In a specific embodiment, the preset storage area may include two data storage areas, namely, a first data storage area and a second data storage area. The first data storage area may be used to store the target user's business data within one month, and the second data storage area may be used to store the target user's business data one month ago. If the time information of the target business data to be accessed is within one month, it can be determined that the target business data is stored in the first data storage area in the preset storage area, and then based on the business domain identifier of the target business data, the target sub-storage area corresponding to the business domain identifier is determined from the first data storage area.

[0177] In some embodiments, as time goes by, the business data in the first data storage area one month ago can be transferred to the second data storage area to ensure that the business data stored in the first data storage area are all business data of the user within one month.

[0178] In a specific embodiment, the business data is billing data, refer to Figure 1d , which can be the overall architecture and storage model of the storage method of the business data, wherein the billing data can include multiple business fields, such as payment field, red envelope field, transfer field, face-to-face field, refund field and industry field, etc. When the terminal generates billing data in the transaction, the billing event center can send the billing data to the access layer of the remote server side through the real-time write interface of the terminal platform, and then store it in the storage layer of the remote server. Among them, the specific process of storing the billing data in the remote server can be: based on the user identifier of the billing data, determine its preset storage area, based on the business field identifier of the billing data, determine the data node index corresponding to the business field identifier from the data index directory, and find the corresponding target data node based on the data node index. The sub-storage area corresponding to the target data node is the target sub-storage area of ​​the billing data, and the billing data is stored in the target sub-storage area.

[0179] The data structure of the bill data can be as follows: Figure 1eAs shown, the billing data may include three parts: record basic information, order basic information and business domain data, wherein the record basic information, order basic information and business domain data are parallel structures, the record basic information may include the user identifier of the billing data, the order basic information may include the time information (i.e., transaction time) and the order number identifier (i.e., transaction order number) of the billing data, and the business domain data may include the business domain identifier, business content data and the event identifier of the business event to which the billing data belongs, wherein the business content data may specifically include specific content such as hotels and tickets.

[0180] Specifically, the business data can be designed as a composite structure composed of array types. Each BusinessData (business data, i.e., the business domain data described in the previous embodiment) in the array is the information of a domain. BusinessData can be composed of BusinessType (business type, i.e., the business domain identifier described in the previous embodiment), DataVersion (data version, i.e., the event identifier described in the previous embodiment), and RealData (real data, i.e., the business content data described in the previous embodiment). Among them, BusinessType represents the type of the domain, such as BusinessType=34 can represent a transfer. RealData stores the real data in the domain, and RealData can also be an array type, that is, it supports recording the flow information of the domain.

[0181] Optionally, in this embodiment, when there is a new business demand, such as adding a new business field, through the storage method of business data provided by this application, a sub-storage area corresponding to the new business field can be added to the preset storage area, and the business data of the new business field can be stored in the sub-storage area. This application can easily add a new business field field, and has strong scalability.

[0182] In the current billing system, when storing billing data, a wide table in the MySql (a relational database management system) database is used to store each field of the bill, and a business type field in the wide table is used to distinguish the type of the bill. The existing technical solution has low scalability. If you need to add or delete fields, the implementation cost of MySql is very high. At the same time, the query speed of the existing solution is slow, and when querying data, it can only be scanned in chronological order. In addition, when different organizations operate the same wide table, data pollution is likely to occur.

[0183] The storage method of business data in this embodiment can reorganize business data by domain. The introduction of business domain data can realize the isolation of domains from the data level, facilitate the addition or deletion of fields, and has strong scalability. The data between domains is isolated from each other, which also improves the data pollution problem. At the same time, ElasticSearch can also be used as a data storage tool to greatly improve the query efficiency of data.

[0184] As can be seen from the above, the electronic device of this embodiment can obtain business data to be stored, the business data includes business basic data and business domain data, the business domain data includes business domain identification and business content data; identify the target business domain corresponding to the business data according to the business domain identification; determine the preset storage area where the business data needs to be stored based on the business basic data; determine the target sub-storage area corresponding to the target business domain from the preset storage area, the preset storage area includes: multiple mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business domain; store the business data in the target sub-storage area. The embodiment of the present application can store business data based on the business domain identification, thereby improving the storage efficiency of business data.

[0185] According to the method described in the previous embodiment, the following will be further described in detail by taking the example that the storage device of the business data is specifically integrated in the server.

[0186] The present application embodiment provides a method for storing business data, such as Figure 2a As shown, the specific process of the storage method of the business data can be as follows:

[0187] 201. The server receives business data to be stored sent by a terminal, wherein the business data includes business basic data and business domain data, and the business domain data includes a business domain identifier, business content data, and an event identifier of a business event to which the business data belongs.

[0188] The business data may specifically be bill data. Bill: refers to the transaction voucher generated by the terminal after the user makes a transaction at the terminal. The user can view transaction details, expenditure and income statistics and other information based on this voucher.

[0189] When the user successfully pays on the terminal side, the corresponding bill data will be generated and stored on the terminal payment side. At the same time, the bill data will also be written to the remote storage side.

[0190] Among them, business basic data may include user identification, time information and data identification corresponding to business data; data identification may specifically be business order identification. Business areas refer to different business types. For example, in the payment transaction scenario, business areas may include red envelopes, transfers, top-ups and withdrawals.

[0191] 202. The server identifies a target business domain corresponding to the business data according to the business domain identifier.

[0192] 203. The server determines, based on the basic business data, a preset storage area where the business data needs to be stored.

[0193] In some embodiments, the business basic data includes a user identifier corresponding to the business data, and the preset storage area where the business data needs to be stored can be determined based on the user identifier. The preset storage area stores the business data corresponding to the user identifier.

[0194] The storage architecture of the business data may be to divide the storage area according to the user identification, and different user identifications correspond to different preset storage areas.

[0195] 204. The server determines a target sub-storage area corresponding to the target business domain from the preset storage area, wherein the preset storage area includes: a plurality of mutually isolated sub-storage areas, each sub-storage area being used to store business data of a corresponding business domain.

[0196] 205. The server verifies the event identifier in the business domain data based on the current event identifier of the business event.

[0197] Among them, a business event may include multiple links, and multiple business data will be generated. Different business data belonging to the same business event corresponds to different event identifiers. Among them, the event identifier is the data version (Data Version), and the Data Version is used as an optimistic lock, that is, the correct Data Version is required every time the business data of the target sub-storage area is written or modified.

[0198] 206. When the event identifier verification passes, the server stores the business data in the target sub-storage area, and updates the current event identifier of the business event to the event identifier in the business domain data.

[0199] Optionally, in some embodiments, before the step of “storing the business data in the target sub-storage area”, the following steps may also be included:

[0200] Writing storage operation information corresponding to the business data into an operation log;

[0201] The step of “storing the business data into the target sub-storage area” may include:

[0202] Storing the business data in the target sub-storage area, and generating target storage operation information corresponding to the business data;

[0203] After the step of "storing the business data in the target sub-storage area", the method further includes:

[0204] Comparing the target storage operation information with the storage operation information corresponding to the business data in the operation log;

[0205] Based on the comparison result, determining whether the business data is successfully stored in the target sub-storage area;

[0206] When the business data is not successfully stored in the target sub-storage area, the business data is stored again in the target sub-storage area based on the storage operation information corresponding to the business data in the operation log.

[0207] The target storage operation information records the real storage operation information of the business data, that is, the business data actually stored in the target sub-storage area; the storage operation information in the operation log is the expected storage operation information of the business data. By comparing the two, it can be determined whether the business data is actually stored in the target sub-storage area. If the two are the same, it means that the business data is successfully stored in the target sub-storage area. If the two are different, it means that the business data is not successfully stored in the target sub-storage area.

[0208] The target storage operation information and the storage operation information in the operation log can be compared by using diff. The diff can be used to compare the differences between two text files; the diff can compare the similarities and differences of the text files line by line.

[0209] Optionally, in some embodiments, the target sub-storage area includes a basic data storage block and a domain data storage block, and the basic data storage block and the domain data storage block have the same storage structure; the step of “storing the business data in the target sub-storage area” may include:

[0210] Storing the business basic data in the basic data storage block;

[0211] The business domain data is stored in the domain data storage block.

[0212] In one embodiment, if Figure 2bAs shown, bill 1.0 is a bill operated by the storage system of the business data storage method provided by this application, and bill 2.0 is a bill operated by the storage system of the prior art. The data on the horizontal axis represent the operations on the bill data, namely, access to the "full list", "details page", "classification items" of the bill data, deletion of the bill data, "filter by merchant", "filter by relative card" or "filter by entrusted deduction" bill data. Figure 2b It can be seen that the method provided in this application can greatly reduce the interface time consumption, with the main interface time consumption reduced by more than 50%, and the time consumption of some interfaces reduced by more than 90%; in addition, the scalability is greatly improved; the data pollution situation is significantly improved, which is significantly better than the existing technology.

[0213] The solution provided in this embodiment can be applied to the payment of user bills on the terminal side. By storing user bill data through this solution, the waiting time for users to query bill data can be reduced, and the reading efficiency of the system for bill data can be improved.

[0214] In some embodiments, when a user completes a payment operation on the terminal side, bill data corresponding to the payment operation may be generated on the terminal side. The bill data may include business basic data and business domain data. The business domain data may include a business domain identifier and business content data. Figure 2c As shown, the bill generated for paying transportation fees, wherein the business basic data of the bill may include payment time and payment user identification; the business domain identification may be password-free payment, or transportation payment, etc., which may be set according to actual conditions, and this embodiment does not limit this; the business content data may include information such as the deduction amount, ride time, and ride route. At the same time, the terminal may send the bill data to the server so that the server stores the bill data based on the business domain identification of the bill data. The specific storage process can refer to the description of the above embodiment, which will not be repeated here.

[0215] Optionally, in this embodiment, the bill data can be queried on the bill page of the terminal side. The bill page can be as follows: Figure 2d As shown, where the domain selection control (i.e. Figure 2d The trigger operation of the business data storage method provided by the present application can quickly access the billing data of the target field type.

[0216] As can be seen from the above, in this embodiment, the business data to be stored sent by the terminal can be received by the server, the business data includes business basic data and business domain data, the business domain data includes business domain identification, business content data, and event identification of the business event to which the business data belongs; the target business domain corresponding to the business data is identified according to the business domain identification; the preset storage area to which the business data needs to be stored is determined based on the business basic data; the target sub-storage area corresponding to the target business domain is determined from the preset storage area, and the preset storage area includes: multiple mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business domain; based on the current event identification of the business event, the event identification in the business domain data is verified; when the event identification verification passes, the server stores the business data in the target sub-storage area, and updates the current event identification of the business event to the event identification in the business domain data. The embodiment of the present application can store business data based on the business domain identification, thereby improving the storage efficiency of business data.

[0217] In order to better implement the above method, the embodiment of the present application also provides a storage device for business data, such as Figure 3a As shown, the storage device of the business data may include an acquisition unit 301, an identification unit 302, a first determination unit 303, a second determination unit 304 and a storage unit 305, as follows:

[0218] (1) Acquisition unit 301;

[0219] The acquisition unit 301 is used to acquire the business data to be stored, wherein the business data includes basic business data and business domain data, and the business domain data includes a business domain identifier and business content data.

[0220] (2) identification unit 302;

[0221] The identification unit 302 is configured to identify a target business domain corresponding to the business data according to the business domain identifier.

[0222] (3) a first determining unit 303;

[0223] The first determining unit 303 is configured to determine, based on the business basic data, a preset storage area where the business data needs to be stored.

[0224] (4) a second determining unit 304;

[0225] The second determining unit 304 is used to determine the target sub-storage area corresponding to the target business field from the preset storage area, and the preset storage area includes: a plurality of mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business field.

[0226] Optionally, in some embodiments of the present application, the preset storage area further includes: a data index directory and a data node, and the second determining unit 304 may include a first obtaining subunit 3041 and a second determining subunit 3042, see Figure 3b ,as follows:

[0227] The first acquisition subunit 3041 is used to acquire the data node index corresponding to the target business field from the data index directory;

[0228] The second determining subunit 3042 is configured to determine a target data node based on the data node index, and use the sub-storage area corresponding to the target data node as a target sub-storage area.

[0229] (5) storage unit 305;

[0230] The storage unit 305 is used to store the business data in the target sub-storage area.

[0231] Optionally, in some embodiments of the present application, the business domain data further includes an event identifier of a business event to which the business data belongs; the storage unit 305 may include a verification subunit 3051 and a storage subunit 3052, see Figure 3c ,as follows:

[0232] The verification subunit 3051 is used to verify the event identifier in the business domain data based on the current event identifier of the business event;

[0233] The storage subunit 3052 is used to store the business data into the target sub-storage area when the event identifier verification passes.

[0234] Optionally, in some embodiments of the present application, the storage unit 305 may further include an updating subunit 3053, see Figure 3d ,as follows:

[0235] The updating subunit 3053 is used to update the current event identifier of the business event to the event identifier in the business domain data.

[0236] Optionally, in some embodiments of the present application, the storage unit 305 may include a writing subunit 3054, a first storage subunit 3055, and a second storage subunit 3056, see Figure 3e ,as follows:

[0237] The writing subunit 3054 is used to write the storage operation information corresponding to the business data into the operation log;

[0238] The first storage subunit 3055 is used to store the business data into the target sub-storage area;

[0239] The second storage subunit 3056 is used to store the business data again in the target sub-storage area based on the storage operation information corresponding to the business data in the operation log when the business data is not successfully stored in the target sub-storage area.

[0240] Optionally, in some embodiments of the present application, the first storage subunit 3055 may be specifically used to store the business data in the target sub-storage area, and generate target storage operation information corresponding to the business data;

[0241] The storage unit 305 may further include a comparison subunit 3057 and a first determination subunit 3058. Figure 3f ,as follows:

[0242] The comparison subunit 3057 is used to compare the target storage operation information with the storage operation information corresponding to the business data in the operation log;

[0243] The first determining subunit 3058 is used to determine whether the business data is successfully stored in the target sub-storage area based on the comparison result.

[0244] Optionally, in some embodiments of the present application, the target sub-storage area includes a basic data storage block and a domain data storage block, and the basic data storage block and the domain data storage block have the same storage structure; the storage unit 305 may include a third storage sub-unit 3059 and a fourth storage sub-unit 30510, see Figure 3g ,as follows:

[0245] The third storage subunit 3059 is used to store the business basic data in the basic data storage block;

[0246] The fourth storage subunit 30510 is used to store the business domain data in the domain data storage block.

[0247] Optionally, in some embodiments of the present application, the storage unit 305 may further include a generating subunit 30511 and an adding subunit 30512, see Figure 3h ,as follows:

[0248] The generating subunit 30511 is used to generate metadata corresponding to the business data based on the storage location of the business data in the target sub-storage area, wherein the metadata indicates the storage location of the business data;

[0249] The adding subunit 30512 is used to add the metadata to the target data node.

[0250] Optionally, in some embodiments of the present application, the storage device for the business data may further include a receiving unit 306, a third determining unit 307, a fourth determining unit 308 and a data acquiring unit 309, see Figure 3i ,as follows:

[0251] The receiving unit 306 is used to receive a request for obtaining target business data, wherein the request includes a business domain identifier and a data identifier of the target business data;

[0252] A third determining unit 307, configured to determine a preset storage area corresponding to the target service data;

[0253] A fourth determining unit 308, configured to determine a target sub-storage area corresponding to the business domain identifier from the preset storage area;

[0254] The data acquisition unit 309 is used to acquire the target business data from the target sub-storage area according to the data identifier.

[0255] Optionally, in some embodiments of the present application, the preset storage area further includes: a data index directory and a data node, the data node includes metadata of the sub-storage area, and the metadata indicates a storage location of the business data;

[0256] The fourth determining unit 308 may include a second obtaining subunit 3081 and a third determining subunit 3082. Figure 3j ,as follows:

[0257] The second acquisition subunit 3081 is used to acquire the data node index corresponding to the business domain identifier from the data index directory;

[0258] The third determining subunit 3082 is used to determine the target data node based on the data node index, and use the sub-storage area corresponding to the target data node as the target sub-storage area.

[0259] The data acquisition unit 309 may include an extraction subunit 3091 and a third acquisition subunit 3092. Figure 3k ,as follows:

[0260] The extraction subunit 3091 is used to extract metadata corresponding to the target business data from the target data node according to the data identifier;

[0261] The third acquisition subunit 3092 is used to acquire the target business data from the target sub-storage area based on the metadata.

[0262] Optionally, in some embodiments of the present application, the preset storage area includes multiple data storage areas, each data storage area stores business data within a corresponding target time, and each data storage area includes multiple mutually isolated sub-storage areas; the acquisition request also includes time information;

[0263] The fourth determining unit 308 may include a fourth determining subunit 3083 and a fifth determining subunit 3084. Figure 3l ,as follows:

[0264] The fourth determining subunit 3083 is used to determine a target data storage area corresponding to the time information from the preset storage area;

[0265] The fifth determining subunit 3084 is configured to determine, from the target data storage area, a target sub-storage area corresponding to the business domain identifier.

[0266] As can be seen from the above, in this embodiment, the acquisition unit 301 acquires the business data to be stored, the business data includes business basic data and business domain data, the business domain data includes business domain identification and business content data; the identification unit 302 identifies the target business domain corresponding to the business data according to the business domain identification; the first determination unit 303 determines the preset storage area where the business data needs to be stored based on the business basic data; the second determination unit 304 determines the target sub-storage area corresponding to the target business domain from the preset storage area, the preset storage area includes: multiple mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business domain; the business data is stored in the target sub-storage area through the storage unit 305. The embodiment of the present application can store business data based on the business domain identification, thereby improving the storage efficiency of business data.

[0267] The present application also provides an electronic device, such as Figure 4 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, and the electronic device may be a terminal or a server, etc. Specifically:

[0268] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0269] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0270] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0271] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0272] The electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0273] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:

[0274] Acquire business data to be stored, the business data including business basic data and business domain data, the business domain data including a business domain identifier and business content data; identify a target business domain corresponding to the business data according to the business domain identifier; determine a preset storage area where the business data needs to be stored based on the business basic data; determine a target sub-storage area corresponding to the target business domain from the preset storage area, the preset storage area including: a plurality of mutually isolated sub-storage areas, each sub-storage area being used to store business data of a corresponding business domain; store the business data in the target sub-storage area.

[0275] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0276] As can be seen from the above, this embodiment can obtain the business data to be stored, the business data includes business basic data and business domain data, the business domain data includes business domain identification and business content data; identify the target business domain corresponding to the business data according to the business domain identification; determine the preset storage area where the business data needs to be stored based on the business basic data; determine the target sub-storage area corresponding to the target business domain from the preset storage area, the preset storage area includes: multiple mutually isolated sub-storage areas, each sub-storage area is used to store business data of the corresponding business domain; store the business data in the target sub-storage area. The embodiment of the present application can store business data based on the business domain identification, thereby improving the storage efficiency of business data.

[0277] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0278] To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any of the business data storage methods provided in the embodiments of the present application. For example, the instructions can execute the following steps:

[0279] Acquire business data to be stored, the business data including business basic data and business domain data, the business domain data including a business domain identifier and business content data; identify a target business domain corresponding to the business data according to the business domain identifier; determine a preset storage area where the business data needs to be stored based on the business basic data; determine a target sub-storage area corresponding to the target business domain from the preset storage area, the preset storage area including: a plurality of mutually isolated sub-storage areas, each sub-storage area being used to store business data of a corresponding business domain; store the business data in the target sub-storage area.

[0280] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0281] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0282] Since the instructions stored in the storage medium can execute the steps in any business data storage method provided in the embodiments of the present application, the beneficial effects that can be achieved by any business data storage method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0283] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the storage of the above-mentioned business data.

[0284] The above is a detailed introduction to a storage method, device, electronic device and storage medium for business data provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for storing business data, characterized in that: include: Acquire business data to be stored, the business data including business basic data and business domain data, the business domain data including business domain identifier and business content data; Identifying a target business domain corresponding to the business data according to the business domain identifier; Determine, based on the business basic data, a preset storage area in which the business data needs to be stored; Determining a target sub-storage area corresponding to the target business field from the preset storage area, the preset storage area comprising: a plurality of mutually isolated sub-storage areas, each sub-storage area being used to store business data of a corresponding business field; Writing storage operation information corresponding to the business data into an operation log; Storing the business data in the target sub-storage area, and generating target storage operation information corresponding to the business data; Comparing the target storage operation information with the storage operation information corresponding to the business data in the operation log; Based on the comparison result, determining whether the business data is successfully stored in the target sub-storage area; When the business data is not successfully stored in the target sub-storage area, the business data is stored again in the target sub-storage area based on the storage operation information corresponding to the business data in the operation log.

2. The method according to claim 1, characterized in that The business domain data also includes an event identifier of a business event to which the business data belongs; before storing the business data in the target sub-storage area, the process further includes: Based on the current event identifier of the business event, verifying the event identifier in the business domain data; The storing the business data into the target sub-storage area includes: When the event identification verification passes, the business data is stored in the target sub-storage area.

3. The method according to claim 2, characterized in that When the event identifier verification is passed, after storing the business data in the target sub-storage area, the method further includes: The current event identifier of the business event is updated to the event identifier in the business domain data.

4. The method according to claim 1, characterized in that: The target sub-storage area includes a basic data storage block and a domain data storage block, and the basic data storage block and the domain data storage block have the same storage structure; The storing the business data into the target sub-storage area includes: Storing the business basic data in the basic data storage block; The business domain data is stored in the domain data storage block.

5. The method according to claim 1, characterized in that The preset storage area further includes: a data index directory and a data node. The determining of the target sub-storage area corresponding to the target business field from the preset storage area includes: Obtaining a data node index corresponding to the target business domain from the data index directory; A target data node is determined based on the data node index, and a sub-storage area corresponding to the target data node is used as a target sub-storage area.

6. The method according to claim 5, characterized in that After storing the business data in the target sub-storage area, the method further includes: Based on the storage location of the business data in the target sub-storage area, generating metadata corresponding to the business data, wherein the metadata indicates the storage location of the business data; The metadata is added to the target data node.

7. The method according to claim 1, characterized in that The method further comprises: Receive a request for obtaining target business data, wherein the request includes a business domain identifier and a data identifier of the target business data; Determine a preset storage area corresponding to the target business data; Determine a target sub-storage area corresponding to the business domain identifier from the preset storage area; According to the data identifier, the target business data is acquired from the target sub-storage area.

8. The method according to claim 7, characterized in that The preset storage area also includes: a data index directory and a data node, the data node includes metadata of the sub-storage area, and the metadata indicates the storage location of the business data; The determining of the target sub-storage area corresponding to the business domain identifier from the preset storage area includes: Obtaining the data node index corresponding to the business domain identifier from the data index directory; Determine a target data node based on the data node index, and use the sub-storage area corresponding to the target data node as the target sub-storage area; The acquiring the target business data from the target sub-storage area according to the data identifier includes: Extracting metadata corresponding to the target business data from the target data node according to the data identifier; Based on the metadata, the target business data is acquired from the target sub-storage area.

9. The method according to claim 7, characterized in that: The preset storage area includes a plurality of data storage areas, each of which stores business data corresponding to a target time, and each of which includes a plurality of mutually isolated sub-storage areas; The acquisition request also includes time information; The determining of the target sub-storage area corresponding to the business domain identifier from the preset storage area includes: Determine a target data storage area corresponding to the time information from the preset storage area; Determine the target sub-storage area corresponding to the business domain identifier from the target data storage area.

10. A storage device for business data, characterized in that: include: An acquisition unit, used to acquire business data to be stored, wherein the business data includes business basic data and business domain data, and the business domain data includes a business domain identifier and business content data; an identification unit, configured to identify a target business domain corresponding to the business data according to the business domain identifier; A first determining unit, configured to determine, based on the business basic data, a preset storage area in which the business data needs to be stored; A second determining unit is used to determine a target sub-storage area corresponding to the target business field from the preset storage area, wherein the preset storage area includes: a plurality of mutually isolated sub-storage areas, each sub-storage area is used to store business data of a corresponding business field; A storage unit, used to write storage operation information corresponding to the business data into an operation log; store the business data in the target sub-storage area and generate target storage operation information corresponding to the business data; compare the target storage operation information with the storage operation information corresponding to the business data in the operation log; determine whether the business data is successfully stored in the target sub-storage area based on the comparison result; when the business data is not successfully stored in the target sub-storage area, based on the storage operation information corresponding to the business data in the operation log, store the business data again in the target sub-storage area.

11. An electronic device, characterized in that: It comprises a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the steps in the business data storage method described in any one of claims 1 to 9.

12. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the business data storage method according to any one of claims 1 to 9.