Method and apparatus for generating information
By storing and managing multiple data flows and their associated identifiers in the database, the problem of poor stability when generating information from multiple data flows is solved, and the integrity of the information flow and system robustness are improved.
Patent Information
- Application Number
- CN202011262378.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-11-12
AI Technical Summary
The prior art has a problem of poor stability when generating result information using multiple data streams.
By acquiring at least two data streams and their association identifiers, the data stream is stored in the database, and when there is no data of the corresponding current time corresponding to the association identifier in the data stream, the data of the corresponding current time corresponding to the association identifier is obtained from the database and generates Information about the current moment.
Ensure that when the data at the current moment does not appear in the data stream in real time, the data can be extracted from the database after obtaining and storing the data, thereby generating a complete and stable information flow, which improves the robustness of the system and the information flow. Integrity.
Smart Images

Figure CN113760979B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for generating information. Background Art
[0002] Using data from multiple data streams to generate result information can enable users to obtain result information streams from multiple data streams. The current method of using data from multiple data streams to generate result information is to generate result information based on multiple data extracted from multiple data streams in real time.
[0003] However, current methods for generating result information suffer from poor stability. Summary of the invention
[0004] The present disclosure provides a method, an apparatus, an electronic device, and a computer-readable storage medium for generating information.
[0005] According to a first aspect of the present disclosure, a method for generating information is provided, comprising: obtaining at least two data streams and an association identifier for associating the at least two data streams, and storing the at least two data streams in a database; for each of the at least two data streams, in response to determining that the data stream does not contain data at the current moment corresponding to the association identifier, after obtaining and storing the data at the current moment corresponding to the association identifier, obtaining the data at the current moment corresponding to the association identifier from the database; and generating information at the current moment using the data at the current moment corresponding to the association identifier in each data stream.
[0006] In some embodiments, the method for generating information includes: for each of at least two data streams, in response to determining that data at the current moment corresponding to the association identifier exists in the data stream, obtaining data at the current moment corresponding to the association identifier from the data stream.
[0007] In some embodiments, storing at least two data streams in a database includes: storing at least two data streams in the database at a preset frequency.
[0008] In some embodiments, storing at least two data streams in a database includes: using an association identifier as a key in a storage key-value pair, using data in the data stream corresponding to the association identifier as a value in the storage key-value pair, and storing the data stream in the database.
[0009] In some embodiments, the data stream includes real-time order data of the item, and the information at the current moment includes real-time status information of the item.
[0010] According to a second aspect of the present disclosure, there is provided a device for generating information, comprising: a storage unit, configured to obtain at least two data streams and an association identifier for associating the at least two data streams, and store the at least two data streams in a database; a first extraction unit, configured to, for each of the at least two data streams, in response to determining that the data stream does not contain data at the current moment corresponding to the association identifier, after obtaining and storing the data at the current moment corresponding to the association identifier, obtain the data at the current moment corresponding to the association identifier from the database; and a generation unit, configured to generate information at the current moment using the data at the current moment corresponding to the association identifier in each data stream.
[0011] In some embodiments, the device for generating information includes: a second extraction unit, configured to obtain data at the current moment corresponding to the association identifier from each of at least two data streams in response to determining that data at the current moment corresponding to the association identifier exists in the data stream.
[0012] In some embodiments, the storage unit includes: a storage module configured to store at least two data streams into a database at a preset frequency.
[0013] In some embodiments, the storage module includes: a storage submodule configured to use the association identifier as the key in the storage key-value pair and the data corresponding to the association identifier in the data stream as the value in the storage key-value pair to store the data stream in the database.
[0014] In some embodiments, the data stream includes real-time order data of the item, and the information at the current moment includes real-time status information of the item.
[0015] According to the third aspect of the present disclosure, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method for generating information as provided in the first aspect.
[0016] According to a fourth aspect of the present disclosure, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for generating information provided in the first aspect is implemented.
[0017] The method and device for generating information provided by the present disclosure obtain at least two data streams and an association identifier for associating the at least two data streams, and store the at least two data streams in a database. For each of the at least two data streams, in response to determining that the data stream does not have the data at the current moment corresponding to the association identifier, after obtaining and storing the data at the current moment, the data at the current moment is obtained from the database, and then the data at the current moment corresponding to the association identifier in each data stream is used to generate the information at the current moment. When the data at the current moment does not appear in the data stream in real time, after obtaining and storing the data at the current moment in the database, the data at the current moment can be obtained from the database, and the information at the current moment is generated based on the data at the current moment in multiple data streams, so as to ensure the integrity and stability of the information stream generated based on the multiple data streams.
[0018] The technology according to the present application solves the problem of poor stability of generating result information using multiple data obtained in real time from multiple data streams.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
[0021] Figure 1 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
[0022] Figure 2 is a flow chart of an embodiment of a method for generating information according to the present application;
[0023] Figure 3 is a structural schematic diagram of an embodiment of a device for generating information according to the present application;
[0024] Figure 4 It is a block diagram of an electronic device used to implement the method for generating information in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0026] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the method for generating information or the apparatus for generating information of the present application can be applied.
[0027] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0028] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, financial applications, computing applications, image applications, video applications, etc.
[0029] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting receiving server messages, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.
[0030] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, multiple software modules for providing distributed services), or they can be implemented as a single software or software module. No specific limitation is made here.
[0031] The server 105 can obtain the multiple data streams collected by the terminal devices 101, 102, and 103, and the association identifiers used to associate the multiple data streams through the network 104, and store the obtained multiple data streams in a persistent storage database. The server 105 can obtain the data at the current moment corresponding to the association identifier from each data stream in the multiple data streams. When it is determined that the data at the current moment corresponding to the association identifier does not exist in the data stream, after obtaining the data at the current moment in the data stream and storing the data at the current moment in the persistent storage database, the server 105 extracts the data at the current moment in the data stream from the persistent storage database, and then the server 105 can use the data at the current moment corresponding to the association identifier in each data stream to generate information at the current moment.
[0032] It should be noted that the method for generating information provided in the embodiments of the present disclosure is generally executed by the server 105 , and accordingly, the device for generating information is generally disposed in the server 105 .
[0033] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0034] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for generating information according to the present disclosure, comprising the following steps:
[0035] Step 201: obtain at least two data streams and an association identifier for associating the at least two data streams, and store the at least two data streams in a database.
[0036] In this embodiment, the execution subject of the method for generating information (eg Figure 1 The server 105 shown can obtain multiple data streams and association identifiers for associating the multiple data streams in a wired or wireless manner, and store the obtained multiple data streams in a persistent storage database.
[0037] In this embodiment, the association identifier of the multiple data streams may be an association identifier collected by the terminal and sent to the server, or input by the user based on the multiple data streams or user needs. For example, one of the multiple data streams may be a real-time purchase item data stream of an e-commerce platform, and another may be a real-time payment data stream of the e-commerce platform. The order number may be used as the association identifier of the order data stream and the payment data stream. At this time, the item data stream may be associated with the payment data stream through the order number, so that the e-commerce backend knows which items are paid items.
[0038] For another example, one of the multiple data streams may be a real-time foreign exchange rate data stream of multiple currencies, and the other may be a real-time RMB price data stream of a certain item. The RMB currency identifier may be used as an association identifier for the real-time foreign exchange rate data stream and the real-time RMB price data stream of the certain item. At this time, the real-time RMB price of a certain item may be associated with the RMB-foreign currency exchange rate data through the RMB currency identifier, so that the server may generate real-time foreign currency price information of a certain item.
[0039] In this embodiment, the persistent storage database refers to a database that can store data persistently, where persistence means remaining unchanged for a certain period of time, that is, persistence is relative to time. The persistent storage database is usually a storage device that stores data for a long time, such as a disk, cloud storage space, etc., as opposed to a memory that stores data instantaneously.
[0040] Step 202, for each of the at least two data streams, in response to determining that there is no data at the current moment corresponding to the association identifier in the data stream, after obtaining and storing the data at the current moment corresponding to the association identifier, obtain the data at the current moment corresponding to the association identifier from the database.
[0041] In this embodiment, for each data stream in the multiple data streams, when it is determined that there is no data at the current moment corresponding to the association identifier in the data stream, that is, when the data generated at the time node at the current moment corresponding to the association identifier does not appear in the real-time data stream due to network delay or system jitter, after the network / system returns to normal and the server receives and stores the data generated at the time node at the current moment, the data generated at the time node at the current moment is extracted from the server. It should be noted that the current moment can be any moment when the real-time data stream is acquired.
[0042] Step 203, using the data at the current moment corresponding to the association identifier in each data stream to generate information at the current moment.
[0043] In this embodiment, the data of the current moment corresponding to the association identifier obtained from the multiple data streams can be used to generate the information of the current moment. It can be understood that the information generated at each moment can form an information stream generated based on the multiple data streams.
[0044] The method for generating information provided by the present disclosure obtains at least two data streams and an association identifier for associating the at least two data streams, and stores the at least two data streams in a database. For each of the at least two data streams, in response to determining that the data at the current moment corresponding to the association identifier does not exist in the data stream, after obtaining and storing the data at the current moment, the data at the current moment is obtained from the database, and then the data at the current moment corresponding to the association identifier in each data stream is used to generate the information at the current moment. When the data at the current moment does not appear in the data stream in real time, after obtaining and storing the data at the current moment in the database, the data at the current moment is obtained from the database, and the information at the current moment is generated based on the data at the current moment. This can avoid the problem of missing information at the current moment in the information stream due to failure to obtain the data at the current moment in real time, so that the memory cannot generate the information at the current moment based on the data at the current moment, thereby ensuring the integrity and stability of the information stream generated based on multiple data streams, and improving the robustness of the system.
[0045] Optionally, the method for generating information further includes: for each of the at least two data streams, in response to determining that data at the current moment corresponding to the association identifier exists in the data stream, obtaining data at the current moment corresponding to the association identifier from the data stream.
[0046] In this embodiment, for each data stream in multiple data streams, when it is determined that there is data at the current moment corresponding to the association identifier in the data stream, that is, the current network and system status are good and the real-time data transmission in the data stream is normal, the data corresponding to the time node at the current moment corresponding to the association identifier is obtained from the data stream.
[0047] In this embodiment, when it is determined that the data stream read in real time from the server memory contains data at the current moment corresponding to the association identifier, directly obtaining the data at the current moment from the memory can improve the efficiency of obtaining data and thus improve the processing efficiency of the system.
[0048] Optionally, storing the at least two data streams into a database includes: storing the at least two data streams into the database at a preset frequency.
[0049] In this embodiment, for each of the multiple data streams, the data stream read in real time by the server memory can be temporarily stored in the server memory, and the data stream temporarily stored in the server memory during the time interval can be stored in the database of persistent storage at every preset time interval (for example, every two seconds). Optionally, the data in the data stream read during the time interval can be deduplicated, and only the latest data is retained, and the latest data is stored as the data of the data stream during the time interval in the database of persistent storage.
[0050] This embodiment stores the data stream read from the server memory into a persistent storage database at a preset frequency, which can reduce the read and write operations between the memory and the database, extend the service life of the memory and the database, and save device resources.
[0051] Optionally, when storing the data stream in the database, the table name, association identifier, storage unit field name and other information of the data stream storage may be updated in the configuration file to facilitate the management and maintenance of the stored data stream.
[0052] Optionally, storing at least two data streams into a database includes: using an association identifier as a key in a storage key-value pair, using data in the data stream corresponding to the association identifier as a value in the storage key-value pair, and storing the data stream into the database.
[0053] In this embodiment, the data stream can be stored in the database by a data storage method of key-value pair storage, and the association identifier is used as the key in the storage key-value pair, and the data corresponding to the association identifier is used as the value in the storage key-value pair. In this embodiment, the data stream is stored in the database by a key-value pair storage method, and the association identifier is used as the key of the storage key-value pair, and the data corresponding to the association identifier is used as the value of the storage key-value pair. When extracting the data at the current moment corresponding to the association identifier from the database, the efficiency of extracting data can be improved.
[0054] In the above combination Figure 2 In some optional implementations of the described embodiments, the data stream includes real-time order data of the items, and the information at the current moment includes real-time status information of the items.
[0055] In this embodiment, the item may be a physical item such as goods, or a virtual item such as power, storage space, amount of stored data, etc. The multiple data streams may be real-time order data of the item, and the current moment information generated by using the current moment data in the multiple data streams may be real-time status information of the item.
[0056] For example, one of the multiple data streams may be the real-time order shipment quantity of the item, and another of the multiple data streams may be the real-time incoming quantity of the item, and the real-time storage quantity information of the item may be generated based on the two data streams. It is understandable that in this example, an item identifier such as an item number / item name may be used as an associated identifier.
[0057] For another example, one of the multiple data streams may include the device identification and the current time-consuming data of the operation being performed by the device corresponding to the device identification (e.g., the server device is performing data storage operation, data calculation operation, etc.), and the other of the multiple data streams may be the current completion progress of the operation being performed by the device corresponding to the device identification (e.g., data storage volume, data calculation volume, etc.), and the current work efficiency information of each running device may be generated based on the two data streams. It can be understood that the device identification can be used as the association identification in this example.
[0058] In some application scenarios, the server can obtain two data streams Stream1 and Stream2 in real time, and store the two data streams in a persistent storage database.
[0059] The data of data stream Stream1 at the current moment is Map1<key,data> , the data of data stream Stream2 at the current moment is Map2<key,data> , where key is the association identifier, which is also the key in the key-value pair in the persistent storage database, and data is the data corresponding to the association identifier, which is also the value in the key-value pair in the persistent storage database. Data Map1 is associated with data Map2 through key to obtain the associated information JoinedStream1<key,data> 、JoinedStream2<key,data> ; Get the data that exists in Map1 but not in Map2, UnJoinStream1<key,data> ; and get the data that exists in Map2 but not in Map1, UnJoinStream2<key,data> .
[0060] After that, when the network failure / blockage is resolved or the system is restored to stability and the data at the current time corresponding to the association identifier is received and stored, the server extracts the data at the current time from the persistent storage database: loads the data that is not associated with data stream Stream2 from the persistent storage database, that is, according to the key value in UnJoinStream1, traverses the persistent storage database to obtain data DataLoadStream2<key,data> ; Load the data that is not associated with data stream Stream1 from the persistent storage database, that is, based on the key value in UnJoinStream2, traverse the persistent storage database to obtain data DataLoadStream1<key,data> .
[0061] After that, the server performs a data merge operation: it merges the associated data JoinedStream1 with the data DataLoadStream1 in the data stream Stream1 loaded from the persistent storage to obtain the data set ToBeCalculatedMap1 that needs to be calculated.<key,data> . Merge the associated data JoinedStream2 with the data DataLoadStream2 in the data stream Stream2 loaded from the persistent storage database to obtain the data set ToBeCalculatedMap2 that needs to be sent to the memory for processing<key,data> .
[0062] Then, the merged data is loaded into the server memory for calculation / processing to generate the result information at the current moment. And, the result information at the current moment is sent to the result stream. The result information at each moment constitutes a complete result information stream. When this method is used to perform correlation calculations on multiple data streams, when a delay or jitter occurs in one of the data streams, the problem of missing data in the result information stream due to data not being sent down due to data not being associated can be solved by introducing a persistent storage database to automatically load the unassociated data. In addition, the robustness, stability, and fault tolerance of real-time correlation calculations of multiple data streams can be improved, and the automation and intelligence of real-time calculations of multiple data streams can be realized.
[0063] Further references Figure 3 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for generating information, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0064] like Figure 3 As shown, the apparatus 300 for generating information in this embodiment includes: a storage unit 301, a first extraction unit 302, and a generation unit 303. The storage unit 301 is configured to obtain at least two data streams and an association identifier for associating at least two data streams, and store the at least two data streams in a database; the first extraction unit 302 is configured to, for each of the at least two data streams, in response to determining that the data stream does not contain data at the current moment corresponding to the association identifier, after obtaining and storing the data at the current moment corresponding to the association identifier, obtain the data at the current moment corresponding to the association identifier from the database; the generation unit 303 is configured to use the data at the current moment corresponding to the association identifier in each data stream to generate information at the current moment.
[0065] In some embodiments, the device for generating information includes: a second extraction unit, configured to obtain data at the current moment corresponding to the association identifier from each of at least two data streams in response to determining that data at the current moment corresponding to the association identifier exists in the data stream.
[0066] In some embodiments, the storage unit includes: a storage module configured to store at least two data streams into a database at a preset frequency.
[0067] In some embodiments, the storage module includes: a storage submodule configured to use the association identifier as the key in the storage key-value pair and the data corresponding to the association identifier in the data stream as the value in the storage key-value pair to store the data stream in the database.
[0068] In some embodiments, the data stream includes real-time order data of the item, and the information at the current moment includes real-time status information of the item.
[0069] Each unit in the above device 300 is similar to the reference Figure 2 Therefore, the operations, features and technical effects described above for the method for generating information are also applicable to the device 300 and the units contained therein, and will not be described in detail here.
[0070] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0071] like Figure 4 , is a block diagram of an electronic device 400 for generating information according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0072] like Figure 4As shown, the electronic device includes: one or more processors 401, a memory 402, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to an interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 401 is taken as an example.
[0073] The memory 402 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the method for generating information provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the method for generating information provided in the present application.
[0074] The memory 402 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the method for generating information in the embodiment of the present application (for example, the attached Figure 3 The processor 401 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 402, that is, implements the method for generating information in the above method embodiment.
[0075] The memory 402 may 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; the data storage area may store data created according to the use of the electronic device for generating information, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the electronic device for generating information via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0076] The electronic device for the method of generating information may further include: an input device 403, an output device 404, and a bus 405. The processor 401, the memory 402, the input device 403, and the output device 404 may be connected via the bus 405 or in other ways. Figure 4 The connection via bus 405 is taken as an example.
[0077] The input device 403 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device used to generate information, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, and other input devices. The output device 404 may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0078] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0079] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0080] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0081] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0082] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0083] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0084] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for generating information, comprising: Acquire at least two data streams and an association identifier for associating the at least two data streams, and store the at least two data streams in a database; For each of the at least two data streams, in response to determining that the data stream does not contain the data at the current moment corresponding to the association identifier, after obtaining and storing the data at the current moment corresponding to the association identifier, obtaining the data at the current moment corresponding to the association identifier from the database; The data at the current moment corresponding to the association identifier in each data stream is used to generate the information at the current moment.
2. The method according to claim 1, wherein: The method comprises: For each of the at least two data streams, in response to determining that the data at the current moment corresponding to the association identifier exists in the data stream, the data at the current moment corresponding to the association identifier is obtained from the data stream.
3. The method according to claim 1, wherein: The storing the at least two data streams into a database comprises: The at least two data streams are stored in the database at a preset frequency.
4. The method according to claim 1, wherein: The storing the at least two data streams into a database comprises: The data stream is stored in the database using the association identifier as the key in a storage key-value pair and the data in the data stream corresponding to the association identifier as the value in the storage key-value pair.
5. The method according to any one of claims 1 to 4, wherein: The data stream includes real-time order data of items, and the information at the current moment includes real-time status information of the items.
6. A device for generating information, comprising: A storage unit, configured to obtain at least two data streams and an association identifier for associating the at least two data streams, and store the at least two data streams in a database; A first extraction unit is configured to, for each of the at least two data streams, in response to determining that the data stream does not contain the data at the current moment corresponding to the association identifier, after obtaining and storing the data at the current moment corresponding to the association identifier, obtain the data at the current moment corresponding to the association identifier from the database; The generating unit is configured to generate the information of the current moment by using the data of the current moment corresponding to the association identifier in each data stream.
7. The device according to claim 6, wherein: The device comprises: The second extraction unit is configured to obtain the data at the current moment corresponding to the association identifier from each of the at least two data streams in response to determining that the data at the current moment corresponding to the association identifier exists in the data stream.
8. The device according to claim 6, wherein: The storage unit comprises: The storage module is configured to store the at least two data streams into the database at a preset frequency.
9. The device according to claim 8, wherein: The storage module comprises: The storage submodule is configured to use the association identifier as the key in a storage key-value pair and the data in the data stream corresponding to the association identifier as the value in the storage key-value pair, and store the data stream in the database.
10. The device according to any one of claims 6 to 9, wherein: The data stream includes real-time order data of items, and the information at the current moment includes real-time status information of the items.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Integrating kafka data-in-motion with data-at-rest tables
US20200125572A1
Data stream processing apparatus
WO2014186934A1