Data packaging method, and device and storage medium

By receiving data requests in the data packaging method, determining the target data source and business microservice topology, and calling the packaging service in turn, the problem of coupling code and operation environment of different business microservices is solved, and a stable data packaging service is realized.

WO2025048719A1PCT designated stage expired Publication Date: 2025-03-06LEMON INC(GB)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/SG2024/050547
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-28
Filing Date
2024-08-26
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

The problem of packaging code coupling and running-time environment coupling of different business microservices leads to the inability to implement data packaging services stably.

Method used

By receiving data requests sent by the data requester, multiple target data sources are determined and the topological structure between target service microservices is obtained. According to the topology structure, the packaging services corresponding to the target service microservices are called in turn, the target data is obtained from the target service microservices, and the target data is packaged into the target data structure. Packaging services for different target business microservices are isolated from each other.

Benefits of technology

Different service microservices provide unified access points for data requesters, and data requesters can obtain the required data without connecting with different service microservices. Through their own independent packaging services, the coupling problem between the code and the running environment is solved and the service stability is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SG2024050547_06032025_PF_FP_ABST
    Figure SG2024050547_06032025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present invention provide a data packaging method, a device, and a storage medium. The method comprises: receiving a data request sent by a data requesting party, and determining a plurality of target data sources on the basis of the data request; individually determining target service micro-services to which the plurality of target data sources belong, and obtaining a topological structure connecting the target service micro-services; on the basis of the topological structure, sequentially calling packaging services corresponding to the target service micro-services to obtain target data from the target services micro-services, and packaging the target data into a target data structure, wherein packaging services corresponding to different target service micro-services are separated from each other; and sending the target data structure to the data requesting party.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Data Packaging Method, Device, and Storage Medium This application claims priority to Chinese Patent Application No. 202311093746.7, filed on August 28, 2023. The disclosure of the aforementioned Chinese patent application is hereby incorporated by reference in its entirety as a part of this application. Technical Field: The disclosed embodiments relate to the field of computer and network communication technologies, and more particularly, to a data packaging method, device, and storage medium. Background: In some cases, packaging logic for different data sources is typically written and stored in a code repository. Upon data request, the packaging logic for the requested data source is executed and returned to the upstream data requester. However, the coupling of packaging code and runtime environments between different business microservices makes it impossible to stably implement data packaging services. Summary: The disclosed embodiments provide a data packaging method, device, and storage medium. An embodiment of the present disclosure provides a data packaging method, comprising: receiving a data request sent by a data requester, determining multiple target data sources based on the data request; respectively determining target business microservices to which the multiple target data sources belong, and obtaining a topology structure between the target business microservices; sequentially calling packaging services corresponding to the target business microservices based on the topology structure to obtain target data from the target business microservices, and packaging the target data into a target data structure; wherein the packaging services corresponding to different target business microservices are isolated from each other; and sending the target data structure to the data requester. An embodiment of the present disclosure provides a data packaging device, comprising: a receiving unit for receiving a data request sent by a data requester; a parsing unit for determining multiple target data sources based on the data request; determining target business microservices to which the multiple target data sources belong, and obtaining a topology structure between the target business microservices; a scheduling unit for sequentially invoking packaging services corresponding to the target business microservices based on the topology structure to obtain target data from the target business microservices and package the target data into a target data structure; wherein the packaging services corresponding to different target business microservices are isolated from each other; and a sending unit for sending the target data structure to the data requester. An embodiment of the present disclosure provides an electronic device, comprising: at least one processor and a memory; the memory storing computer-executable instructions; the at least one processor executing the computer-executable instructions stored in the memory, causing the at least one processor to perform the data packaging method described above. An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by the processor, implements the data packaging method described above.An embodiment of the present disclosure provides a computer program product comprising computer-executable instructions. When a processor executes the computer-executable instructions, the data packaging method described above is implemented. To more clearly illustrate the technical solutions in the embodiments of the present disclosure, the following briefly introduces the figures required for describing the embodiments. Obviously, the figures described below represent some embodiments of the present disclosure. A person skilled in the art can also derive other figures based on these figures without inventive effort. Figure 1 is an example diagram of a device framework for a data packaging method according to an embodiment of the present disclosure; Figure 2 is a flow chart of a data packaging method according to an embodiment of the present disclosure; Figure 3 is a schematic diagram of constructing a topology structure between target business microservices according to an embodiment of the present disclosure; Figure 4 is a schematic diagram of a target data structure according to an embodiment of the present disclosure; Figure 5 is a schematic diagram of a packaging service execution state change according to an embodiment of the present disclosure; Figure 6 is a schematic diagram of data format conversion according to an embodiment of the present disclosure; Figure 7 is a block diagram of a data packaging device according to an embodiment of the present disclosure; and Figure 8 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure. To further clarify the objectives, technical solutions, and advantages of the embodiments of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described below in detail and in full, with reference to the accompanying drawings. It should be understood that the described embodiments represent only a portion of the embodiments of the present disclosure, and are not exhaustive. All other embodiments devised by persons of ordinary skill in the art based on the embodiments of the present disclosure without inventive effort are within the scope of protection of the present disclosure. In some cases, packaging logic for different data sources is typically written and stored in a code repository. The packaging logic for the requested data source is then executed upon data request and returned to the upstream data requester. However, the coupling of packaging code and runtime environments between different business microservices makes it difficult to implement stable data packaging services. However, since the packaging logic of different data sources is stored in the same code repository, at the code implementation level, the data source packaging logic code is coupled, and all packaging logic uses a common code repository. This creates the possibility of accidental modification, misuse, or deletion of code, resulting in inaccurate data packaging. At the service operation level, the data source packaging logic is not deployed and isolated, and the runtime environments of the packaging logic related to the data of different business microservices are coupled. If the packaging logic related to any business microservice crashes at runtime, the packaging of related businesses will fail.To address the above technical issues, the present disclosure provides a data packaging method. The method receives a data request from a data requester and determines multiple target data sources based on the data request. The method also determines the target business microservices to which the multiple target data sources belong, and obtains the topology between the target business microservices. Based on the topology, the method sequentially calls the packaging services corresponding to the target business microservices, obtains target data from the target business microservices through the packaging services corresponding to the target business microservices, and packages the target data into a target data structure. The packaging services corresponding to different target business microservices are isolated from each other. The method then sends the target data structure to the data requester. This method provides a unified access point for data requests from different business microservices, allowing the data requester to obtain the required data without having to connect to different business microservices. Furthermore, the packaging services corresponding to different business microservices independently execute packaging logic, allowing each packaging service to be independently developed and operated, achieving code and runtime isolation. This resolves the issues of packaged code coupling and runtime environment coupling between different business microservices, and improves service stability. The data packaging method provided herein is applicable to electronic devices such as servers. As shown in FIG1 , the device may include a base service module and packaging service modules corresponding to different business microservices. The packaging service modules corresponding to different business microservices are isolated from each other. The device may also include a management service module and a format conversion service module. Optionally, the base service module, the packaging service modules corresponding to different business microservices, the management service module, and the format conversion service module may be implemented using a microservices architecture. The base service module can receive a data request from a data requester, determine multiple target data sources based on the data request, determine the target business microservices to which the multiple target data sources belong, and obtain the topology between the target business microservices. Based on the topology, the module sequentially invokes the packaging services corresponding to the target business microservices. The packaging services then obtain target data from the target business microservices and package the target data into a target data structure. Furthermore, the format conversion service module can convert the target data structure into a preset data format and then send the converted target data structure to the data requester. The management service module can configure and manage the configuration information of candidate business microservices and / or candidate data sources, specifically including operations such as adding, deleting, and modifying data. The management service module can include a management submodule and a database. The management submodule can be used to configure and manage the configuration information of candidate business microservices and candidate data sources, while the database can be used to store the configuration information of candidate business microservices and candidate data sources. The base service module can specifically include a verification service submodule, a parsing service submodule, and a scheduling service submodule.The verification service submodule can be used to perform parameter verification on a data request after receiving it from a data requester. The parsing service submodule can be used to determine the target business microservices to which multiple target data sources belong and obtain the topological structure between the target business microservices. In one optional embodiment, a preset data source dependency tree can be constructed based on the configuration information of the candidate data sources. The dependency relationships between the multiple target data sources can be obtained based on the preset data source dependency tree. The dependency relationships between the target business microservices can be determined based on the dependency relationships between the target data sources. The topological structure between the target business microservices can be constructed based on the dependency relationships between the target business microservices. In another optional embodiment, a preset business microservice dependency tree can be constructed based on the configuration information of the candidate business microservices and the configuration information of the candidate data sources. The topological structure between the target data sources can be obtained based on the preset business microservice dependency tree. The scheduling service submodule can be used to sequentially call the packaged services corresponding to the target business microservices based on the topological structure. The scheduling service submodule and the packaged services corresponding to the target business microservices can communicate and transmit data via UDS (Unix Domain Sockets, which enables data communication between two or more processes on the same machine), without going through a network. It should be noted that all user information and data involved in this disclosure are authorized by the user or fully authorized by all parties. The collection, use, and processing of this data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or deny. The data packaging method of this disclosure will be described in detail below in conjunction with specific embodiments. Refer to Figure 2, which is a schematic flow chart of the data packaging method provided in one embodiment of this disclosure. The method of this embodiment can be applied to electronic devices such as servers. The data packaging method includes:

[0002] S201. Receive a data request from a data requester, and determine multiple target data sources based on the data request. In this embodiment, when a data requester needs to access or load certain target data, it may send a data request to a server. The server may parse the data request and, based on the data request, determine multiple target data sources corresponding to the target data. Optionally, the data request may directly include information about the multiple target data sources, and the server may directly obtain the multiple target data sources from the data request. Alternatively, multiple alternative scenarios may be preset, with different data sources associated with different alternative scenarios. The data request may include target scenario information, and based on the target scenario information, the server may obtain multiple preset data sources associated with the target scenario information as target data sources. Furthermore, the data request may include an identifier of the target data, which is used to obtain the target data from the target data source based on the identifier. Multiple target data may be associated with the same identifier, for example, the identifier may be the unique identifier of the data requester, or different target data may be associated with different identifiers. Optionally, after receiving a data request from a data requester, the data requester may be verified to determine whether the data requester has permission to access the target data source. Furthermore, parameters of the data request may be verified. For example, the presence of fields in the data request (such as the target data source or target scenario information fields) may be determined. If not, the verification fails. After the verification of the data requester and the verification of the data request parameters pass, multiple target data sources may be determined based on the data request for subsequent steps.

[0003] S202. Determine the target business microservices to which the multiple target data sources belong, and obtain the topology between the target business microservices. In this embodiment, different data sources may belong to different business services, or some data sources may belong to the same business microservice. In this embodiment, data can be simultaneously acquired from different target data sources belonging to the same target business microservice. Furthermore, dependencies may exist between data sources, and data from different target data sources can be sequentially acquired based on these dependencies. Therefore, in this embodiment, the target business microservices to which the multiple target data sources belong can be first determined, and through parsing, the topology between the target business microservices can be acquired. The topology is used to characterize the dependencies between the target business microservices. Based on the topology, data from the target data sources included in each target business microservice can be sequentially acquired. Furthermore, different target data sources belonging to the same target business microservice can simultaneously acquire data. The method for acquiring the topology can be any feasible method and is not limited here.

[0004] S203. Based on the topology, the packaging services corresponding to the target business microservices are sequentially called to obtain target data from the target business microservices and package the target data into a target data structure. The packaging services corresponding to different target business microservices are isolated from each other. In this embodiment, corresponding packaging services are configured for different business microservices. The packaging services corresponding to different business microservices are isolated from each other. That is, the packaging services corresponding to different business microservices independently execute packaging logic without affecting each other. This achieves independent development and operation, code isolation, and operation isolation for the packaging services corresponding to different business microservices, solving the problem of coupling between packaging code and runtime environments for different business microservices. The packaging logic of the packaging services corresponding to different business microservices can be independently implemented according to business needs and is not detailed here. In this embodiment, based on the topology structure, the packaging services corresponding to the target business microservices can be called in sequence to obtain target data from the target business microservices, and then the target data can be packaged into a target data structure. The specific form of the target data structure can be pre-set, such as a specific data template, and the obtained target data is added to the corresponding position in the target data structure to finally form the target data structure.

[0005] S204. Send the target data structure to the data requester. In this embodiment, after obtaining the target data structure, the target data structure can be sent to the data requester, thereby satisfying the data requester's data request. This eliminates the need for the data requester to connect to different business microservices, thus avoiding the complexity of different business microservices. Optionally, before sending the target data structure to the data requester, the target data structure can be converted to a preset data format, such as PB, JSON, or Thrift format, and then sent to the data requester. Optionally, a conversion function can be configured for each data source, and the conversion function can be used to implement format conversion for each target data in the target data structure. Optionally, for some simple and basic data sources, such as some simple and basic fields, automatic format conversion can be achieved through background configuration injection. The data packaging method provided in this embodiment receives a data request from a data requester and determines multiple target data sources based on the data request. The method then determines the target business microservices to which the multiple target data sources belong and obtains the topology between the target business microservices. Based on the topology, the packaging services corresponding to the target business microservices are sequentially called to obtain target data from the target business microservices and package the target data into a target data structure. The packaging services corresponding to different target business microservices are isolated from each other. The target data structure is then sent to the data requester. This provides a unified access point for data requests from different business microservices, allowing the data requester to obtain the required data without having to connect to different business microservices. Furthermore, the packaging services corresponding to different business microservices independently execute packaging logic, allowing each packaging service to be developed and run independently, thus resolving the issues of coupling between packaging code and runtime environments for different business microservices. Based on any of the above embodiments, as shown in FIG3 , obtaining the topology between the target business microservices in S202 includes:

[0006] S202E Determine dependency relationships among the plurality of target data sources;

[0007] S2022: Determine the dependency relationships between the target business microservices based on the dependency relationships between the multiple target data sources;

[0008] S2023. Construct a topology structure between the target business microservices based on the dependency relationships between the target business microservices. In this embodiment, after multiple target data sources are determined according to the data request, dependencies between the multiple target data sources can be determined. For example, the multiple target data sources include target data sources 1 to 4, target data source 1 belongs to target business microservice A, target data sources 2 and 3 belong to target business microservice B, and target data source 4 belongs to target business microservice C. The dependencies between the multiple target data sources are: target data source 2 depends on target data source 1, and target data source 4 depends on target data source 1. Dependencies between the target business microservices are determined based on the dependencies between the multiple target data sources. For example, target data source 2 depends on target data source 1. Since target data source 1 belongs to target business microservice A, and target data sources 2 and 3 belong to target business microservice B, it can be seen that the dependencies between the target business microservices are: target business microservice B depends on target business microservice A. Similarly, it can be seen that target business microservice C depends on target business microservice A. Therefore, based on the dependencies between the target business microservices, a topology structure between the target business microservices is constructed, as shown in FIG3 . Optionally, the dependencies between different data sources can be preconfigured, and the dependencies between multiple target data sources can be determined based on the preconfigured dependencies between different data sources. Alternatively, the dependencies between multiple target data sources can be determined by the following process: obtaining a preset data source dependency tree; and performing a deep traversal of the preset data source dependency tree based on the multiple target data sources to obtain the dependencies between the multiple target data sources. In this embodiment, the preset data source dependency tree represents the dependencies between different data sources using a tree structure. A deep traversal algorithm (e.g., a DFS algorithm) can be used to perform a deep traversal of the preset data source dependency tree based on the multiple target data sources to quickly find the multiple target data sources in the preset data source dependency tree. The dependencies between the multiple target data sources can then be determined based on their positions in the preset data source dependency tree. Optionally, the preset data source dependency tree can be obtained by: obtaining configuration information for multiple candidate data sources, the configuration information including the business microservices to which the candidate data sources belong and the dependencies between the candidate data sources and other data sources; and constructing the preset data source dependency tree based on the configuration information of the multiple candidate data sources.In this embodiment, the configuration information of any candidate data source may specifically include, but is not limited to, a data source identifier (e.g., data source name), a data source type (used for parsing data source packaged results), the business microservice to which the data source belongs, data source dependencies, a data source description, and the like. In this embodiment, the server provides management services for configuring and managing candidate data sources, including but not limited to operations such as adding, deleting, and modifying the configuration information of candidate data sources. Furthermore, a preset data source dependency tree may be constructed based on the configuration information of the candidate data sources, particularly the data source dependencies contained in the configuration information. The process of constructing the preset data source dependency tree may employ any tree structure construction method, which is not limited herein. It should be noted that since the configuration information of candidate data sources may be added, deleted, or modified at any time, the configuration information of multiple candidate data sources may be periodically obtained, and a preset data source dependency tree may be constructed based on the configuration information of the multiple candidate data sources to ensure that the preset data source dependency tree remains updated. In another optional embodiment, obtaining the topological structure between the target business microservices in S202 may include: obtaining a preset business microservice dependency tree; and performing a deep traversal of the preset business microservice dependency tree based on the target business microservice to obtain the topological structure between the target data sources. In this embodiment, a preset business microservice dependency tree may be pre-constructed, and the dependency relationships between different business microservices may be represented by the tree structure. A deep traversal algorithm (e.g., a DFS algorithm) may then be used to perform a deep traversal of the preset business microservice dependency tree based on multiple target business microservices to quickly locate the multiple target business microservices in the preset business microservice dependency tree. The dependency relationships between the multiple target business microservices may then be determined based on the positions of the multiple target business microservices in the preset business microservice dependency tree. Optionally, the preset business microservice dependency tree can be obtained in the following manner: obtaining configuration information of multiple candidate business microservices and configuration information of multiple candidate data sources, where the configuration information of the candidate business microservices includes a list of data sources included in the candidate business microservices, and the configuration information of the candidate data sources includes the business microservice to which the candidate data source belongs, and the dependency relationship between the candidate data source and other data sources; and constructing the preset business microservice dependency tree based on the configuration information of the multiple candidate business microservices and the configuration information of the multiple candidate data sources.In this embodiment, the configuration information of any candidate business microservice may specifically include, but is not limited to, the following: business identifier (e.g., business name), business microservice name, business microservice method name, list of data sources included in the business microservice (for data source verification), business code repository identifier (for code repository isolation), business microservice cluster name (for cluster scheduling), business description, etc. The configuration information of any candidate data source may specifically include, but is not limited to, data source identifier (e.g., data source name), data source type (used for parsing data source packaging results), business microservice to which the data source belongs, data source dependencies, data source description, etc. In this embodiment, the server may provide management services for configuring and managing candidate business microservices and candidate data sources, including but not limited to operations such as adding, deleting, and modifying configuration information for candidate business microservices and candidate data sources. Furthermore, a preset business microservice dependency tree can be constructed based on the configuration information of the candidate business microservices and the configuration information of the candidate data sources. Dependencies between the candidate services can be determined based on the dependencies between the candidate data sources and the candidate business microservices to which each candidate data source belongs, thereby constructing the preset business microservice dependency tree. The process of constructing the preset business microservice dependency tree can employ any tree structure construction method, which is not limited herein. It should be noted that since the configuration information of the candidate business microservices and the configuration information of the candidate data sources may be added, deleted, or modified at any time, the configuration information of the candidate business microservices and the configuration information of the candidate data sources can be periodically obtained. Based on the configuration information of the candidate business microservices and the configuration information of the candidate data sources, the preset business microservice dependency tree can be constructed to keep the preset business microservice dependency tree up to date. Based on any of the above embodiments, the step of sequentially invoking the packaging services corresponding to the target business microservices according to the topology structure to obtain target data from the target business microservices and packaging the target data into a target data structure in S203 may specifically include:

[0009] S203E: When calling the packaged service corresponding to any first target business microservice, construct first input data of the first target business microservice according to second output data of a second target business microservice upstream of the first target business microservice in the topology structure;

[0010] S2032: Call the packaging service corresponding to the first target business microservice to input the first input data into the first target business microservice, and obtain first output data output by the first target business microservice;

[0011] S2033: Fill the corresponding position of the target data structure with the first output data. In this embodiment, for target business microservices with upstream and downstream dependencies, the input data of the downstream target business microservice depends on the output data of the upstream target business microservice. For example, if a first target business microservice depends on a second target business microservice, when calling the packaged service corresponding to the first target business microservice, the input data of the first target business microservice (referred to as the first input data) must be constructed based on the output data of the second target business microservice (referred to as the second output data). The first target business microservice then inputs the first input data into the first target business microservice (for example, via a remote procedure call (RPC)), obtains the output data of the first target business microservice (referred to as the first output data), and then fills the corresponding position of the target data structure with the first output data. If the first target business microservice includes multiple target data sources, the corresponding multiple first output data are obtained and respectively filled into the corresponding positions of the target data structure. The input data can be constructed based on the identifier of the target data in the data request. Optionally, a schematic diagram of the target data structure may be shown in FIG4 . Data locations for data from different data sources are preconfigured in the target data structure. After any target business microservice obtains the target data from the target data source, the data can be filled into the corresponding locations in the target data structure. Optionally, different data structures may be configured for different scenarios. In this embodiment, the packaged service corresponding to the first target business microservice is called sequentially based on the topology structure. For target business microservices without dependencies, the corresponding packaged services can be called in parallel. For example, target business microservices B and C in FIG3 can call their corresponding packaged services in parallel. Optionally, during the calling process, the execution status of the packaged service corresponding to each target business microservice can be annotated in the topology structure, such as running, waiting, or completed, to facilitate call management, as shown in FIG5 . Based on any of the above embodiments, before sending the target data structure to the data requester, the target data structure can be converted into a preset data format. For example, as shown in FIG6 , using the conversion of a data format DTO (Data Transfer Object) into a data format Pb or JSON, a conversion function can be configured for each data source and stored in a database. During data conversion, the corresponding conversion function for each data source is called to implement the format conversion of each data item in the target data structure (only the data conversion for data sources 5 to 8 is shown in the figure). Corresponding to the data packaging method in the above embodiments, FIG7 is a block diagram of the data packaging device provided in an embodiment of the present disclosure.For ease of illustration, only portions relevant to the embodiments of the present disclosure are shown. Referring to FIG7 , the data packaging device 700 includes a receiving unit 701, a parsing unit 702, a scheduling unit 703, and a sending unit 704. The receiving unit 701 is configured to receive a data request from a data requester. The parsing unit 702 is configured to determine multiple target data sources based on the data request, determine the target business microservices to which the multiple target data sources belong, and obtain a topology structure between the target business microservices. The scheduling unit 703 is configured to sequentially invoke the packaging services corresponding to the target business microservices based on the topology structure, obtain target data from the target business microservices through the packaging services corresponding to the target business microservices, and package the target data into a target data structure. The packaging services corresponding to different target business microservices are isolated from each other. The sending unit 704 is configured to send the target data structure to the data requester. In one or more embodiments of the present disclosure, when obtaining the topology structure between the target business microservices, the parsing unit 702 is configured to: determine the dependency relationships between the multiple target data sources; determine the dependency relationships between the target business microservices based on the dependency relationships between the multiple target data sources; and construct the topology structure between the target business microservices based on the dependency relationships between the target business microservices. In one or more embodiments of the present disclosure, when determining the dependency relationships between the multiple target data sources, the parsing unit 702 is configured to: obtain a preset data source dependency tree; perform a deep traversal of the preset data source dependency tree based on the multiple target data sources to obtain the dependency relationships between the multiple target data sources. In one or more embodiments of the present disclosure, when obtaining the preset data source dependency tree, the parsing unit 702 is configured to: obtain configuration information of multiple candidate data sources, the configuration information including the business microservices to which the candidate data sources belong and the dependency relationships between the candidate data sources and other data sources; and construct the preset data source dependency tree based on the configuration information of the multiple candidate data sources. In one or more embodiments of the present disclosure, when obtaining the topological structure between the target business microservices, the parsing unit 702 is configured to: obtain a preset business microservice dependency tree; and perform a deep traversal of the preset business microservice dependency tree according to the target business microservice to obtain the topological structure between the target data sources.In one or more embodiments of the present disclosure, when obtaining the preset business microservice dependency tree, the parsing unit 702 is configured to: obtain configuration information of multiple candidate business microservices and configuration information of multiple candidate data sources, where the configuration information of the candidate business microservices includes a list of data sources included in the candidate business microservices, and the configuration information of the candidate data sources includes the business microservice to which the candidate data source belongs and the dependency relationship between the candidate data source and other data sources; and construct the preset business microservice dependency tree based on the configuration information of the multiple candidate business microservices and the configuration information of the multiple candidate data sources. In one or more embodiments of the present disclosure, when the scheduling unit 703 sequentially calls the packaging services corresponding to the target business microservices according to the topology to obtain target data from the target business microservices and packages the target data into a target data structure, it is configured to: when calling the packaging service corresponding to any first target business microservice, construct first input data for the first target business microservice based on the second output data of a second target business microservice upstream of the first target business microservice in the topology; call the packaging service corresponding to the first target business microservice to input the first input data into the first target business microservice to obtain first output data output by the first target business microservice; and fill the first output data into the corresponding position of the target data structure. In one or more embodiments of the present disclosure, when the sending unit 704 sends the target data structure to the data requester, it is configured to: convert the target data structure into a preset data format and then send the converted target data structure to the data requester. In one or more embodiments of the present disclosure, the data request includes target scenario information. When determining multiple target data sources based on the data request, the parsing unit 702 is configured to: obtain, based on the target scenario information, multiple preset data sources associated with the target scenario information, and determine these as the multiple target data sources. The data packaging device provided in this embodiment can be used to implement the technical solutions of the above-described method embodiments. Its implementation principles and technical effects are similar and will not be further described in detail in this embodiment. Referring to FIG8 , a schematic structural diagram of an electronic device 800 suitable for implementing embodiments of the present disclosure is shown. This electronic device 800 can be a terminal device or a server.Terminal devices may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG8 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure. As shown in FIG8 , electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 801, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 802 or programs loaded from a storage device 808 into a random access memory (RAM) 803. RAM 803 also stores various programs and data required for the operation of electronic device 800. The processing device 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804. Typically, the following devices may be connected to the I / O interface 805: an input device 806, such as a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 807, such as a liquid crystal display (LCD), speaker, vibrator, etc.; a storage device 808, such as a magnetic tape, hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or wired to exchange data. Although FIG8 shows an electronic device 800 with various devices, it should be understood that not all illustrated devices are required to be implemented or present. More or fewer devices may alternatively be implemented or present. In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for executing the method shown in the flowchart.In such an embodiment, the computer program can be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. When the computer program is executed by processing device 801, the aforementioned functions defined in the method of the embodiment of the present disclosure are performed. It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Furthermore, in the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, capable of transmitting, propagating, or transferring a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), or any suitable combination thereof. The computer-readable medium may be included in the electronic device described above, or may exist separately and not incorporated into the electronic device. The computer-readable medium carries one or more programs. When executed by the electronic device, the one or more programs cause the electronic device to perform the methods described in the above embodiments. Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and Common. or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider). The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of the systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in an order different from that noted in the accompanying drawings. For example, two blocks shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, as well as combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified functions or operations, or may be implemented using a combination of dedicated hardware and computer instructions. The units described in the embodiments of this disclosure may be implemented via software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses." The functions described above may be at least partially performed by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like. In the context of this disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by, or in conjunction with, an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. One or more embodiments of the present disclosure provide a data packaging method, comprising: receiving a data request from a data requester, determining multiple target data sources based on the data request; determining target business microservices to which the multiple target data sources belong, and obtaining a topology structure between the target business microservices; sequentially invoking packaging services corresponding to the target business microservices based on the topology structure, obtaining target data from the target business microservices through the packaging services corresponding to the target business microservices, and packaging the target data into a target data structure; wherein the packaging services corresponding to different target business microservices are isolated from each other; and sending the target data structure to the data requester. According to one or more embodiments of the present disclosure, obtaining the topology structure between the target business microservices includes: determining dependency relationships between the multiple target data sources; determining dependency relationships between the target business microservices based on the dependency relationships between the multiple target data sources; and constructing a topology structure between the target business microservices based on the dependency relationships between the target business microservices. According to one or more embodiments of the present disclosure, determining the dependency relationships between the multiple target data sources includes: obtaining a preset data source dependency tree; and deeply traversing the preset data source dependency tree based on the multiple target data sources to obtain the dependency relationships between the multiple target data sources. According to one or more embodiments of the present disclosure, obtaining the preset data source dependency tree includes: obtaining configuration information for multiple candidate data sources, the configuration information including the business microservices to which the candidate data sources belong and the dependency relationships between the candidate data sources and other data sources; and constructing the preset data source dependency tree based on the configuration information of the multiple candidate data sources. According to one or more embodiments of the present disclosure, obtaining the topological structure between the target business microservices includes: obtaining a preset business microservice dependency tree; and deeply traversing the preset business microservice dependency tree based on the target business microservices to obtain the topological structure between the target data sources.According to one or more embodiments of the present disclosure, obtaining a preset business microservice dependency tree includes: obtaining configuration information of multiple candidate business microservices and configuration information of multiple candidate data sources, where the configuration information of the candidate business microservices includes a list of data sources included in the candidate business microservices, and the configuration information of the candidate data sources includes the business microservice to which the candidate data source belongs and the dependency relationship between the candidate data source and other data sources; and constructing the preset business microservice dependency tree based on the configuration information of the multiple candidate business microservices and the configuration information of the multiple candidate data sources. According to one or more embodiments of the present disclosure, sequentially invoking packaging services corresponding to the target business microservices based on the topology structure to obtain target data from the target business microservices and packaging the target data into a target data structure includes: when invoking the packaging service corresponding to any first target business microservice, constructing first input data for the first target business microservice based on second output data of a second target business microservice upstream of the first target business microservice in the topology structure; invoking the packaging service corresponding to the first target business microservice to input the first input data into the first target business microservice to obtain first output data output by the first target business microservice; and filling the first output data into corresponding positions in the target data structure. According to one or more embodiments of the present disclosure, sending the target data structure to the data requester includes: converting the target data structure into a preset data format and then sending the converted target data structure to the data requester. According to one or more embodiments of the present disclosure, the data request includes target scenario information, and determining multiple target data sources based on the data request includes: obtaining, based on the target scenario information, multiple preset data sources associated with the target scenario information and determining them as the multiple target data sources. One or more embodiments of the present disclosure provide a data packaging device, comprising: a receiving unit, configured to receive a data request sent by a data requester; a parsing unit, configured to determine multiple target data sources based on the data request; respectively determine target business microservices to which the multiple target data sources belong, and obtain a topology structure between the target business microservices; a scheduling unit, configured to sequentially call packaging services corresponding to the target business microservices according to the topology structure, obtain target data from the target business microservices through the packaging services corresponding to the target business microservices, and package the target data into a target data structure; wherein the packaging services corresponding to different target business microservices are isolated from each other; and a sending unit, configured to send the target data structure to the data requester.According to one or more embodiments of the present disclosure, when obtaining the topological structure between the target business microservices, the parsing unit is configured to: determine the dependency relationships between the multiple target data sources; determine the dependency relationships between the target business microservices based on the dependency relationships between the multiple target data sources; and construct the topological structure between the target business microservices based on the dependency relationships between the target business microservices. According to one or more embodiments of the present disclosure, when determining the dependency relationships between the multiple target data sources, the parsing unit is configured to: obtain a preset data source dependency tree; perform a deep traversal of the preset data source dependency tree based on the multiple target data sources to obtain the dependency relationships between the multiple target data sources. According to one or more embodiments of the present disclosure, when obtaining the preset data source dependency tree, the parsing unit is configured to: obtain configuration information for multiple candidate data sources, the configuration information including the business microservices to which the candidate data sources belong and the dependency relationships between the candidate data sources and other data sources; and construct the preset data source dependency tree based on the configuration information of the multiple candidate data sources. According to one or more embodiments of the present disclosure, when obtaining the topological structure between the target business microservices, the parsing unit is configured to: obtain a preset business microservice dependency tree; and perform a deep traversal of the preset business microservice dependency tree based on the target business microservice to obtain the topological structure between the target data sources. According to one or more embodiments of the present disclosure, when obtaining the preset business microservice dependency tree, the parsing unit is configured to: obtain configuration information of multiple candidate business microservices and configuration information of multiple candidate data sources, wherein the configuration information of the candidate business microservices includes a list of data sources included in the candidate business microservices, and the configuration information of the candidate data sources includes the business microservices to which the candidate data sources belong and the dependency relationships between the candidate data sources and other data sources; and construct the preset business microservice dependency tree based on the configuration information of the multiple candidate business microservices and the configuration information of the multiple candidate data sources.According to one or more embodiments of the present disclosure, when the scheduling unit sequentially calls the packaging services corresponding to the target business microservices according to the topology structure to obtain target data from the target business microservices and packages the target data into a target data structure, the scheduling unit is configured to: when calling the packaging service corresponding to any first target business microservice, construct first input data for the first target business microservice based on second output data of a second target business microservice upstream of the first target business microservice in the topology structure; call the packaging service corresponding to the first target business microservice to input the first input data into the first target business microservice to obtain first output data output by the first target business microservice; and fill the first output data into a corresponding position of the target data structure. According to one or more embodiments of the present disclosure, when the sending unit sends the target data structure to the data requester, the sending unit is configured to: convert the target data structure into a preset data format and then send the converted target data structure to the data requester. According to one or more embodiments of the present disclosure, the data request includes target scenario information. When determining multiple target data sources based on the data request, the parsing unit is configured to: obtain, based on the target scenario information, multiple preset data sources associated with the target scenario information, and determine the multiple target data sources. One or more embodiments of the present disclosure provide an electronic device comprising: at least one processor and a memory; the memory storing computer-executable instructions; the at least one processor executing the computer-executable instructions stored in the memory, causing the at least one processor to perform the above-described data packaging method. One or more embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions. When the processor executes the computer-executable instructions, the at least one processor implements the above-described data packaging method. One or more embodiments of the present disclosure provide a computer program product including computer-executable instructions. When the processor executes the computer-executable instructions, the at least one processor implements the above-described data packaging method. The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the present disclosure is not limited to technical solutions formed by a specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the scope of the above-mentioned disclosure. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.Furthermore, although operations are depicted in a particular order, this should not be construed as requiring that these operations be performed in the particular order shown or in a sequential order. Multitasking and parallel processing may be advantageous under certain circumstances. Similarly, although the above discussion includes several specific implementation details, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented in multiple embodiments individually or in any suitable subcombination. Although the subject matter has been described using language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

Claims 1. A data packaging method, comprising: receiving a data request sent by a data requester, and determining a plurality of target data sources according to the data request; Determine the target business microservices to which the multiple target data sources belong respectively, and obtain the topological structure between the target business microservices; According to the topology structure, the packaging services corresponding to the target business microservices are called in sequence, target data is obtained from the target business microservices through the packaging services corresponding to the target business microservices, and the target data is packaged into a target data structure, wherein the packaging services corresponding to different target business microservices are isolated from each other; and sending the target data structure to the data requester.

2. The method according to claim 1, wherein: The obtaining of the topological structure between the target business microservices includes: determining dependencies between the multiple target data sources; determining dependencies between the target business microservices according to the dependencies between the multiple target data sources; and constructing the topological structure between the target business microservices according to the dependencies between the target business microservices.

3. The method according to claim 2, wherein: The determining the dependency relationship between the multiple target data sources includes: obtaining a preset data source dependency tree; and performing a deep traversal of the preset data source dependency tree according to the multiple target data sources to obtain the dependency relationship between the multiple target data sources.

4. The method according to claim 3, wherein: The obtaining of the preset data source dependency tree includes: obtaining configuration information of multiple candidate data sources, wherein the configuration information includes the business microservice to which the candidate data source belongs and the dependency relationship between the candidate data source and other data sources; and constructing the preset data source dependency tree according to the configuration information of the multiple candidate data sources.

5. The method according to claim 1, wherein: The acquisition of the target business microservice The topological structure between the target data sources includes: obtaining a preset business microservice dependency tree; and deeply traversing the preset business microservice dependency tree according to the target business microservice to obtain the topological structure between the target data sources.

6. The method according to claim 5, wherein: The obtaining of the preset business microservice dependency tree includes: obtaining configuration information of multiple candidate business microservices and configuration information of multiple candidate data sources, wherein the configuration information of the candidate business microservices includes a list of data sources included in the candidate business microservices, and the configuration information of the candidate data source includes the business microservice to which the candidate data source belongs and the dependency relationship between the candidate data source and other data sources; and constructing the preset business microservice dependency tree according to the configuration information of the multiple candidate business microservices and the configuration information of the multiple candidate data sources.

7. The method according to any one of claims 1 to 5, wherein: The method of sequentially calling the packaging services corresponding to the target business microservices according to the topological structure to obtain target data from the target business microservices and packaging the target data into a target data structure includes: when calling the packaging service corresponding to any first target business microservice, constructing first input data of the first target business microservice according to second output data of a second target business microservice upstream of the first target business microservice in the topological structure; calling the packaging service corresponding to the first target business microservice, inputting the first input data into the first target business microservice, and obtaining first output data output by the first target business microservice; and filling the first output data into a corresponding position of the target data structure.

8. The method according to any one of claims 1 to 5, wherein: The sending the target data structure to the data requester includes: after converting the target data structure into a preset data format, sending the converted target data structure to the data requester.

9. The method according to any one of claims 1 to 5, wherein: The data request includes target scene information, and determining multiple target data sources according to the data request includes: acquiring multiple preset data sources associated with the target scene information according to the target scene information, and determining the multiple preset data sources as the multiple target data sources.

10. A data packaging device, comprising: A receiving unit, configured to receive a data request sent by a data requester; a parsing unit, configured to determine a plurality of target data sources according to the data request; Determine the target business microservices to which the multiple target data sources belong respectively, and obtain the topological structure between the target business microservices; a scheduling unit configured to sequentially call the packaging services corresponding to the target business microservices according to the topology structure to obtain target data from the target business microservices, and package the target data into a target data structure, wherein the packaging services corresponding to different target business microservices are isolated from each other; and a sending unit, configured to send the target data structure to the data requester.

11. An electronic device, comprising: At least one processor and a memory; wherein the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-9.

12. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.

13. A computer program product, comprising: Computer-executable instructions, wherein when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Micro-service architecture system and access method thereof

    CN108270818A

  • Multi-tenant-oriented image cloud service system and method

    CN110311973A

  • Global optimization of a service-oriented system

    US10182129B1