Data processing method based on document-type database and related device

By storing data from multiple data sources in a local document-oriented database and processing it according to the initial format, the problem of high system overhead caused by inconsistent formats of different data sources is solved, and efficient data processing and error troubleshooting are achieved.

CN117591474BActive Publication Date: 2026-11-03SHENZHEN KAADAS INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311586262.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2026-11-03
Estimated Expiration
2043-11-23

AI Technical Summary

Technical Problem

When processing business logic, the inconsistent data formats and triggering conditions of different data sources mean that the original data needs to be retrieved from different data sources every time there is a change in business logic, which makes development and implementation difficult and results in excessive system overhead.

Method used

A document-based database-based data processing method is adopted. By establishing a document-based database locally to store data from multiple data sources, the initial data format of each data source remains unchanged. The target data source and acquisition rules are determined in response to data acquisition instructions, and the target data is retrieved from the document-based database and output.

Benefits of technology

It reduces system overhead, allows data from each data source to be stored in its original format, facilitates subsequent error troubleshooting, and improves data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117591474B_ABST
    Figure CN117591474B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a data processing method based on a document type database and a related device, and the method comprises the following steps: in response to a data acquisition instruction, determining the business logic corresponding to the data acquisition instruction; determining the target data source and the data acquisition rule corresponding to the business logic; acquiring the target data corresponding to the target data source from the document type database according to the data acquisition rule, wherein the data of a plurality of data sources is stored in the document type database, and the data of each data source is stored in the initial data source format, and the target data source is any one of the plurality of data sources; and outputting the target data. The embodiment of the application can reduce the system overhead by establishing the document type database on the local to acquire the data of different data sources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a data processing method and related apparatus based on a document-based database. Background Technology

[0002] When processing business-related data, this data may come from multiple data sources, such as external third-party systems and internal systems.

[0003] In business logic processing, data is typically processed directly from the data source. However, due to inconsistencies in data formats and triggering or receiving conditions between different data sources, it is necessary to retrieve the original data related to the business logic from different data sources every time a change in business logic is involved. This results in high development difficulty and excessive system overhead. Summary of the Invention

[0004] This application provides a data processing method and related apparatus based on a document-oriented database. By establishing a local document-oriented database, it is possible to acquire data from different data sources, which can reduce system overhead and allow the data from each data source to be stored in its original data format without any processing of the data source. This is beneficial for subsequent error investigation of the data source and for improving data processing efficiency.

[0005] In a first aspect, embodiments of this application provide a data processing method based on a document-oriented database, including:

[0006] In response to a data acquisition instruction, determine the business logic corresponding to the data acquisition instruction;

[0007] Determine the target data source and data acquisition rules corresponding to the business logic;

[0008] According to the data acquisition rules, target data corresponding to the target data source is obtained from the document database. The document database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format. The target data source is any one of the multiple data sources.

[0009] Output the target data.

[0010] Secondly, embodiments of this application provide a data processing apparatus based on a document-oriented database, the apparatus comprising: a determining unit, a data acquiring unit, and an output unit, wherein...

[0011] The determining unit is used to determine the business logic corresponding to the data acquisition instruction in response to the data acquisition instruction;

[0012] The determining unit is further configured to determine the target data source and data acquisition rules corresponding to the business logic;

[0013] The data acquisition unit is used to acquire target data corresponding to the target data source from the document database according to the data acquisition rules, wherein the document database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format, and the target data source is any one of the multiple data sources;

[0014] The output unit is used to output the target data.

[0015] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing some or all of the steps described in the first aspect of embodiments of this application.

[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of embodiments of this application.

[0017] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of embodiments of this application. The computer program product may be a software installation package.

[0018] Implementing the embodiments of this application has the following beneficial effects:

[0019] As can be seen, the data processing method and related apparatus based on a document-oriented database described in this application embodiment, in response to a data acquisition instruction, determine the business logic corresponding to the data acquisition instruction; determine the target data source and data acquisition rules corresponding to the business logic; acquire target data corresponding to the target data source from the document-oriented database according to the data acquisition rules, wherein the document-oriented database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format, and the target data source is any one of the multiple data sources; and output the target data. Thus, by establishing a local document-oriented database to acquire data from different data sources, system overhead can be reduced, and the data from each data source can be stored in its initial data format without any processing of the data source, which is beneficial for subsequent error troubleshooting of the data source and for improving data processing efficiency. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the architecture of a data processing system based on a document-type database provided in an embodiment of this application;

[0022] Figure 2 This is a flowchart illustrating a data processing method based on a document-based database provided in an embodiment of this application;

[0023] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0024] Figure 4 This is a functional unit block diagram of a data processing device based on a document-type database provided in an embodiment of this application. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0026] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or electronic device that includes a series of steps or units is not limited to the listed steps or units, but in an alternative example also includes steps or units not listed, or in an alternative example also includes other steps or units inherent to these processes, methods, products, or electronic devices.

[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0028] Electronic devices may include smartphones (such as Android phones, iOS phones, Windows Phones, etc.), tablets, PDAs, dashcams, in-vehicle electronic devices, servers, laptops, mobile internet devices (MIDs), or wearable electronic devices (such as smartwatches, Bluetooth headsets), etc. The above are merely examples and not exhaustive, and include, but are not limited to, the electronic devices described above. In some embodiments, the electronic device may also be a server, including but not limited to a backend server, component server, document-based database data processing system server, document-based database data processing software server, or data processing upgrade server, etc.

[0029] Please see Figure 1 , Figure 1 This is a schematic diagram of the architecture of a data processing system based on a document-oriented database, provided as an embodiment of this application. Figure 1 As shown, the document-based database-driven data processing system includes: multiple data sources (e.g., a first platform, a second platform, and a third platform), a document-based database, a display screen, a cache, and a persistent storage database.

[0030] The aforementioned electronic devices may be equipped with the aforementioned document-based database-based data processing system.

[0031] Each of the aforementioned platforms can correspond to a data source. For example, the first platform can be a third-party platform (e.g., an e-commerce platform), the second platform can be a cloud management platform, the third platform can be a local management platform, and so on. No specific restrictions are imposed here.

[0032] The electronic device may include a display screen, which can be used to directly display the target data after the output data processing.

[0033] The system can store the aforementioned target data as hot data in a cache or in a persistent storage database.

[0034] Among them, the aforementioned document-based database can be used to store data from different data sources, and the data from different data sources can be stored in the initial or original data source format without data processing.

[0035] For example, the data processing system can receive a data acquisition instruction issued by a processor or user through an electronic device, determine the business logic of the data acquisition instruction, determine the target data source (which can be the first platform and / or the second platform and / or the third platform mentioned above) and data acquisition rules corresponding to the business logic, and according to the data acquisition rules, obtain the target data corresponding to the target data source from the document database, and output the target data to the display screen, or output the target data to the cache, or output the target data to the persistent storage database.

[0036] Please see Figure 2 , Figure 2 This is a flowchart illustrating a data processing method based on a document-oriented database provided in an embodiment of this application; it can be applied to, for example... Figure 1 The data processing system or electronic device based on a document-oriented database shown herein includes the following methods.

[0037] 201. In response to a data acquisition instruction, determine the business logic corresponding to the data acquisition instruction.

[0038] The aforementioned data retrieval instructions can be issued by the business system and can be used to retrieve data corresponding to business logic. This data exists in, for example, […]. Figure 1 Among the multiple data sources shown.

[0039] The aforementioned business logic can be the processing logic at the electronic device level used by developers to implement a certain function or service during testing or development; for example, it can be the processing logic used during testing to test whether the locking and unlocking function of a certain smart lock in the management system can work normally; the business logic can also be the processing logic used by sales personnel to determine the sales performance of a certain product, etc., without limitation.

[0040] 202. Determine the target data source and data acquisition rules corresponding to the business logic.

[0041] The aforementioned target data sources can correspond to business logic, and there can be one or more corresponding data sources. Multiple data sources can refer to two or more data sources, which will not be elaborated further.

[0042] The data acquisition rules can be user-defined or system defaults, and are not limited here. These rules can include methods such as electronic devices actively pulling data or subscription methods. Subscription methods refer to data being actively provided by the data source, which the receiver can directly receive and store. The receiver can be one of the aforementioned... Figure 1 The displayed screen, cache, and persistent storage database, etc.

[0043] 203. According to the data acquisition rules, obtain the target data corresponding to the target data source from the document database, wherein the document database stores data from multiple data sources, and the data from each data source is stored in the initial data source format, and the target data source is any one of the multiple data sources.

[0044] Among them, the aforementioned document-based database can be pre-deployed in systems or electronic devices and can be used to store documents in various formats such as JSON and BSON. It does not require pre-defining the data structure and allows each document to have its own unique structure.

[0045] In this way, collections can be created in the document database according to the interface (Application Programming Interface, API) of each data source, and each collection can be used to store data from a data source.

[0046] For business logic that requires high-frequency or repeated access to data sources, since protocols such as HTTP and WebSocket are generally used for access, each API access requires network overhead. When the network is poor or the data transmission is large, it will seriously affect the data transmission performance. Using a document-oriented database can avoid the impact of network issues.

[0047] 204. Output the target data.

[0048] In an optional example, step 201 above, determining the target data source and data acquisition rules corresponding to the business logic, may include the following steps:

[0049] 11. Determine the business requirements corresponding to the aforementioned business logic;

[0050] 12. Determine the ternary combination corresponding to the aforementioned business requirements;

[0051] 13. Determine the target index number based on the aforementioned ternary combination;

[0052] 14. Based on the preset mapping relationship between document-oriented database index numbers and the data source, determine the target data source corresponding to the target index number; and,

[0053] 15. Based on the business requirements, determine the business type corresponding to the target data source;

[0054] 16. If the business type is the first business type, then the data acquisition rule is determined to be an active acquisition method;

[0055] 17. If the business type is the second business type, then the data acquisition rule is determined to be a subscription method.

[0056] Among them, steps 11-14 above are the steps to determine the target data source corresponding to the business logic, and steps 15-17 are the steps to determine the data acquisition rules corresponding to the business logic.

[0057] One business logic corresponds to at least one business requirement. For example, the business logic for testers to test whether the smart lock's opening and closing function can work properly can correspond to two business requirements: the opening and closing function works properly and the opening and closing function does not work properly.

[0058] One business requirement may require data from multiple data sources. For example, the data needed for a lock to function properly may be obtained from both the cloud management platform and the local management platform.

[0059] The aforementioned triplets can exist in the form of (subject, predicate, object), with each triplet describing a business requirement. The object can refer to specific data content related to the subject stored in a document-based database, or other subjects related to the subject. The predicate verb describes the relationship between the subject and the object. Different objects or subjects correspond to different data sources, i.e., different data sources.

[0060] For example, the subject can refer to different subcategories corresponding to the same business type. For instance, shopping business types such as office supplies, daily necessities, and travel supplies can be the subjects, while the object can be the money, quantity, etc., related to the aforementioned office supplies, daily necessities, and travel supplies. The relationship between the subject and object corresponding to the predicate verb can be: how much money, how many quantities, or how many quantities are left in the warehouse for office supplies, daily necessities, or travel supplies.

[0061] The electronic device can preset the method for generating index numbers for the subject or object in the above-mentioned three-element combination. For example, the index number can be identified by an 8-digit string, with the first 3 digits identifying the subject and the last 5 digits identifying the object. The index number can be used to search for data corresponding to the data source in a document-based database, that is, to search for data from different data sources stored in the document database.

[0062] Among them, the electronic device can preset the mapping relationship between the index number of the document database and the data source, and can introduce an index table, which stores the index number and the corresponding data source.

[0063] The aforementioned business types may include a first business type and a second business type. The first business type and / or the second business type may be set by the user or by the system default, and are not limited here. For example, the data of the first business type may be fixed data, such as username, user mobile phone number, type of office supplies, etc., while the data of the second business type may be real-time changing data, such as sales volume of office supplies, number of times smart locks are opened and closed, etc., and are not limited here.

[0064] As can be seen in this example, the electronic device can decouple business logic processing from data source acquisition logic. It stores the data source in a document-oriented database without processing it, and determines the target data source and data acquisition rules based on business logic. It can then directly retrieve the target data from the document-oriented database according to the data acquisition rules. This allows it to process business logic according to business needs and set index numbers to establish a mapping relationship between the index number and the data source, which is beneficial for subsequent backtracking or error troubleshooting of the data source.

[0065] In an optional example, step 203 above, which involves retrieving the target data corresponding to the target data source from the document-based database according to the data retrieval rules, may include the following steps:

[0066] 31. If the data acquisition rule is the active acquisition method, then according to the pre-set task scheduling rules, the target data corresponding to the target data source is obtained from the document database;

[0067] 32. If the data acquisition rule is the subscription method, then when there is a data update in the target data source, the updated data sent by the target data source is received through the document database as the target data.

[0068] The data for the first business type can be obtained proactively from a document-based database; for example, the scheduling time and number of scheduling cycles can be set.

[0069] The second type of business data can be obtained through a subscription method. When the data or target data is updated, such as when it is added or reduced, the data source can actively send the updated data to the document database, and then actively send it to the recipient through the document database. The recipient can then directly receive or store the data.

[0070] As can be seen, in this example, the electronic device can define data acquisition rules and select different data acquisition rules according to the business type, which is beneficial to meet different business needs. Furthermore, when API access exceeds a certain threshold, API access will be restricted. If the business logic requires a large number of API accesses in a short period of time, it will be rate-limited. The two data acquisition rules described in this application embodiment can both access the data in the data source through a document-oriented database, which can avoid the above-mentioned problem of API access limit and there is no problem of access restriction on the source data.

[0071] In an optional example, the data from the multiple data sources are stored in multiple collections corresponding to the document database, with each data source corresponding to one collection. Before step 203 above, and before retrieving the target data corresponding to the target data source from the document database according to a pre-set task scheduling rule, the method may further include the following steps:

[0072] A1. If the business logic corresponds to multiple target index numbers, then the association relationship between the multiple target sets is determined according to the ternary combination corresponding to each target index number.

[0073] A2. Determine the task scheduling rules based on the relationships between the multiple target sets.

[0074] When business logic requires data to be retrieved from different platforms or data sources, different APIs need to be accessed each time. If the API of one platform is unstable, it may affect the entire business logic of retrieving data from the data source. Therefore, electronic devices can set up multiple collections in a document-oriented database, with each collection corresponding to a data source and each data source corresponding to an API. In this way, data obtained from different APIs can be stored in different collections, which can decouple the stability and reliability of the data source or platform from the data retrieval process.

[0075] As can be seen in this example, when the business logic indicates that data needs to be obtained from multiple target data sources or platforms, the electronic device can establish the association between multiple target sets corresponding to multiple target data sources by combining the three elements corresponding to the index number, and further generate task scheduling rules to decouple the logic of business logic processing and data acquisition rules, which is conducive to improving data acquisition efficiency.

[0076] In an optional example, in step A2 above, determining the task scheduling rules based on the association relationships between the multiple target sets can include the following steps:

[0077] A21. Generate a query statement based on the relationships between the multiple target sets;

[0078] A22. Based on the query statement, determine the scheduling position of the target data corresponding to each target set, and determine the scheduling time and number of scheduling times based on the ternary combination;

[0079] A23. Generate the task scheduling rule based on the scheduling location, the scheduling time, and the number of scheduling attempts.

[0080] The relationships between the aforementioned target sets can be established through fields. Taking the subject of the target index number as an example, the field for office supplies can be set to 100-199, and the field for daily necessities can be set to 201-299. For example, for office supplies, pencils are 100 and pens are 101. If the subject in the ternary combination corresponding to target index number A is 100, and the subject in the ternary combination corresponding to target index number B is 101, it indicates that target index number A and target index number B belong to the same subject. Therefore, a relationship can be established between target set A corresponding to target index number A and target set B corresponding to target index number B. A query statement containing 100 and 101 can be generated. This query statement is used to indicate that data corresponding to the same subject type, including 100 and 101, needs to be retrieved from the document database.

[0081] Furthermore, the electronic device can determine the target data source corresponding to a target index number based on the preset mapping relationship between index numbers and data sources. It can then determine the scheduling position of the required target data from the target set corresponding to the target data source, and adjust the attributes of the data corresponding to that scheduling position in real time based on the ternary combination. Finally, it can generate task scheduling rules based on the scheduling position, scheduling time, and scheduling count. The scheduling position can be used to limit the location from which target data is retrieved from the document database; the scheduling time can be used to limit the time or period for retrieving target data from the document database; and the scheduling count can be used to limit the number of times target data is retrieved from the document database.

[0082] Optionally, the aforementioned relationship can also be a data dependency relationship. For example, if there is a data dependency relationship between the subject of target index number B and target index number A, that is, when the subject corresponding to target index number B is used, it needs the cooperation of the subject corresponding to target index number A. Therefore, when the electronic device determines that the business logic needs to obtain the subject corresponding to target index number B, it can determine whether there is a data dependency relationship between the subject corresponding to target index number B and target index number A. If there is a data dependency relationship with target index number A, it can be determined that there is a data dependency relationship between target set A and target set B. When generating a query statement, in addition to including the subject corresponding to target index number B, it is also necessary to include the subject corresponding to target index A.

[0083] It should be noted that when there is a data dependency between the objects corresponding to target index number A and target index number B, the objects of target index number A and target index number B can also be included when generating the query statement. The specific implementation is the same as the above method, and will not be elaborated here.

[0084] As can be seen in this example, the electronic device can determine the relationship between the target set (data corresponding to different data sources) by the relationship between index numbers, and then generate a query statement based on the relationship to directly obtain the target data from the document database. This not only decouples the business logic and the data acquisition logic, but also helps to improve the accuracy of data acquisition.

[0085] In an optional example, in step A1 above, determining the association relationship between the multiple target sets based on the ternary combination corresponding to each target index number can include the following steps:

[0086] A11. Based on the ternary combination corresponding to each of the target index numbers, determine the subject and object in each of the ternary combinations;

[0087] A12. If there is the same subject in the ternary combination corresponding to multiple target index numbers, and the objects corresponding to the same subject are different, then determine the association relationship between the objects corresponding to the same subject respectively, and determine the first association relationship between the target sets corresponding to the same subject based on the association relationship between the objects.

[0088] A13. If there is a common object in the ternary combination corresponding to the plurality of target index numbers, and the subjects corresponding to the common object are different, then the association relationship between the subjects corresponding to the common object is determined, and the second association relationship between the common object is determined according to the association relationship between the subjects.

[0089] A14. Based on the first association relationship and the second association relationship, obtain the association relationship between the multiple target sets.

[0090] The aforementioned ternary combination can be used to represent business requirements, specifically to represent the subject and object, as well as the relationship between the subject and object.

[0091] The electronic device can associate the index number with the data content corresponding to the data source. The data content is directly stored in the document database. Therefore, the electronic device can directly obtain multiple target data corresponding to multiple target data sources from the document database according to the task scheduling rules.

[0092] The differences in business needs can be reflected through the combination of three elements; for example, if the subject is the same but the object is different, it indicates that the business needs are different; if the subject is different but the object is the same, it also indicates that the business needs are different; when both the subject and object are the same, the predicate verb can be used as a reference, and if the predicate verb is different, it indicates that the business needs are different.

[0093] In practical implementation, there are several possible scenarios for multiple target index numbers. The following explanation focuses on two scenarios: identical subjects with different objects, and different subjects with identical objects. If multiple target index numbers correspond to multiple tripartite combinations where the same subject exists, but the objects corresponding to the same subject are different (e.g., for the same office supplies, there are different objects such as remaining quantity and sales proceeds), then the association between the objects corresponding to the same subject can be determined. This association indicates that different objects exist in different data sources or the same data source, or that there is a data dependency relationship between the objects. Therefore, it is necessary to combine the association between the objects to determine whether multiple target data needs to be obtained from multiple data sources. Thus, the first association in the target set corresponding to the same subject and different objects can be obtained. This first association can be used to indicate that different data sources exist when the subjects are the same but the objects are different.

[0094] Furthermore, if multiple target index numbers correspond to multiple ternary combinations containing the same object, and the subjects corresponding to the same object are different, for example, regarding the remaining quantity in a warehouse, there are corresponding amounts of office supplies and household supplies remaining; then the association relationship between the different subjects corresponding to the aforementioned same object can be determined. This association relationship is used to indicate that different subjects exist in different data sources or the same data source, or that there is a data dependency relationship between the subjects. In this case, it is necessary to combine the association relationship between the subjects to determine whether it is necessary to obtain multiple target data from multiple data sources. Therefore, a second association relationship can be obtained in the target set corresponding to the same object but different subjects. The second association relationship can be used to indicate that there are different data sources when the objects are the same but the subjects are different.

[0095] Finally, the first and second association relationships can be determined to indicate the character segments corresponding to different objects or subjects when there are different data sources, and the character segments in the above two situations can be combined to generate query statements.

[0096] It should be noted that when the subject and object are the same but the predicate verbs are different, the third association can be determined in the same way as above, and the character segments corresponding to the first, second and third associations can be combined to generate the above query statement.

[0097] As can be seen in this example, by combining business requirements and target index numbers, the relationship between the target sets where the data to be obtained exists can be determined. This allows us to determine whether it is necessary to obtain the target data from multiple target data sources in the document database. This enables the acquisition of data from multiple data sources in the document database without any processing of the data sources. This facilitates subsequent troubleshooting of data sources and on-demand processing of business logic.

[0098] In an optional example, step 204 above, where the target data is output, may include the following steps:

[0099] 41. Display the target data; or,

[0100] 42. Store the target data as hot data in the cache; or,

[0101] 43. Persistently store the target data.

[0102] Among them, electronic devices can output target data to a display screen, or output target data to a cache, or output target data to a persistent storage database.

[0103] As can be seen, this example provides multiple ways to output target data to meet different business needs. For example, target data can be stored in a cache so that when the target data is retrieved again, there is no need to repeat data processing or data retrieval, and it can be directly retrieved from the cache, which is beneficial to improving system performance. Target data can be displayed directly, which is beneficial to intuitively display the data and improve user experience. Target data can also be persistently stored to meet other business logic needs.

[0104] As can be seen, the document-based database-based data processing method described in this application embodiment, in response to a data acquisition command, determines the business logic corresponding to the data acquisition command; determines the target data source and data acquisition rules corresponding to the business logic; acquires target data corresponding to the target data source from the document-based database according to the data acquisition rules, wherein the document-based database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format, and the target data source is any one of the multiple data sources; and outputs the target data. Thus, by establishing a local document-based database to acquire data from different data sources, system overhead can be reduced, and the data from each data source can be stored in its initial data format without any processing of the data source, which is beneficial for subsequent error troubleshooting of the data source and for improving data processing efficiency.

[0105] Consistent with the above embodiments, please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. As shown in the figure, the electronic device includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. The programs include instructions for performing the following steps:

[0106] In response to a data acquisition instruction, determine the business logic corresponding to the data acquisition instruction;

[0107] Determine the target data source and data acquisition rules corresponding to the business logic;

[0108] According to the data acquisition rules, target data corresponding to the target data source is obtained from the document database. The document database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format. The target data source is any one of the multiple data sources.

[0109] Output the target data.

[0110] In an optional example, regarding the determination of the target data source and data acquisition rules corresponding to the business logic, the above procedure includes instructions for performing the following steps:

[0111] Determine the business requirements corresponding to the aforementioned business logic;

[0112] Determine the ternary combination corresponding to the aforementioned business requirements;

[0113] The target index number is determined based on the aforementioned ternary combination;

[0114] Based on the pre-defined mapping relationship between the index numbers of the document-oriented database and the data source, the target data source corresponding to the target index number is determined; and,

[0115] Based on the business requirements, determine the business type corresponding to the target data source;

[0116] If the business type is the first business type, then the data acquisition rule is determined to be an active acquisition method;

[0117] If the business type is the second business type, then the data acquisition rule is determined to be a subscription method.

[0118] In an optional example, regarding the step of retrieving the target data corresponding to the target data source from the document-based database according to the data retrieval rules, the above procedure includes instructions for performing the following steps:

[0119] If the data acquisition rule is the active acquisition method, then according to the pre-set task scheduling rules, the target data corresponding to the target data source is obtained from the document database;

[0120] If the data acquisition rule is the subscription method, then when there is a data update in the target data source, the updated data sent by the target data source is received through the document database as the target data.

[0121] In an optional example, the data from the plurality of data sources are stored in a plurality of collections corresponding to the document database, with each data source corresponding to a collection.

[0122] Before retrieving the target data corresponding to the target data source from the document-based database according to the pre-set task scheduling rules, the above program further includes instructions for performing the following steps:

[0123] If the business logic corresponds to multiple target index numbers, then the association relationship between the multiple target sets is determined according to the combination of the three elements corresponding to each target index number;

[0124] The task scheduling rules are determined based on the relationships between the multiple target sets.

[0125] In an optional example, regarding the determination of the task scheduling rules based on the associations among the plurality of target sets, the above procedure includes instructions for performing the following steps:

[0126] Generate a query statement based on the relationships between the multiple target sets;

[0127] Based on the query statement, determine the scheduling position of the target data corresponding to each target set, and determine the scheduling time and number of scheduling times based on the ternary combination;

[0128] The task scheduling rule is generated based on the scheduling location, the scheduling time, and the number of scheduling attempts.

[0129] In an optional example, regarding the determination of the association between the plurality of target sets based on the ternary combination corresponding to each of the target index numbers, the above procedure includes instructions for performing the following steps:

[0130] Based on the ternary combination corresponding to each target index number, determine the subject and object in each ternary combination;

[0131] If there is the same subject in the ternary combination corresponding to multiple target index numbers, and the objects corresponding to the same subject are different, then the association relationship between the objects corresponding to the same subject is determined, and the first association relationship between the target sets corresponding to the same subject is determined based on the association relationship between the objects.

[0132] If there is a common object among the ternary combinations corresponding to the multiple target index numbers, and the subjects corresponding to the common object are different, then the association relationship between the subjects corresponding to the common object is determined, and a second association relationship between the common object is determined based on the association relationship between the subjects.

[0133] Based on the first association relationship and the second association relationship, the association relationships between the multiple target sets are obtained.

[0134] In an optional example, regarding the output of the target data, the above procedure includes instructions for performing the following steps:

[0135] Display the target data; or,

[0136] The target data is stored in the cache as hot data; or,

[0137] The target data is persistently stored.

[0138] As can be seen, the electronic device described in this application embodiment, in response to a data acquisition instruction, determines the business logic corresponding to the data acquisition instruction; determines the target data source and data acquisition rules corresponding to the business logic; acquires target data corresponding to the target data source from a document-type database according to the data acquisition rules, wherein the document-type database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format, and the target data source is any one of the multiple data sources; and outputs the target data. Thus, by acquiring data from different data sources through a locally established document-type database, system overhead can be reduced, and the data from each data source can be stored in its initial data format without any processing of the data source, which is beneficial for subsequent error troubleshooting of the data source and for improving data processing efficiency.

[0139] Figure 4 This is a functional unit block diagram of a document-based database-based data processing device 400 according to an embodiment of this application. The document-based database-based data processing device 400 includes: a determining unit 401, a data acquiring unit 402, and an output unit 403, wherein...

[0140] The determining unit 401 is used to determine the business logic corresponding to the data acquisition instruction in response to the data acquisition instruction.

[0141] The determining unit 401 is further configured to determine the target data source and data acquisition rules corresponding to the business logic;

[0142] The data acquisition unit 402 is used to acquire target data corresponding to the target data source from the document database according to the data acquisition rules, wherein the document database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format, and the target data source is any one of the multiple data sources;

[0143] The output unit 403 is used to output the target data.

[0144] In an optional example, regarding determining the target data source and data acquisition rules corresponding to the business logic, the determining unit 401 is specifically used for:

[0145] Determine the business requirements corresponding to the aforementioned business logic;

[0146] Determine the ternary combination corresponding to the aforementioned business requirements;

[0147] The target index number is determined based on the aforementioned ternary combination;

[0148] Based on the pre-defined mapping relationship between the index numbers of the document-oriented database and the data source, the target data source corresponding to the target index number is determined; and,

[0149] Based on the business requirements, determine the business type corresponding to the target data source;

[0150] If the business type is the first business type, then the data acquisition rule is determined to be an active acquisition method;

[0151] If the business type is the second business type, then the data acquisition rule is determined to be a subscription method.

[0152] In an optional example, regarding the step of retrieving the target data corresponding to the target data source from the document-based database according to the data retrieval rules, the data retrieval unit 402 is specifically used for:

[0153] If the data acquisition rule is the active acquisition method, then according to the pre-set task scheduling rules, the target data corresponding to the target data source is obtained from the document database;

[0154] If the data acquisition rule is the subscription method, then when there is a data update in the target data source, the updated data sent by the target data source is received through the document database as the target data.

[0155] In an optional example, the data from the plurality of data sources are stored in a plurality of collections corresponding to the document database, with each data source corresponding to a collection.

[0156] Before retrieving the target data corresponding to the target data source from the document-type database according to the pre-set task scheduling rules, the determining unit 401 is further configured to:

[0157] If the business logic corresponds to multiple target index numbers, then the association relationship between the multiple target sets is determined according to the combination of the three elements corresponding to each target index number;

[0158] The task scheduling rules are determined based on the relationships between the multiple target sets.

[0159] In an optional example, regarding the determination of the task scheduling rules based on the association relationships among the plurality of target sets, the determining unit 401 is specifically used for:

[0160] Generate a query statement based on the relationships between the multiple target sets;

[0161] Based on the query statement, determine the scheduling position of the target data corresponding to each target set, and determine the scheduling time and number of scheduling times based on the ternary combination;

[0162] The task scheduling rule is generated based on the scheduling location, the scheduling time, and the number of scheduling attempts.

[0163] In an optional example, in determining the association between the plurality of target sets based on the ternary combination corresponding to each of the target index numbers, the determining unit 401 is specifically used for:

[0164] Based on the ternary combination corresponding to each target index number, determine the subject and object in each ternary combination;

[0165] If there is the same subject in the ternary combination corresponding to multiple target index numbers, and the objects corresponding to the same subject are different, then the association relationship between the objects corresponding to the same subject is determined, and the first association relationship between the target sets corresponding to the same subject is determined based on the association relationship between the objects.

[0166] If there is a common object among the ternary combinations corresponding to the multiple target index numbers, and the subjects corresponding to the common object are different, then the association relationship between the subjects corresponding to the common object is determined, and a second association relationship between the common object is determined based on the association relationship between the subjects.

[0167] Based on the first association relationship and the second association relationship, the association relationships between the multiple target sets are obtained.

[0168] In an optional example, regarding the output of the target data, the output unit 403 is specifically used for:

[0169] Display the target data; or,

[0170] The target data is stored in the cache as hot data; or,

[0171] The target data is persistently stored.

[0172] As can be seen, the document-based database-based data processing apparatus described in this application embodiment, in response to a data acquisition instruction, determines the business logic corresponding to the data acquisition instruction; determines the target data source and data acquisition rules corresponding to the business logic; acquires target data corresponding to the target data source from the document-based database according to the data acquisition rules, wherein the document-based database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format, and the target data source is any one of the multiple data sources; and outputs the target data. Thus, by establishing a local document-based database to acquire data from different data sources, system overhead can be reduced, and the data from each data source can be stored in its initial data format without any processing of the data source, which is beneficial for subsequent error troubleshooting of the data source and for improving data processing efficiency.

[0173] It is understood that the functions of each program module of the document-based database data processing device in this embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, and will not be repeated here.

[0174] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.

[0175] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.

[0176] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0177] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0178] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0179] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0180] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0181] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer electronic device (which may be a personal computer, electronic device, or network electronic device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0182] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0183] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data processing method based on a document-oriented database, characterized in that, include: In response to a data acquisition instruction, determine the business logic corresponding to the data acquisition instruction; Determine the target data source and data acquisition rules corresponding to the business logic; According to the data acquisition rules, target data corresponding to the target data source is obtained from the document database. The document database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format. The target data source is any one of the multiple data sources. Output the target data; The data from the multiple data sources are stored in multiple sets corresponding to the document-type database, with each data source corresponding to one set. The step of retrieving the target data corresponding to the target data source from the document-type database according to the data retrieval rules includes: if the data retrieval rule is an active retrieval method, and if the business logic corresponds to multiple target index numbers, then based on the ternary combination corresponding to each target index number, determining the association relationship between the multiple target sets. The association relationship includes a first association relationship and a second association relationship. The first association relationship indicates that different data sources exist when the subjects are the same but the objects are different, and the second association relationship indicates that different data sources exist when the objects are the same but the subjects are different. A task scheduling rule is determined based on the association relationship between the multiple target sets. The target data corresponding to the target data source is retrieved from the document-type database according to the task scheduling rule. The step of determining the task scheduling rules based on the association between the multiple target sets includes: generating a query statement based on the association between the multiple target sets; determining the scheduling position of the target data corresponding to each target set based on the query statement, and determining the scheduling time and number of scheduling based on the ternary combination; and generating the task scheduling rules based on the scheduling position, the scheduling time, and the number of scheduling.

2. The method according to claim 1, characterized in that, The step of determining the target data source and data acquisition rules corresponding to the business logic includes: Determine the business requirements corresponding to the business logic; Determine the ternary combination corresponding to the aforementioned business requirements; The target index number is determined based on the aforementioned ternary combination; Based on the pre-defined mapping relationship between the index numbers of the document-oriented database and the data source, the target data source corresponding to the target index number is determined; and, Based on the business requirements, determine the business type corresponding to the target data source; If the business type is the first business type, then the data acquisition rule is determined to be an active acquisition method; If the business type is the second business type, then the data acquisition rule is determined to be a subscription method.

3. The method according to claim 2, characterized in that, The step of retrieving the target data corresponding to the target data source from the document-based database according to the data retrieval rules includes: If the data acquisition rule is the subscription method, then when there is a data update in the target data source, the updated data sent by the target data source is received through the document database as the target data.

4. The method according to claim 1, characterized in that, The step of determining the association relationship between the multiple target sets based on the ternary combination corresponding to each target index number includes: Based on the ternary combination corresponding to each target index number, determine the subject and object in each ternary combination; If there is the same subject in the ternary combination corresponding to multiple target index numbers, and the objects corresponding to the same subject are different, then the association relationship between the objects corresponding to the same subject is determined, and the first association relationship between the target sets corresponding to the same subject is determined based on the association relationship between the objects. If there is a common object among the ternary combinations corresponding to the multiple target index numbers, and the subjects corresponding to the common object are different, then the association relationship between the subjects corresponding to the common object is determined, and a second association relationship between the common object is determined based on the association relationship between the subjects. Based on the first association relationship and the second association relationship, the association relationships between the multiple target sets are obtained.

5. The method according to claim 1 or 4, characterized in that, The output of the target data includes: Display the target data; or, The target data is stored in the cache as hot data; or, The target data is persistently stored.

6. A data processing device based on a document-oriented database, characterized in that, The device includes: a determining unit, a data acquiring unit, and an output unit, wherein, The determining unit is used to determine the business logic corresponding to the data acquisition instruction in response to the data acquisition instruction; The determining unit is further configured to determine the target data source and data acquisition rules corresponding to the business logic; The data acquisition unit is used to acquire target data corresponding to the target data source from the document database according to the data acquisition rules, wherein the document database stores data from multiple data sources, and the data from each data source is stored according to the initial data source format, and the target data source is any one of the multiple data sources; The output unit is used to output the target data; The data from the multiple data sources are stored in multiple sets corresponding to the document-type database, with each data source corresponding to one set. The step of retrieving the target data corresponding to the target data source from the document-type database according to the data retrieval rules includes: if the data retrieval rule is an active retrieval method, and if the business logic corresponds to multiple target index numbers, then based on the ternary combination corresponding to each target index number, determining the association relationship between the multiple target sets. The association relationship includes a first association relationship and a second association relationship. The first association relationship indicates that different data sources exist when the subjects are the same but the objects are different, and the second association relationship indicates that different data sources exist when the objects are the same but the subjects are different. A task scheduling rule is determined based on the association relationship between the multiple target sets. The target data corresponding to the target data source is retrieved from the document-type database according to the task scheduling rule. The step of determining the task scheduling rules based on the association between the multiple target sets includes: generating a query statement based on the association between the multiple target sets; determining the scheduling position of the target data corresponding to each target set based on the query statement, and determining the scheduling time and number of scheduling based on the ternary combination; and generating the task scheduling rules based on the scheduling position, the scheduling time, and the number of scheduling.

7. An electronic device, characterized in that, It includes a processor and a memory, the memory being used to store one or more programs and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, A computer program for storing electronic data interchange is provided, wherein the computer program causes a computer to perform the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data retrieval system and device, electronic equipment and readable storage medium

    CN113779349A

  • Data processing method and device and electronic equipment

    CN116303512A