DSP system construction method, device, electronic device and storage medium
By parsing the description file and launching the registered business components to the preset gateway module, the problem that existing DSP systems cannot be customized is solved, and the automated DSP system construction and customization functions are realized.
Patent Information
- Application Number
- CN202110163819.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-05
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-02-05
AI Technical Summary
The existing DSP system lacks customized functions and cannot build a customized DSP system according to the specific needs of different advertisers, resulting in advertisers needing to customize different functional combinations.
By obtaining the description file, parsing the mirror address information and API description information, starting the business component, and registering it in the preset gateway module to realize the forwarding and processing of business requests.
It realizes the automatic construction of customized DSP system according to user needs, reducing customization costs and improving the customization speed and stability of the DSP system.
Smart Images

Figure CN113760308B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for constructing a DSP system. Background Art
[0002] DSP (Demand-Side Platform) is a demand-side platform. Advertisers can use DSP to easily and conveniently buy and sell online advertisements on multiple advertising trading platforms.
[0003] Currently, the DSPs used by various advertisers have unified functions. As the advertising business of some leading advertisers and agencies grows, they have accumulated a large amount of private customer data and have a demand for more precise and targeted delivery to improve ROI (Return on Investment). Therefore, there is a demand for customized functions of the DSP platform. For example, the DSPs used by various advertisers have 10,000 unified functions. However, advertiser A needs to customize a DSP with 1,000 of the 10,000 functions, and advertiser B needs to customize a DSP with the other 1,000 functions.
[0004] In the process of implementing the present invention, it was found that the prior art has at least the following problems:
[0005] How to build a customized DSP based on user needs is a problem that needs to be solved at present. Summary of the Invention
[0006] The embodiments of the present invention provide a method, device, electronic device and storage medium for constructing a DSP system, so as to realize the construction of a customized DSP according to actual needs of users.
[0007] In a first aspect, an embodiment of the present invention provides a method for constructing a DSP system, comprising:
[0008] Upon receiving the system building instruction, obtain the description file corresponding to the DSP system to be built;
[0009] Parsing the description file, and reading the mirror address information and application programming interface API description information corresponding to each service component included in the DSP system to be constructed from the parsing result;
[0010] Obtaining the mirror files corresponding to the business components according to the mirror address information, and starting and running the business components based on the mirror files;
[0011] The API description information of each business component is registered in a preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0012] In a second aspect, an embodiment of the present invention further provides a device for constructing a DSP system, including:
[0013] The file acquisition module is used to obtain the description file corresponding to the DSP system to be built when receiving the system construction instruction;
[0014] A file parsing module is used to parse the description file and read the image address information and application programming interface API description information corresponding to each business component included in the DSP system to be constructed from the parsing result;
[0015] A component startup module, configured to obtain the image files corresponding to the service components according to the image address information, and start running the service components based on the image files;
[0016] The API registration module is used to register the API description information of each business component into the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0017] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising:
[0018] one or more processors;
[0019] a storage device for storing one or more programs,
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for constructing a DSP system provided by any embodiment of the present invention.
[0021] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for constructing a DSP system as provided in any embodiment of the present invention.
[0022] The embodiments of the above invention have the following advantages or beneficial effects:
[0023] When receiving the system construction instruction, the description file corresponding to the DSP system to be constructed is obtained, the description file is parsed, and the image address information and application programming interface API description information corresponding to each business component contained in the DSP system to be constructed are read from the parsed result. The image files corresponding to each business component are obtained according to each image address information, and each business component is started and run based on each image file. The API description information of each business component is registered in the preset gateway module so that the preset gateway module can determine the corresponding target business component when receiving a business request and forward the business request to the target business component. This solution realizes the automatic deployment of the DSP system based on the description file, thereby greatly reducing the customization cost of the DSP system. In addition, since the description file corresponding to the DSP system to be constructed can be configured according to the actual needs of the user, it is possible to build a customized DSP based on the actual needs of the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings introduced here only illustrate some of the embodiments to be described by the present invention, and are not exhaustive. A person skilled in the art can derive other drawings based on these drawings without inventive effort.
[0025] Figure 1A A flowchart of a method for constructing a demand-side platform DSP system provided in the first embodiment of the present invention;
[0026] Figure 1B A schematic diagram of a preset gateway module calling a service component provided in the first embodiment of the present invention;
[0027] Figure 2 A flowchart of a method for constructing a demand-side platform DSP system provided in the second embodiment of the present invention;
[0028] Figure 3 A flowchart of a method for constructing a demand-side platform DSP system provided in the third embodiment of the present invention;
[0029] Figure 4A A flowchart of a method for constructing a demand-side platform DSP system provided in the fourth embodiment of the present invention;
[0030] Figure 4B This is a schematic diagram of the structure of a delivery engine provided by the fourth embodiment of the present invention;
[0031] Figure 5A A flowchart of a method for constructing a demand-side platform DSP system provided in the fifth embodiment of the present invention;
[0032] Figure 5B A schematic diagram of the principle of constructing a DSP system provided by the fifth embodiment of the present invention;
[0033] Figure 6 This is a structural diagram of a device for constructing a demand-side platform DSP system provided by Embodiment 6 of the present invention;
[0034] Figure 7 This is a structural diagram of an electronic device provided in Example 7 of the present invention. DETAILED DESCRIPTION
[0035] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.
[0036] Example 1
[0037] Figure 1A This is a flowchart of a method for constructing a demand-side platform (DSP) system, provided in accordance with the first embodiment of the present invention. This embodiment is applicable to constructing a DSP system based on actual user needs, and is particularly applicable to starting and running each service component included in the DSP system according to the corresponding description file of the DSP system, and registering the API description information of each service component. This method can be executed by a construction device for the demand-side platform (DSP) system, which can be implemented by hardware and / or software. The method specifically includes the following steps:
[0038] S110 . Upon receiving the system construction instruction, obtain a description file corresponding to the DSP system to be constructed.
[0039] The system build instructions are used to build the DSP system to be built. These instructions can be generated based on user actions. For example, a system build instruction is generated when a user triggers a corresponding control to confirm system build. Alternatively, the system build instruction can be sent by a management terminal. The management terminal can be understood as a server capable of issuing system build instructions and description files.
[0040] In this embodiment, the description file can be used to describe the element information of each business component included in the DSP system to be constructed. The description file is pre-configured and generated based on the actual needs of the user. For example, advertiser A needs to customize a DSP system with one thousand functions out of ten thousand functions. Based on the one thousand functions required by advertiser A, 1,000 business components corresponding to the one thousand functions are predetermined, and the element information of the 1,000 business components is described, thereby generating a description file containing 1,000 element information as the description file corresponding to the DSP system to be constructed. That is, according to the actual needs of the user for business functions, by describing the element information of each business component of the DSP system to be constructed, each business component can be combined to construct a complete DSP system. Moreover, by describing the element information of each business component, on-demand customization of business functions is achieved, thereby achieving personalized customization of the DSP system.
[0041] In one embodiment, the description file can be a YAML document. Optionally, the description file can also be used to describe the entire structure and internal relationships of the DSP system to be built. For example, it can describe macro information such as applications, modules, business components, and version authorization.
[0042] Optionally, the pre-configured description file can be stored in the database of the management end. When the system construction instruction is received, a request is sent to the management end to obtain the description file corresponding to the DSP system to be built; or, when the management end sends the system construction instruction to the client, it also sends the description file corresponding to the DSP system to be built to the client.
[0043] S120 , parsing the description file, and reading the mirror address information and application programming interface API description information corresponding to each service component included in the DSP system to be constructed from the parsing result.
[0044] In this embodiment, since the description file contains descriptions of the element information of each business component, the description file can be parsed to obtain the description of the element information in the description file based on the parsing results. In one embodiment, the description file can be parsed into component models corresponding to each business component, that is, each component model is used as the parsing result. The component model includes the definition of each element information of the business component.
[0045] In one embodiment, the essential information of a business component includes, but is not limited to, an image address and an application programming interface (API). The parsed results of the component model include, but are not limited to, the definition of the image address information and the API description information. The image address information may be the address information where the image file corresponding to the business component is stored. Optionally, the image file corresponding to each business component may be stored in an image repository on the management side; accordingly, the image address information is the specific address information of the corresponding image file stored in the image repository.
[0046] The API description information of a business component is used to describe the various APIs contained in the business component. Among them, each API contained in the business component has the function of processing the corresponding business request. For example, API-A of a business component is used to process the business request of uploading files, and API-B is used to process the business request of deleting uploaded files. Then the API description information of the business component includes the description information of the business services of API-A and API-B. It should be noted that the API description information can also be used to standardize the component functions of the business component. Users can modify the API description information of the business component to achieve secondary development or function customization of the business component's functions.
[0047] S130 : Obtain the mirror files corresponding to the service components according to the mirror address information, and start running the service components based on the mirror files.
[0048] The image file includes, but is not limited to, the component code that the business component relies on to start and run. For example, a business component developer can compile the component code they wrote into a Docker image and place the Docker image in a management-side image repository. The Docker image can then be retrieved based on the image address information in the image repository.
[0049] Specifically, after obtaining the image files corresponding to each service component, each service component can be started and run based on the component code of the service component contained in each image file. In this embodiment, the purpose of obtaining the image files corresponding to each service component is to enable the developed service components to be directly called during the construction of the DSP to be built without having to worry about the component code of the service components.
[0050] S140. Register the API description information of each business component in the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0051] Among them, the target business component can be a business component that provides the business service corresponding to the business request. In this embodiment, when the API description information of each business component is registered with the preset gateway module, the preset gateway module can discover the business service of each API through the registered information, thereby determining the business service corresponding to each business component. When the preset gateway module receives a business request, the target business component can be determined from each business component based on the business service corresponding to the received business request and the known business services provided by each business component. After the preset gateway module forwards the business request to the target business component, the target business component can process the business request by calling the API that provides the business service corresponding to the business request.
[0052] For example, business component 1 includes API-A and API-B, and business component 2 includes API-C. The API description information of API-A, API-B, and API-C has been registered in the preset gateway module. The business services corresponding to API-A, API-B, and API-C are uploading files, deleting files, and downloading files, respectively. When the preset gateway module receives a business request to delete a file, it forwards the business request to business component 1, and business component 1 can process the business request by calling API-B.
[0053] It should be noted that the preset gateway module can receive business requests sent by internal components, external components, or external systems. In other words, this method of registering the API description information of each business component with the preset gateway module so that the preset gateway module forwards the business request to the corresponding target business component, and the target business component then calls the corresponding API to process the business request can support internal and external components calling registered APIs, and can also support external systems calling registered APIs, thereby enabling flexible customized development of business services.
[0054] For example, Figure 1B As shown, Figure 1B The API Gateway is a preset gateway module, and the component API description information (i.e., the API service in the figure) has been pre-registered in the API Gateway. The API Gateway is aware of the business services corresponding to the registered component APIs. When the API Gateway receives a business request sent by a front-end component, external component, or external system, it can forward the business request to the target business component based on the known business services corresponding to each business component and call the corresponding component API to process the business request.
[0055] The purpose of calling business components through the preset gateway module is that the mutual calling between business components can also be realized through the preset gateway module, thereby realizing the interaction of internal data with external data while also realizing the interaction of internal data.
[0056] Optionally, the API description information includes a correspondence between the API name contained in the corresponding business component and the uniform resource locator URL address; when receiving a business request, the preset gateway module determines the target business component for processing the business request based on the registered API description information, and forwards the business request to the target business component, including: when receiving a business request, the preset gateway module determines the API corresponding to the URL address contained in the business request as the target API according to the correspondence, or determines the default API pre-configured for the domain name as the target API according to the domain name contained in the business request; determines the business component where the target API is located as the target business component, and forwards the business request to the target business component.
[0057] In one embodiment, the correspondence between the Uniform Resource Locator (URL) address and the API name is pre-configured in the API description information of the description file. For example, the URL address is http: / / *****.com / File / Download / 554182A, and the corresponding API name is Download File API. It should be noted that the same API name can correspond to multiple URL addresses. Specifically, the preset gateway module can determine the target API corresponding to the URL address of the received business request based on the correspondence between the API name and the URL address, and determine the business component where the target API is located as the target business component.
[0058] Considering the situation that the received service request does not carry a URL address, for example, the service request contains a domain name but does not contain a URL address (such as a service request to display the system homepage of the DSP system). In this case, it is impossible to determine the corresponding target API based on the URL address of the service request. Therefore, in another embodiment, a corresponding default API can be pre-configured for each domain name. When a service request is received, the corresponding target API is determined based on the domain name carried in the service request, and the service component where the target API is located is determined as the target service component, thereby avoiding the phenomenon that the API corresponding to the service request that does not carry a URL address cannot be determined.
[0059] In these optional implementations, by configuring the correspondence between the API name contained in the business component and the uniform resource locator URL address in the API description information, the preset gateway module determines the target API based on the URL address or domain name of the business request, thereby determining the target business component, thereby achieving accurate determination of the target business component and further ensuring accurate processing of the business request.
[0060] The technical solution of this embodiment is to obtain the description file corresponding to the DSP system to be built upon receiving the system construction instruction, parse the description file, read the mirror address information and application programming interface API description information corresponding to each business component contained in the DSP system to be built from the parsed result, obtain the mirror file corresponding to each business component according to each mirror address information, start running each business component based on each mirror file, and register the API description information of each business component in the preset gateway module, so that the preset gateway module can determine the corresponding target business component upon receiving a business request and forward the business request to the target business component. This solution realizes the automatic deployment of the DSP system based on the description file, thereby greatly reducing the customization cost of the DSP system. In addition, since the description file corresponding to the DSP system to be built can be configured according to the actual needs of the user, it is possible to build a customized DSP based on the actual needs of the user.
[0061] It should be noted that this embodiment may also provide a delivery engine that can build a DSP system by executing the above method steps. The delivery engine can be used by users (advertisers). The management end sends a description file to the user's delivery engine, which then parses the description file and automatically completes the construction of the user's customized DSP system, achieving one-click delivery of the DSP system.
[0062] Specifically, the delivery engine can communicate with the management side. When it receives a system construction instruction generated based on a user-triggered operation, it applies to the management side for a description file corresponding to the DSP system to be built, parses the description file, and reads the image address information and application programming interface (API) description information corresponding to each business component included in the DSP system to be built from the parsed Ada-model. Based on the image address information, it obtains the image file corresponding to each business component, starts running each business component based on each image file, and registers the API description information of each business component with the preset gateway module. In other words, the delivery engine can automatically complete the construction of the entire DSP system based on the description file provided by the management side.
[0063] The purpose of providing a delivery engine is that the description file can be configured according to the actual needs of the user. The user can obtain the description file through the delivery engine, so that the delivery engine can complete the deployment and installation of the entire DSP based on only one description file, thereby realizing one-click delivery of the DSP. While effectively reducing the delivery cost, it facilitates the automated customization and release of large-scale complex DSP systems, further improving the customization speed of the DSP system.
[0064] Optionally, the delivery engine can be divided into a three-layer structure: an application model layer, a cloud runtime layer, and a cloud API layer. Specifically, the Application Model layer is used to scan and parse description files, and start running various business components according to the description files; the Cloud Runtime layer is used to receive various control instructions issued by the CloudAPI layer, such as system construction instructions, and perform corresponding operations according to the received control instructions; the CloudAPI layer is used to receive various external control instructions, store the control instructions and send them to the CloudRuntime layer. It should be noted that the number of structural layers of the delivery engine can be three layers, four layers, etc. This application does not limit the specific number of structural layers, and it can be divided according to actual needs.
[0065] Example 2
[0066] Figure 2 A flow chart of a method for constructing a demand-side platform DSP system provided in the second embodiment of the present invention. Based on the above embodiments, this embodiment optionally starts and runs each business component based on each mirror file, including: reading resource information of resources required for the operation of each business component and configuration file templates of each business component from the parsing results; calling the Platform as a Service PaaS interface based on each resource information to apply for the resources required for the operation of each business component and initialize the applied resources to obtain the running container of each business component; writing each resource information into the configuration file template of the corresponding business component to obtain the configuration file corresponding to each business component, and writing each mirror file and each configuration file into the running container of the corresponding business component; starting the process of each running container to run each business component.
[0067] The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 2 The present embodiment provides a method for constructing a demand-side platform (DSP) system, including the following steps:
[0068] S210 . Upon receiving the system construction instruction, obtain a description file corresponding to the DSP system to be constructed.
[0069] S220 , parsing the description file, and reading the mirror address information and application programming interface API description information corresponding to each service component included in the DSP system to be constructed from the parsing result.
[0070] S230: Obtain the mirror files corresponding to the respective business components according to the mirror address information.
[0071] S240: Read resource information of resources required for the operation of each business component and a configuration file template of each business component from the parsing result.
[0072] In this embodiment, element information includes, but is not limited to, image addresses, APIs, resources, and configuration files. Accordingly, the description file is generated by pre-describing the image addresses, APIs, resources, and configuration files. Therefore, the parsed results of the description file also include resource information and the definition of the configuration file template. In other words, this embodiment can describe elements such as the image addresses, APIs, resources, and configuration files of each service component during pre-configuration of the description file, allowing the DSP system to be constructed based on the descriptions of these elements in the description file.
[0073] The resource information may include the resources required to run the business component, including but not limited to the computing, storage, and network resources required for operation. For example, running a business component requires at least two central processing units (CPUs), 4GB of memory, and 2MB of bandwidth. The configuration file template may be a template for the configuration file required to run the component code of the business component. The configuration file template is decoupled from the component code and is not included in the image file.
[0074] It should be noted that the execution order of steps S230 and S240 is not particular, and S230 and S240 can be executed sequentially or simultaneously, and this application does not limit this.
[0075] S250: Based on the resource information, the Platform as a Service (PaaS) interface is called to apply for the resources required for the operation of each business component and initialize the applied resources to obtain the operation container of each business component.
[0076] Among them, the Platform as a Service (PaaS) interface can apply for cloud resources such as computing, storage, and network for the DSP system to be built. The PaaS interface can also apply for middleware resources for the DSP system to be built, and provide running containers for the various business components contained in the DSP system to be built. The purpose of calling the PaaS interface to initialize resources is: by applying for cloud resources, the differences between the physical machine and the operating system when building the DSP system can be shielded. The various business components of the DSP only need to be developed and run in the container environment provided by PaaS, thereby reducing the adaptation cost of the underlying complex environment.
[0077] S260: Write each resource information into the configuration file template of the corresponding business component, obtain the configuration file corresponding to each business component, and write each mirror file and each configuration file into the running container of the corresponding business component.
[0078] Among them, the configuration file refers to the relevant files required for the operation of the business component. Specifically, by writing the resource information into the configuration file template, the configuration file that the component code of each business component depends on during operation is obtained. In other words, the configuration file and the image file are written into the running container of the corresponding business component, so that when the running container runs the component code contained in the configuration file, it can synchronously use the configuration file, thereby completing the operation of the business component. It should be noted that any business component can correspond to one or more running containers, and each running container is used to run an instance of the corresponding business component. The number N of running containers corresponding to the business component can be determined based on the description file, and the PaaS interface can be called based on the number N and the resource information of the resources required for the operation of the business component (the resource information represents the resources required for a running container) to apply for the N resources required for the operation of the business component and initialize the N resources applied for, thereby obtaining N running containers for the business component. For example, according to the description file, the number of running containers N=3 corresponding to a certain business component A is determined. Then, it is necessary to apply for 3 resources for business component A by calling the PaaS interface. After initializing the 3 applied resources respectively, 3 running containers of business component A are obtained. After starting these 3 running containers, each running container runs an instance of business component A.
[0079] Optionally, the Cloud Runtime layer of the delivery engine in the above embodiment can interact with PaaS via the PaaS interface, thereby enabling the application and management of resources required by the ApplicationModel layer. After the Cloud Runtime layer calls the PaaS interface to complete resource application and initialization, the daemon process of the Cloud Runtime layer node can write the resource information to the corresponding configuration file template. In other words, when building the DSP system, the delivery engine applies for required resources through PaaS, and the code repository to be pulled is supported by the remote repository.
[0080] S270: Start the process of each running container to run each business component.
[0081] Specifically, this embodiment starts each business component by starting the process of each running container, thereby completing the startup and operation of each business component included in the DSP system to be built. Optionally, the CloudRuntime layer of the delivery engine in the above embodiment can manage the startup process of the running container of each business component through the Kubernetes open source container cluster management system.
[0082] Considering that the running containers of some business components require database initialization before running, for example, by creating data tables, writing initial data, or preparing reference files, the method may further include, after writing each image file and each configuration file to the running container of the corresponding business component and before starting the process of each running container, reading the installer code of each business component from the parsed results and executing the installer code of each business component to initialize the database used by each business component.
[0083] The installer code may include at least one of a data table creation code, an initial data writing code, and a reference file preparation code. By executing the installer code corresponding to each business component, the creation of the data table, the writing of the initial data, and the preparation of the base file can be achieved.
[0084] In other words, in this embodiment, the element information also includes the installer, and accordingly, the description file is generated based on the pre-configuration of the installer. Specifically, when pre-configuring the description file, it is necessary to describe elements such as the image address, configuration file, API, resource information, and installer. This allows the installer code definition to be retrieved from the parsed results after the description file is parsed. By reading the installer code from the parsed results, this embodiment initializes the database used by each business component, thereby providing initial configuration of each business component's database.
[0085] S280. Register the API description information of each business component in the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0086] The technical solution of this embodiment pre-configures a description file containing resource information and a configuration file template for the DSP system to be constructed, so that according to the parsing results of the description file, resources of each business component can be applied for and configuration files corresponding to the business components can be generated. Then, each business component can be started and run according to the configuration file and the image file, thereby realizing the abstraction of the resources that each business component depends on and reducing the differences in the physical machines and operating systems used to build each business component. At the same time, each business component is started through each running container, effectively reducing the adaptation cost of the underlying complex environment.
[0087] Example 3
[0088] Figure 3 A flowchart of a method for constructing a demand-side platform DSP system provided in Example 3 of the present invention. Based on the above embodiments, this embodiment optionally, after starting the process of each running container, further includes: reading the test case of each business component from the parsing result; executing the test case of each business component, and determining whether each business component is started normally according to the execution result; if not, outputting a notification message of startup abnormality.
[0089] The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 3 The present embodiment provides a method for constructing a demand-side platform (DSP) system, including the following steps:
[0090] S310: When receiving a system construction instruction, obtain a description file corresponding to the DSP system to be constructed.
[0091] S320: Parse the description file, and read the image address information and application programming interface API description information corresponding to each service component included in the DSP system to be constructed from the parsing result.
[0092] S330: Obtain the mirror files corresponding to the respective business components according to the mirror address information.
[0093] S340: Read resource information of resources required for the operation of each business component and a configuration file template of each business component from the parsing result.
[0094] S350: Based on the resource information, the Platform as a Service (PaaS) interface is called to apply for the resources required for the operation of each business component and initialize the applied resources to obtain the operation container of each business component.
[0095] S360: Write each resource information into the configuration file template of the corresponding business component, obtain the configuration file corresponding to each business component, and write each mirror file and each configuration file into the running container of the corresponding business component.
[0096] S370: Start the process of each running container to run each business component.
[0097] S380, reading the test cases of each business component from the parsing result; executing the test cases of each business component, and determining whether each business component is started normally according to the execution result; if not, outputting a startup abnormality notification message.
[0098] Among them, the test case can be used to verify whether the startup status of the business component is correct. Exemplarily, the test case can be a live interface test. If the test passes, it indicates that the startup status of the business component is normal; if the test fails, it indicates that the startup status of the business component is abnormal. The business function corresponding to the business component with an abnormal startup status cannot be used normally. At this time, a startup abnormality notification message can be sent to the management end so that the corresponding developer of the management end can handle the business component. The notification information may include relevant information of the business component with an abnormal startup status, such as the exception type and the business component name.
[0099] That is, based on the above-mentioned implementations, the element information of the business component in this embodiment also includes test cases, and accordingly, the description file also includes descriptions of the test cases. Specifically, when pre-configuring the description file, this embodiment describes elements such as test cases, so as to verify the startup status of the business component based on the test case definitions in the parsing results.
[0100] S390. Register the API description information of each business component in the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0101] The technical solution of this embodiment takes into account the possibility that some business components may have operational errors after startup. By describing the test cases of each business component in advance, it realizes the verification of the startup status after the business component is started, thereby ensuring the normal operation of each business component and further improving the stability of the constructed DSP system.
[0102] Considering that some business components may have normal startup status but fail to process business requests, the test case can only realize the normal startup of the component code process, but cannot determine whether the business component can normally process business requests after normal startup. Therefore, a description of the monitoring code can be introduced in the pre-configured description file to monitor the process of each business component processing business requests. Optionally, after determining that each business component has started normally based on the execution results, the method also includes: reading the monitoring code of each business component from the parsing results; executing the monitoring code of each business component, and determining whether each business component can normally process business requests based on the execution results. If not, outputting a notification message of business processing anomaly.
[0103] The monitoring code can be used to determine whether the activated business component can normally process business requests. Specifically, after executing the monitoring code of each business component, the execution results of each monitoring code can be used to determine whether each business component can normally process business requests. If a business component cannot normally process a business request, a notification message indicating a business processing anomaly can be sent to the management end.
[0104] That is, based on the aforementioned implementations, the service component's element information in this embodiment also includes a monitoring code, and accordingly, the description file also includes a description of the monitoring code. Specifically, this embodiment describes the monitoring code during pre-configuration of the description file, enabling monitoring of the service component's processing of service requests based on the definition of the monitoring code in the parsing results. By monitoring the service component's processing of service requests, this embodiment ensures that the service component can properly process service requests, further improving the stability of the constructed DSP system.
[0105] Optionally, the delivery engine can use the Kubernetes open-source container cluster management system to start the business component's running container and then test the running status of the business component using the test cases in the business component's description file. The delivery engine can also use Kubernetes to test the running status of the business component based on the test cases. If the business component is in a normal operating state, the delivery engine will use the monitoring process to monitor the component's business, thereby determining whether each business component can normally process service requests.
[0106] Optionally, execute the monitoring code of each business component and determine whether each business component can process the business request normally based on the execution result, including: simulating the call of the interface in each business component by executing the monitoring code of each business component, and determining whether each business component can process the business request normally by comparing the actual return result of the called interface with the expected result.
[0107] Among them, the actual return result may include the actual response result of the interface in the business component of the simulated call; the expected result may include the expected effect of the interface in the business component of the simulated call. For example, the monitoring code simulates the call to the interface API-D of the business component, the expected result is to delete the file a, and the actual return result is not deleted. That is, when the actual return result of calling the interface is inconsistent with the expected result, it indicates that the business component cannot process the business request normally. Alternatively, the actual return result may also include the actual call time of the interface; the expected result may also include the expected call time of the interface. In one embodiment, a time difference threshold can be set in advance. When the time difference between the actual call time and the expected call time does not exceed the time difference threshold, and the actual return result is consistent with the expected result, it is determined that the business component can process the business request normally.
[0108] Optionally, after starting the processes of the running containers, the method further includes: reading the business attributes of each business component from the parsing result, and adjusting the component attributes of each business component based on the business attributes of each business component.
[0109] Among them, business attributes can be used to set the switches of business functions of business components, for example, to turn on or off certain business functions of business components; they can also be used to set the associated thresholds of business functions of business components; for example, for the business function of uploading files, the upload threshold can be adjusted from 100M to 1G, or the upload threshold can be set to 5M for ordinary users and 100M for VIP customers.
[0110] That is, in this embodiment, based on the above-mentioned embodiment, the element information also includes business attributes, and accordingly, the description file also includes a description of the business attributes. Specifically, when pre-configuring the description file, the business attributes are described so that the component processing logic of the business component can be adjusted based on the definition of the business attributes in the parsing results, making the business component more adaptable and able to meet more practical user needs. The purpose of describing the business attributes of the business component is to expose a series of relevant attributes of the business component to the outside world, and to enable on-demand customization of the business services of the business component by setting linkage feature switches through the attributes.
[0111] In a preferred embodiment, the essential information of the service component includes the image address, configuration file, resources, test cases, monitoring code, installer, API, and service attributes; accordingly, the parsing result of the description file includes the definition of the image address information, configuration file template, resource information, test cases, monitoring code, API description information, and service attributes. After reading the image address information, configuration file template, resource information, test cases, monitoring code, API description information, and service attributes from the parsing result, the steps for building the DSP system are as follows:
[0112] (1) Determine the configuration file through the configuration file template and resource information; (2) Call the PaaS interface through the resource information to apply for the corresponding resources and initialize the applied resources to obtain the running container of each business component; (3) Write the image file and configuration file into the running container; (4) Initialize the database used by the business component through the installer code; (5) Start the process of the running container of each business component; (6) Register the API description of each business component to the preset gateway module; (7) Execute the test case of each business component to determine whether each business component is started normally; (8) After the business component is started normally, execute the monitoring code of the business component to determine whether the business component can process the business request normally; (9) Adjust the component properties of each business component based on the business properties of each business component.
[0113] That is, by using a description file to describe a DSP system to be built, which contains the definitions of modules, components, resources and business attributes; the business component opens the mirror address, configuration file, resources, test cases, monitoring code, installer, API and related configuration of attributes. Through the relevant definitions of the description document, the self-description of the business component can be achieved.
[0114] Example 4
[0115] Figure 4A A flowchart of a method for constructing a demand-side platform DSP system is provided in the fourth embodiment of the present invention. Based on the above embodiments, this embodiment optionally, after starting to run each business component based on each mirror file, further includes: collecting log files generated during the operation of each business component; monitoring the traffic of each business component based on the log files, and saving the traffic monitoring results.
[0116] The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 4A The present embodiment provides a method for constructing a demand-side platform (DSP) system, including the following steps:
[0117] S410 : Upon receiving a system construction instruction, obtaining a description file corresponding to the DSP system to be constructed.
[0118] S420: Parse the description file, and read the mirror address information and application programming interface API description information corresponding to each service component included in the DSP system to be constructed from the parsed result.
[0119] S430: Obtain the mirror files corresponding to the respective business components according to the mirror address information.
[0120] S440: Read resource information of resources required for the operation of each business component and a configuration file template of each business component from the parsing result.
[0121] S450: Based on the resource information, the Platform as a Service (PaaS) interface is called to apply for the resources required for the operation of each business component and initialize the applied resources to obtain the operation container of each business component.
[0122] S460: Write each resource information into the configuration file template of the corresponding business component, obtain the configuration file corresponding to each business component, and write each mirror file and each configuration file into the running container of the corresponding business component.
[0123] S470: Start the process of each running container to run each business component.
[0124] S480. Register the API description information of each business component in the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0125] S490: Collect log files generated when each business component is running; monitor the traffic of each business component based on the log files, and save the traffic monitoring results.
[0126] Specifically, traffic monitoring of each business component is performed based on log files, including at least one of the following: counting the total number of business requests received by the business component; counting the total number of business requests processed by the business component; counting the number of calls to each business service (API) in the business component.
[0127] In one embodiment, business monitoring of business components can also be implemented based on traffic monitoring results, that is, pre-set business services in business components are monitored. In one embodiment, a preset call threshold can be set for the pre-set business service, and when the actual number of calls to the pre-set business service exceeds the preset call threshold, it is determined that the business service is in an abnormal usage state. The present application does not limit the specific value of the preset call threshold, for example, it can be determined based on the regular number of uses of the business service. Exemplarily, the preset business service is uploading files (API-A), and the preset call threshold is 1000. When the actual number of calls exceeds 1000, the uploaded file is considered to be in an abnormal usage state, and an alarm notification can be sent to the management end.
[0128] Optionally, the Cloud Runtime layer in the delivery engine can provide log collection services and monitoring services. The monitoring services include traffic monitoring services and business monitoring services. The log collection service can be used to collect log files generated by each business component during operation; the traffic monitoring service is used to monitor the traffic of each business component based on the log files; and the business monitoring service is used to monitor the pre-defined business services in each business component. For example, Figure 4B The figure shows a structural diagram of a delivery engine. The Cloud Runtime layer of the delivery engine provides log collection and monitoring services. The log collection service collects log files of business components.
[0129] The technical solution of this embodiment collects the log files generated by each business component during operation after starting each business component based on each mirror file, thereby realizing traffic monitoring of the business component, so as to facilitate viewing, statistics and analysis of relevant data of the business component. Furthermore, the analysis, adjustment and maintenance of the business components are realized, ensuring the stability of the operation of each business component and greatly improving the user experience.
[0130] Optionally, the method further includes: determining whether it is necessary to increase or decrease the running container of the corresponding business component based on the traffic monitoring results of each business component; for the business component that needs to increase the running container, applying for new resources required for the operation of the business component and initializing the applied new resources to obtain a new running container for the business component; writing the image file and configuration file of the business component into the new running container, and starting the process of the new running container; for the business component that needs to reduce the running container, closing the existing running container of the business component.
[0131] Specifically, based on the traffic monitoring results of each business component, it is determined whether it is necessary to increase or decrease the running container of the corresponding business component, including: determining whether it is necessary to increase or decrease the running container of the corresponding business component based on the number of business requests received by each business component. In an optional embodiment, a minimum receiving threshold and a maximum receiving threshold can be pre-set for each business component. When the number of business requests received by the business component reaches the maximum receiving threshold, it is determined that the running container of the business component needs to be increased; when the number of business requests received by the business component does not exceed the minimum receiving threshold, it is determined that the running container of the business component needs to be reduced. This application does not limit the specific values of the minimum receiving threshold and the maximum receiving threshold. For example, the minimum receiving threshold can be 10 and the maximum receiving threshold can be 300.
[0132] It should be noted that for business components that need to add running containers, you can call the PaaS interface to apply for new resources for the business component and initialize the new resources to obtain a new running container for the business component. For business components that need to reduce running containers, you can also call the PaaS interface to shut down the existing running container of the business component.
[0133] In this embodiment, the running container of the business component is adjusted through the traffic monitoring results, thereby realizing the implementation of the automatic control strategy of the running container, automatically completing the automatic expansion and contraction of the business component, and thus adjusting the resources of the business component in real time, further ensuring the rational use of resources.
[0134] In one embodiment, the Cloud Runtime layer in the delivery engine can provide component management services and resource management services. Component management services include but are not limited to automatic scaling services, which can adjust the running containers of business components based on traffic monitoring results. Resource management services can call PaaS interfaces to complete the application of resources required by each business component. For example, Figure 4B As shown in Figure 1, the Cloud Runtime layer provides component management services and resource management services.
[0135] Example 5
[0136] Figure 5A A flowchart of a method for constructing a demand-side platform DSP system provided in Example 5 of the present invention. Based on the above embodiments, this embodiment optionally further includes: when an upgrade instruction for a business component is received, obtaining a new description file of the business component to be upgraded from the management end according to the upgrade instruction; reading new image address information and new API description information of the business component to be upgraded from the new description file; obtaining a new image file corresponding to the business component to be upgraded according to the new image address information, replacing the existing image file in the running container of the business component to be upgraded with the new image file, restarting the process of the running container of the business component to be upgraded, and replacing the existing API description information of the business component to be upgraded in the preset gateway module with the new API description information.
[0137] The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 5A The present embodiment provides a method for constructing a demand-side platform (DSP) system, including the following steps:
[0138] S501: Upon receiving a system construction instruction, obtain a description file corresponding to the DSP system to be constructed.
[0139] S502: Parse the description file, and read the mirror address information and application programming interface (API) description information corresponding to each service component included in the DSP system to be constructed from the parsed result.
[0140] S503: Obtain the mirror files corresponding to the respective business components according to the mirror address information.
[0141] S504: Read resource information of resources required for the operation of each business component and configuration file template of each business component from the parsing result.
[0142] S505 : Based on the resource information, the Platform as a Service (PaaS) interface is called to apply for the resources required for the operation of each business component and initialize the applied resources to obtain the operation container of each business component.
[0143] S506 , writing each resource information into the configuration file template of the corresponding business component, obtaining the configuration file corresponding to each business component, and writing each mirror file and each configuration file into the running container of the corresponding business component.
[0144] S507: Start the process of each running container to run each business component.
[0145] S508. Register the API description information of each business component in the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0146] S509: When receiving the upgrade instruction of the business component, obtain a new description file of the business component to be upgraded from the management end according to the upgrade instruction; read the new image address information and new API description information of the business component to be upgraded from the new description file.
[0147] The upgrade instruction for the business component may be generated based on a user's operation or automatically issued by the management end. For example, the upgrade instruction may be automatically issued by the management end after the component code of the business component is updated, or the upgrade instruction may be automatically issued by the management end after the configuration file template of the business component is updated.
[0148] In other words, the management end configures a corresponding new description file for the service component to be upgraded in advance; obtains the new description file of the service component to be upgraded from the management end through the upgrade instruction, and obtains the corresponding new image address information and new API description information.
[0149] S510. Obtain a new image file corresponding to the business component to be upgraded according to the new image address information, replace the existing image file in the running container of the business component to be upgraded with the new image file, restart the process of the running container of the business component to be upgraded, and replace the existing API description information of the business component to be upgraded in the preset gateway module with the new API description information.
[0150] Specifically, when a new image file and new API description information are obtained, the new image file is written into the running container corresponding to the business component to be upgraded, thereby replacing the existing image file, and restarting the process of the running container of the business component to be upgraded; at the same time, the API description information of the business component to be upgraded registered in the preset gateway module is replaced with the new API description information, thereby realizing dynamic upgrade of the business component.
[0151] The technical solution of this embodiment obtains a new description file of the business component to be upgraded from the management end, obtains new mirror address information and new API description information based on the new description file, and then dynamically upgrades the existing business components in the DSP system, thereby realizing real-time updates of the business services contained in the business components, thereby improving the flexibility of the business components in the DSP system.
[0152] Optionally, the method further includes: upon receiving a display instruction corresponding to a business component, visually displaying the data generated when the business component is running. The data generated when the business component is running includes but is not limited to data in log files, traffic monitoring result data, status data of the business component, and the number of running containers of the business component. The business component is not limited to generating the above-mentioned types of data when it is running. Any visual data generated when the business component is running can be displayed. It should be noted that this application does not limit the display method of the data generated when the business component is running. For example, it can be displayed in any format such as a chart, a line chart, a curve chart or a data table.
[0153] In one embodiment, the Cloud Runtime layer in the delivery engine can also provide a dashboard service, and the component management service provided by the Cloud Runtime layer also includes a dynamic upgrade service. The dashboard service is used to visualize the data generated by the Cloud Runtime layer, that is, to visualize the data generated when the business component is running; the dynamic upgrade service is used to obtain a new description file of the business component to be upgraded from the management end, so that the Application Model layer in the delivery engine can parse the new description file, and the Cloud Runtime layer calls the PaaS interface to apply for the resources corresponding to the new scan file, thereby completing the dynamic upgrade of the business component. For example, Figure 4BAs shown, AD Cloud Master is the management end, and the component management service obtains the new description file of the business component to be upgraded from the management end.
[0154] Optionally, the construction method of the demand-side platform DSP system in the above-mentioned embodiments also includes: when receiving an instruction to add a business component, interacting with the management end to determine whether it has the authority to add a new business component; if so, obtaining the description file of the new business component issued by the management end, and reading the mirror address information and API description information of the new business component from the description file of the new business component; obtaining the mirror file corresponding to the new business component according to the mirror address information of the new business component, starting to run the new business component based on the mirror file corresponding to the new business component, and registering the API description information of the new business component to the preset gateway module.
[0155] The instruction to add a business component can be generated based on a user operation. For example, a user triggers a corresponding control to add a business component. Optionally, interaction with the management end is performed to determine whether permission to add a new business component is granted, including obtaining verification information from the management end regarding authorization information. If the verification passes, permission to add the new business component is granted; if the verification fails, permission to add the new business component is denied.
[0156] For example, when receiving the instruction to add a business component, a license authorization verification request is sent to the management end, and the management end obtains the verification information of the license authorization. If the management end passes the verification of the license authorization, the description file of the new business component issued by the management end is obtained.
[0157] In one embodiment, the image address information, configuration file template, API description information, test cases, resource information, monitoring code, installer code and business attributes of the new business component are read from the parsing results of the description file of the new business component, thereby completing the construction, deployment and verification of the entire DSP system.
[0158] This embodiment obtains the description file of the new business component issued by the management end, reads the mirror address information and API description information of the new business component from the description file of the new business component to start running the new business component, thereby realizing the dynamic addition of business components in the DSP system and thus realizing the extended installation of value-added services.
[0159] In one embodiment, the component management service provided by the Cloud Runtime layer in the delivery engine also includes a component addition service. The component addition service is used to interact with the management end to determine whether it has the authority to add a new business component when receiving an instruction to add a business component; if so, it obtains the description file of the new business component issued by the management end. For example, Figure 4B As shown in the figure, the newly added component service can interact with the management end. Optionally, the node end in the CloudRuntime layer can interact with the management end and obtain the description file of the new business component issued by the management end. After receiving the description file, the node end completes the installation and initialization of the new business component.
[0160] The following is an explanation of the principle of building a DSP system based on a payment engine. Figure 5B As shown in the figure, the schematic diagram of building a DSP system is presented. Among them, the delivery engine provides log collection services, component management services, resource management services, monitoring services and dashboard services. The delivery engine reads the description file and parses the description file into each component model Ada-model. According to the definition of each component model, it calls the underlying PaaS to complete resource application, component deployment, configuration, initialization, operation, testing and monitoring in sequence. After the user completes the installation of the DSP system, if the business component needs to be upgraded or the running container needs to be added or deleted later, the developer can receive the component code of the business component or the modified description file of the running container through the delivery engine, and replace the business component or add or delete the running container according to the corresponding control instructions. If a new value-added business component needs to be installed later, the delivery engine can also be connected to the management end, obtain authorization, and obtain the component model of the business component, and initialize the installation and configuration of the new business component according to the component model to complete the customized installation of the value-added business component. In addition, as Figure 5B As shown, the interactive engine can also interact and / or integrate with the enterprise system to provide the enterprise system with various business services included in the built DSP system.
[0161] Example 6
[0162] Figure 6 This is a schematic diagram of the structure of a device for constructing a demand-side platform (DSP) system, provided in accordance with Embodiment 6 of the present invention. This embodiment is applicable to constructing a DSP system based on actual user needs, and is particularly applicable to starting and running each service component of the DSP system according to the corresponding description file of the DSP system and registering the API description information of each service component. The device specifically includes: a file acquisition module 610, a file parsing module 620, a component startup module 630, and an API registration module 640.
[0163] The file acquisition module 610 is used to acquire the description file corresponding to the DSP system to be constructed upon receiving the system construction instruction;
[0164] The file parsing module 620 is used to parse the description file and read the image address information and application programming interface API description information corresponding to each service component included in the DSP system to be built from the parsing result;
[0165] The component startup module 630 is used to obtain the image files corresponding to each business component according to each image address information, and start running each business component based on each image file;
[0166] The API registration module 640 is used to register the API description information of each business component into the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0167] In this embodiment, upon receiving a system construction instruction, the file acquisition module obtains a description file corresponding to the DSP system to be constructed, and the file parsing module parses the description file. The image address information and application programming interface API description information corresponding to each business component included in the DSP system to be constructed are read from the parsed result. The component startup module obtains the image files corresponding to each business component based on each image address information, and starts running each business component based on each image file. The API registration module registers the API description information of each business component with the preset gateway module, so that the preset gateway module can determine the corresponding target business component when receiving a business request and forward the business request to the target business component. This solution realizes the automatic deployment of the DSP system based on the description file, thereby greatly reducing the customization cost of the DSP system. In addition, since the description file corresponding to the DSP system to be constructed can be configured according to the actual needs of the user, it is possible to build a customized DSP based on the actual needs of the user.
[0168] Optionally, the component startup module 630 includes a reading unit, an initialization unit, a writing unit, and a startup unit:
[0169] A reading unit, used to read resource information of resources required for the operation of each business component and configuration file templates of each business component from the parsing results;
[0170] The initialization unit is used to call the Platform as a Service (PaaS) interface based on the resource information to apply for the resources required for the operation of each business component and initialize the applied resources to obtain the operating container of each business component;
[0171] A writing unit is used to write each resource information into the configuration file template of the corresponding business component, obtain the configuration file corresponding to each business component, and write each mirror file and each configuration file into the running container of the corresponding business component;
[0172] The startup unit is used to start the process of each running container to run each business component.
[0173] Optionally, the component startup module 630 also includes an initialization unit, which is used to read the installer code of each business component from the parsing result after writing each image file and each configuration file into the running container of the corresponding business component and before starting the process of each running container; and execute the installer code of each business component to initialize the database used by each business component.
[0174] Optionally, the component startup module 630 also includes a startup detection unit, which is used to read the test cases of each business component from the parsing results after starting the process of each running container; execute the test cases of each business component, and determine whether each business component is started normally based on the execution results; if not, output a startup abnormality notification message.
[0175] Optionally, the construction device of the demand-side platform DSP system also includes a processing monitoring module, which is used to read the monitoring code of each business component from the parsing result after the startup detection unit determines that each business component is started normally according to the execution result; execute the monitoring code of each business component, and determine whether each business component can process the business request normally according to the execution result. If not, output notification information of business processing abnormality.
[0176] Optionally, the processing monitoring module is specifically used to simulate calling the interface in each business component by executing the monitoring code of each business component, and to determine whether each business component can process the business request normally by comparing the actual return result of the calling interface with the expected result.
[0177] Optionally, the construction device of the demand-side platform DSP system also includes a log collection module and a traffic monitoring module; wherein the log collection module is used to collect the log files generated during the operation of each business component after starting to run each business component based on each mirror file; the traffic monitoring module is used to monitor the traffic of each business component based on the log file and save the traffic monitoring results.
[0178] Optionally, the construction device of the demand-side platform DSP system also includes a container addition and deletion module, which is used to determine whether it is necessary to increase or decrease the running containers of the corresponding business components based on the traffic monitoring results of each business component; for business components that need to add running containers, apply for new resources required for the operation of the business components and initialize the applied new resources to obtain a new running container for the business component; write the image file and configuration file of the business component into the new running container, and start the process of the new running container; for business components that need to reduce the running containers, close the existing running containers of the business components.
[0179] Optionally, the construction device of the demand-side platform DSP system also includes a component upgrade module, which is used to obtain a new description file of the business component to be upgraded from the management end according to the upgrade instruction when receiving the upgrade instruction of the business component; read the new image address information and new API description information of the business component to be upgraded from the new description file; obtain the new image file corresponding to the business component to be upgraded according to the new image address information, replace the existing image file in the running container of the business component to be upgraded with the new image file, restart the process of the running container of the business component to be upgraded, and replace the existing API description information of the business component to be upgraded in the preset gateway module with the new API description information.
[0180] Optionally, the API description information includes a correspondence between the API name contained in the corresponding business component and the uniform resource locator URL address; accordingly, the API registration module 640 is used to determine the API corresponding to the URL address contained in the business request as the target API based on the correspondence when the preset gateway module receives a business request, or to determine the default API pre-configured for the domain name as the target API based on the domain name contained in the business request; determine the business component where the target API is located as the target business component, and forward the business request to the target business component.
[0181] Optionally, the construction device of the demand-side platform DSP system also includes a component addition module, which is used to interact with the management end to determine whether it has the authority to add a new business component when receiving an instruction to add a business component; if so, obtain the description file of the new business component issued by the management end, read the mirror address information and API description information of the new business component from the description file of the new business component; obtain the mirror file corresponding to the new business component according to the mirror address information of the new business component, start running the new business component based on the mirror file corresponding to the new business component, and register the API description information of the new business component in the preset gateway module
[0182] The device for constructing a demand-side platform DSP system provided in an embodiment of the present invention can execute the method for constructing a demand-side platform DSP system provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0183] It is worth noting that the various units and modules included in the above system are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the embodiments of the present invention.
[0184] Example 7
[0185] Figure 7 This is a structural diagram of an electronic device provided in Example 7 of the present invention. Figure 7 A block diagram of an exemplary electronic device 12 suitable for implementing embodiments of the present invention is shown. Figure 7 The electronic device 12 shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention. The device 12 is typically an electronic device that performs the construction function of the DSP system.
[0186] like Figure 7 As shown, the electronic device 12 is implemented as a general-purpose computing device. Components of the electronic device 12 may include, but are not limited to, one or more processors or processing units 16, a memory 28, and a bus 18 connecting the various components (including the memory 28 and the processing unit 16).
[0187] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0188] The electronic device 12 typically includes a variety of computer-readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0189] The memory 28 may include computer-readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer storage media. By way of example only, the storage device 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 7 Not shown, often called a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a Compact Disc-Read Only Memory (CD-ROM), a Digital Video Disc-Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product 40 having a set of program modules 42 configured to perform the functions of various embodiments of the present invention. The program product 40 may be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0190] The electronic device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, mouse, camera, etc., and a display), one or more devices that enable a user to interact with the electronic device 12, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). This communication can occur via an input / output (I / O) interface 22. Furthermore, the electronic device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the electronic device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Arrays of Independent Disks (RAID) devices, tape drives, and data backup storage devices.
[0191] The processor 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing the method for constructing the demand-side platform DSP system provided in the above embodiment of the present invention, including:
[0192] Upon receiving the system building instruction, obtain the description file corresponding to the DSP system to be built;
[0193] Parse the description file and read the image address information and application programming interface API description information corresponding to each business component included in the DSP system to be built from the parsed results;
[0194] Obtain the image files corresponding to each business component according to each image address information, and start running each business component based on each image file;
[0195] The API description information of each business component is registered in the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0196] Of course, those skilled in the art will appreciate that the processor may also implement the technical solution of the method for constructing the demand-side platform DSP system provided in any embodiment of the present invention.
[0197] Example 8
[0198] Embodiment 8 of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the method for constructing a demand-side platform DSP system as provided in any embodiment of the present invention are implemented. The method includes:
[0199] Upon receiving the system building instruction, obtain the description file corresponding to the DSP system to be built;
[0200] Parse the description file and read the image address information and application programming interface API description information corresponding to each business component included in the DSP system to be built from the parsed results;
[0201] Obtain the image files corresponding to each business component according to each image address information, and start running each business component based on each image file;
[0202] The API description information of each business component is registered in the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
[0203] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an 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 this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0204] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries 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 that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0205] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0206] The computer program code for performing the operations of the embodiments of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate 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 can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0207] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for constructing a demand-side platform DSP system, characterized in that: include: Upon receiving the system building instruction, obtain the description file corresponding to the DSP system to be built; Parsing the description file, and reading the mirror address information and application programming interface API description information corresponding to each service component included in the DSP system to be constructed from the parsing result; Obtaining the mirror files corresponding to the business components according to the mirror address information, and starting and running the business components based on the mirror files; The API description information of each business component is registered in a preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
2. The method according to claim 1, characterized in that Starting and running each of the business components based on each of the image files includes: Reading resource information of resources required for the operation of each business component and a configuration file template of each business component from the parsing result; Based on the resource information, a Platform as a Service (PaaS) interface is called to apply for resources required for the operation of each business component and initialize the applied resources to obtain a running container for each business component; Writing each resource information into a configuration file template of a corresponding business component, obtaining a configuration file corresponding to each business component, and writing each mirror file and each configuration file into a running container of the corresponding business component; Start the process of each running container to run each business component.
3. The method according to claim 2, characterized in that After writing each of the image files and each of the configuration files into the running container of the corresponding business component and before starting the process of each of the running containers, the method further includes: Reading the installer code of each of the business components from the parsing result; The installer code of each business component is executed to initialize the database used by each business component.
4. The method according to claim 2, characterized in that After starting the process of each running container, the method further includes: Reading the test cases of each of the business components from the parsing results; Execute the test cases of each of the business components and determine whether each of the business components is started normally according to the execution results; if not, output a notification message of startup abnormality.
5. The method according to claim 4, characterized in that After determining that each of the service components is started normally according to the execution result, the method further includes: Reading the monitoring code of each business component from the parsing result; The monitoring code of each business component is executed, and whether each business component can normally process the business request is determined according to the execution result. If not, notification information of business processing abnormality is output.
6. The method according to claim 5, characterized in that Executing the monitoring code of each of the business components and determining whether each of the business components can normally process the business request based on the execution result, including: By executing the monitoring code of each business component to simulate calling the interface in each business component, and by comparing the actual return result of calling the interface with the expected result, it is determined whether each business component can normally process the business request.
7. The method according to claim 2, characterized in that After starting and running each of the service components based on each of the image files, the method further includes: Collect log files generated when each business component is running; Traffic flow of each of the service components is monitored based on the log file, and the traffic flow monitoring result is saved.
8. The method according to claim 7, characterized in that The method further comprises: Determine whether to increase or decrease the number of running containers of the corresponding business components based on the traffic monitoring results of the business components; For business components that require an additional running container, apply for new resources required for the business component to run and initialize the new resources to obtain a new running container for the business component; write the image file and configuration file of the business component into the new running container, and start the process of the new running container; For a business component that needs to reduce the number of running containers, the existing running containers of the business component are closed.
9. The method according to claim 2, characterized in that The method further comprises: Upon receiving an upgrade instruction for a service component, obtaining a new description file of the service component to be upgraded from the management terminal according to the upgrade instruction; Read the new image address information and new API description information of the service component to be upgraded from the new description file; According to the new image address information, obtain the new image file corresponding to the business component to be upgraded, replace the existing image file in the running container of the business component to be upgraded with the new image file, restart the process of the running container of the business component to be upgraded, and replace the existing API description information of the business component to be upgraded in the preset gateway module with the new API description information.
10. The method according to claim 1, characterized in that The API description information includes the corresponding relationship between the API name contained in the corresponding business component and the uniform resource locator URL address; The preset gateway module determines a target service component for processing the service request based on the registered API description information when receiving the service request, and forwards the service request to the target service component, including: When receiving a service request, the preset gateway module determines, according to the corresponding relationship, an API corresponding to the URL address included in the service request as the target API, or, according to the domain name included in the service request, determines a default API pre-configured for the domain name as the target API; The business component where the target API is located is determined as the target business component, and the business request is forwarded to the target business component.
11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: When receiving an instruction to add a business component, it interacts with the management end to determine whether it has the authority to add a new business component; If yes, obtain the description file of the new business component issued by the management end, and read the mirror address information and API description information of the new business component from the description file of the new business component; The mirror file corresponding to the new business component is obtained according to the mirror address information of the new business component, the new business component is started based on the mirror file corresponding to the new business component, and the API description information of the new business component is registered in the preset gateway module.
12. A device for constructing a demand-side platform DSP system, characterized in that: include: The file acquisition module is used to obtain the description file corresponding to the DSP system to be built when receiving the system construction instruction; A file parsing module is used to parse the description file and read the image address information and application programming interface API description information corresponding to each business component included in the DSP system to be constructed from the parsing result; A component startup module, configured to obtain the image files corresponding to the service components according to the image address information, and start running the service components based on the image files; The API registration module is used to register the API description information of each business component into the preset gateway module, so that when the preset gateway module receives a business request, it determines the target business component for processing the business request based on the registered API description information and forwards the business request to the target business component.
13. An electronic device, characterized in that: The device comprises: one or more processors; a memory 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 constructing a demand-side platform DSP system as described in any one of claims 1-11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for constructing a demand-side platform DSP system as described in any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Service node control method and related equipment
CN110995473A
Virtual machine starting method and device, computer readable storage medium and electronic equipment
CN111090498A