A service arrangement method and electronic device

By encapsulating the configuration information of the executor and its dependencies in the microservice architecture, the decoupling of subservices is achieved, which solves the problems of complex subservice call logic and high coupling, and improves the development and maintenance efficiency of the system.

CN114860333BActive Publication Date: 2024-11-29HISENSE VISUAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210443836.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-25
Publication Date
2024-11-29
Estimated Expiration
2042-04-25

AI Technical Summary

Technical Problem

In a microservice architecture, the calling logic of subservices is usually hard-coded, which increases system complexity and coupling, making it difficult to develop and maintain quickly.

Method used

By encapsulating the executor of the sub-service and its dependencies in the configuration information, users can manage the addition and modification of sub-services through the configuration information and determine the query results based on external query requests, thereby achieving decoupling of sub-services.

Benefits of technology

By configuring sub-services independently using configuration information, the problem of excessive coupling of sub-service call logic within services is solved, thus improving development and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860333B_ABST
    Figure CN114860333B_ABST
Patent Text Reader

Abstract

The present disclosure provides a service orchestration method and an electronic device, which relates to the field of system architecture technology, in order to at least solve the problem of multiple coupling of the calling logic of sub-services in the service in the related technology. The electronic device comprises: an electronic device, comprising: a communicator and a processor; the processor is configured to: determine at least one executor for executing a first sub-service and the dependency relationship between each executor according to the configuration information received by the communicator; the communicator is also configured to: receive external query information; the processor is also configured to: determine the first sub-service corresponding to the external query information according to the external query information received by the communicator; the processor is also configured to: determine the query result of the external query information according to at least one executor for executing the first sub-service, the dependency relationship between each executor in the at least one executor and the external query information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of system architecture, and in particular to a service orchestration method and an electronic device. Background Art

[0002] In the microservice architecture, the application system is decomposed into multiple sub-services, so it is necessary to call each sub-service to collaborate and process the complete business process. However, at present, the calling logic of sub-services is basically hard-coded. As the system continues to iterate and upgrade, the business process becomes more and more complex, resulting in more complex calling logic between sub-services and more coupling, which is not conducive to rapid development, maintenance and business monitoring. Summary of the invention

[0003] The present disclosure provides a service orchestration method and an electronic device to at least solve the problem of multiple coupling of sub-service calling logic in the service in the related art.

[0004] The technical solution of the present disclosure is as follows:

[0005] In a first aspect, the present disclosure provides an electronic device, comprising: a communicator and a processor; the communicator is configured to: receive configuration information of a first sub-service; the processor is configured to: determine at least one executor that executes the first sub-service, and the dependency relationship between each executor based on the configuration information received by the communicator; wherein the dependency relationship is used to indicate the order in which different executors run; the communicator is also configured to: receive external query information; the processor is also configured to: determine the first sub-service corresponding to the external query information based on the external query information received by the communicator; the processor is also configured to: determine the query result of the external query information based on at least one executor that executes the first sub-service, the dependency relationship between each executor in the at least one executor and the external query information.

[0006] In some implementable examples, the external query information includes query parameters; the processor is further configured to: create a global data container for storing the query parameters and the output results of each executor; the processor is specifically configured to: for the first executor executing the first sub-service, perform the following operations: generate output results according to the external query information received by the communicator, and store them in the global data container; the processor is specifically configured to: for other executors executing the first sub-service except the first executor, perform the following operations: according to the dependency relationship between each executor in at least one executor, obtain the output result of the previous executor from the global data container, generate updated output results according to the output results, and store them in the global data container; the processor is specifically configured to: according to the dependency relationship between each executor in at least one executor, obtain the output result output by the last executor from the global data container; the processor is specifically configured to: determine that the query result of the external query information is the output result of the last executor output obtained in the global data container.

[0007] In some feasible examples, the global data container includes a KV container.

[0008] In some feasible examples, the configuration information includes at least one identification code, and one identification code corresponds to one executor; the processor is specifically configured to: determine at least one executor that executes the first sub-service and the dependency relationship between each executor according to the identification code.

[0009] In some feasible examples, the processor is specifically configured to: determine, based on a dependency relationship between each of the at least one executor, that each of the at least one executor that executes the first sub-service runs the external query information received by the communicator in parallel to execute at least one executor of the first sub-service.

[0010] In some implementable examples, an executor includes one or more execution components, which are used to execute the business logic of the executor; the processor is further configured to: initialize the execution component of each executor; the processor is specifically configured to: after determining that the execution components of each executor are initialized based on the dependency relationship between each executor in at least one executor, determine the query result of the external query information based on the external query information received by at least one executor and the communicator that executes the first sub-service.

[0011] In a second aspect, the present disclosure provides a service orchestration method, including: receiving configuration information of a first sub-service; determining, based on the configuration information, at least one executor that executes the first sub-service, and the dependency relationship between each executor; wherein the dependency relationship is used to indicate the order in which different executors run; receiving external query information; determining, based on the external query information, a first sub-service corresponding to the external query information; and determining a query result of the external query information based on at least one executor that executes the first sub-service, the dependency relationship between each executor in the at least one executor, and the external query information.

[0012] In some implementable examples, the external query information includes query parameters; before receiving the external query information, the service orchestration method provided by the present disclosure also includes: creating a global data container for storing query parameters and output results of each executor; determining the query result of the external query information according to at least one executor executing the first sub-service, the dependency relationship between each executor in at least one executor, and the external query information, including: for the first executor executing the first sub-service, performing the following operations: generating output results according to the external query information, and storing them in the global data container; for other executors executing the first sub-service except the first executor, performing the following operations: obtaining the output result of the previous executor from the global data container according to the dependency relationship between each executor in at least one executor, generating updated output results according to the output results, and storing them in the global data container; obtaining the output result of the last executor output from the global data container according to the dependency relationship between each executor in at least one executor; determining that the query result of the external query information is the output result of the last executor output obtained in the global data container.

[0013] In some feasible examples, the global data container includes a KV container.

[0014] In some feasible examples, the configuration information includes at least one identification code, and one identification code corresponds to one executor; based on the configuration information, at least one executor that executes the first sub-service and the dependency relationship between each executor are determined, including: based on the identification code, at least one executor that executes the first sub-service and the dependency relationship between each executor are determined.

[0015] In some feasible examples, based on at least one executor that executes the first sub-service, the dependency relationship between each executor in the at least one executor and the external query information, determining the query result of the external query information includes: based on the dependency relationship between each executor in the at least one executor, determining that each executor in the at least one executor that executes the first sub-service runs the external query information in parallel and executes at least one executor of the first sub-service.

[0016] In some implementable examples, an executor includes one or more execution components, and the execution components are used to execute the business logic of the executor; before receiving external query information, the service orchestration method provided by the present disclosure also includes: initializing the execution component of each executor; determining the query result of the external query information based on at least one executor that executes the first sub-service, the dependency relationship between each executor in at least one executor, and the external query information, including: after determining that the execution components of each executor are initialized based on the dependency relationship between each executor in at least one executor, determining the query result of the external query information based on at least one executor that executes the first sub-service and the external query information.

[0017] In a third aspect, the present invention provides a computer-readable storage medium, comprising instructions. When the instructions are executed on a computer, the computer is caused to execute the service orchestration method provided in the second aspect.

[0018] In a fourth aspect, the present invention provides a computer program product. When the computer program product runs on a computer, the computer executes the service orchestration method designed in the second aspect.

[0019] It should be noted that the above computer instructions may be stored in whole or in part on the first computer-readable storage medium, wherein the first computer-readable storage medium may be packaged together with the processor of the electronic device, or may be packaged separately from the processor of the electronic device, which is not limited in the present invention.

[0020] The description of the second, third and fourth aspects of the present invention can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third and fourth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.

[0021] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0022] The executors for executing the first sub-service and the dependency relationship between each executor can be encapsulated in the configuration information. In this way, when the user adds a new first sub-service or modifies the first sub-service, the user can use the configuration information to add the new first sub-service or modify the first sub-service. Furthermore, when an external query request is received, the corresponding first sub-service can be determined according to the external query request. Thereafter, the query result of the external query information is determined according to at least one executor for executing the first sub-service, the dependency relationship between each executor in at least one executor, and the external query information. It can be seen that different first sub-services can be independently configured by means of configuration information, so that different first sub-services can be decoupled, solving the problem of multiple coupling of the calling logic of sub-services in the service in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0025] Figure 1 A schematic diagram of a scenario of a service orchestration method provided in an embodiment of the present application;

[0026] Figure 2 One of the structural schematic diagrams of the display device in the service arrangement method provided in the embodiment of the present application;

[0027] Figure 3 The second structural diagram of the display device in the service arrangement method provided in the embodiment of the present application;

[0028] Figure 4 One of the flow charts of the service orchestration method provided in the embodiment of the present application;

[0029] Figure 5 The second scenario diagram of the service orchestration method provided in the embodiment of the present application;

[0030] Figure 6 The third scenario diagram of the service orchestration method provided in the embodiment of the present application;

[0031] Figure 7 A schematic diagram of the dependency relationship in the service orchestration method provided in an embodiment of the present application;

[0032] Figure 8 A fourth scenario diagram of the service orchestration method provided in an embodiment of the present application;

[0033] Fig. 9 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0034] Fig.10 One of the schematic diagrams of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0036] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0037] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0038] At present, with the development and popularization of microservice architecture, the number of sub-service access is also increasing, making the business logic involved in the control process of sub-services more and more complex, resulting in more and more coupling.

[0039] To solve the above problems, the service orchestration method adopted in the embodiment of the present disclosure encapsulates the executor that executes the first sub-service and the dependency relationship between each executor in the configuration information. In this way, when the user adds a new first sub-service or modifies the first sub-service, the user can add the new first sub-service or modify the first sub-service through the configuration information. Furthermore, when an external query request is received, the corresponding first sub-service can be determined according to the external query request. Thereafter, the query result of the external query information is determined according to at least one executor that executes the first sub-service, the dependency relationship between each executor in the at least one executor, and the external query information.

[0040] Figure 1 is a schematic diagram of an operation scenario between a display device and a control device according to one or more embodiments of the present application, such as Figure 1 As shown, the user can operate the display device 200 through the mobile terminal 300 and the control device 100. The control device 100 can be a remote controller, and the communication between the remote controller and the display device includes infrared protocol communication, Bluetooth protocol communication, wireless or other wired methods to control the display device 200. The user can input user instructions through buttons on the remote controller, voice input, control panel input, etc. to control the display device 200. In some embodiments, a mobile terminal, a tablet computer, a computer, a laptop computer, and other smart devices can also be used to control the display device 200.

[0041] In some embodiments, the mobile terminal 300 can install software applications with the display device 200, and realize connection communication through the network communication protocol to achieve the purpose of one-to-one control operation and data communication. The audio and video content displayed on the mobile terminal 300 can also be transmitted to the display device 200 to realize the synchronous display function. The display device 200 also communicates data with the server 400 through various communication methods. The display device 200 can be allowed to communicate and connect through a local area network (LAN), a wireless local area network (WLAN) and other networks. The server 400 can provide various content and interactions to the display device 200. The display device 200 can be a liquid crystal display, an OLED display, or a projection display device. In addition to providing a broadcast receiving television function, the display device 200 can also provide an intelligent network TV function that provides a computer support function.

[0042] In some embodiments, the electronic device provided by the embodiments of the present application may be the above-mentioned server 400. After receiving the configuration information of the first sub-service, the server 400 determines at least one executor for executing the first sub-service and the dependency relationship between each executor according to the received configuration information. Afterwards, the display device 200 sends the external query information to the server 400. After receiving the external query information sent by the display device 200, the server 400 determines the first sub-service corresponding to the external query information according to the received external query information. According to at least one executor for executing the first sub-service, the dependency relationship between each executor in at least one executor and the external query information, the query result of the external query information is determined. Afterwards, the server 400 sends the query result to the display device 200, so that the display device 200 can feedback the query result corresponding to the external query information.

[0043] Figure 2 FIG. 2 shows a hardware configuration block diagram of a display device 200 according to an exemplary embodiment. Figure 2 The display device 200 shown includes at least one of a tuner 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280. The controller includes a central processing unit, a video processor, an audio processor, a graphics processor, a RAM, a ROM, and a first interface to an nth interface for input / output. The display 260 can be at least one of a liquid crystal display, an OLED display, a touch display, and a projection display, and can also be a projection device and a projection screen. The tuner 210 receives broadcast television signals by wired or wireless reception, and demodulates audio and video signals from multiple wireless or wired broadcast television signals, such as and EPG data signals. The detector 230 is used to collect signals of the external environment or interact with the outside. The controller 250 and the tuner 210 can be located in different split devices, that is, the tuner 210 can also be in an external device of the main device where the controller 250 is located, such as an external set-top box.

[0044] In some embodiments, the controller 250 controls the operation of the display device and responds to the user's operation through various software control programs stored in the memory. The controller 250 controls the overall operation of the display device 200. The user can input a user command through a graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input command through the graphical user interface (GUI). Alternatively, the user can input a user command by inputting a specific sound or gesture, and the user input interface recognizes the sound or gesture through a sensor to receive the user input command.

[0045] In some examples, the display device 200 of one or more embodiments is a TV set 1, and the operating system of the TV set 1 is an Android system. Figure 3 As shown, the television set 1 can be logically divided into an application layer (“application layer” for short) 21 , a kernel layer 22 and a hardware layer 23 .

[0046] Among them, Figure 3 As shown, the hardware layer may include Figure 2 The communicator 220, the detector 230 and the display 260 shown in the figure. The application layer 21 includes one or more applications. The application can be a system application or a third-party application. For example, the application layer 21 includes a first application, which can provide a first sub-service for realizing the connection between the television 1 and the server 400.

[0047] The kernel layer 22 serves as a software middleware between the hardware layer and the application layer 21 and is used to manage and control hardware and software resources.

[0048] The server 400 includes a communication control module 200, a file loading module 201, a rule parsing module 202, an initialization module 203, an execution control module 204, an executor module 205 and a data container module 206. The communication control module 200 is used to establish a communication connection with the television 1. For example, the first application in the television 1 realizes a communication connection with the communication control module 200 of the server 400 by calling the communicator 220.

[0049] In some examples, when the TV 1 provides the corresponding service of the first application, the server 400 needs to pre-configure the orchestration architecture corresponding to the first application. For example, after receiving the configuration information of the first sub-service, the file loading module 201 sends the configuration information to the rule parsing module 202. The rule parsing module 202 determines at least one executor module 205 for executing the first sub-service and the dependency relationship between each executor module 205 based on the configuration information sent by the file loading module 201. At the same time, the rule parsing module 202 is also used to create a global data container for storing query parameters for external query information and the output results of each executor module 205. Afterwards, the initialization module 203 initializes each executor module 205 determined by the rule parsing module 202 to execute the first sub-service. After the initialization is successful, the server 400 can provide the query service of the first application.

[0050] The kernel layer 22 includes a first driver, which is used to send the external query information collected by the detector 230 to the first application. When the first application in the TV set 1 is started and the TV set 1 establishes a communication connection with the server 400, the first driver is used to send the external query information input by the user collected by the detector 230 to the first application. After that, the first application sends the external query information to the execution control module 204 of the server. After receiving the external query information sent by the TV set 1, the execution control module 204 determines the first sub-service corresponding to the external query information. The execution control module 204 determines the query result of the external query information according to at least one executor module 205 that executes the first sub-service, the dependency relationship between each executor module 205 in the at least one executor module 205, and the external query information. The communication control module 200 sends the query result generated by the execution control module 204 to the first application of the TV set 1. After receiving the query result sent by the server 400, the first application controls the display 260 to display the query result.

[0051] The configuration information and external query information involved in this application may be data authorized by the user or fully authorized by all parties.

[0052] The methods in the following embodiments can all be implemented in the server 400 or the TV 1 having the above hardware structure. In the following embodiments, the electronic device provided in the embodiment of the present disclosure is taken as the above server 400 as an example to illustrate the methods in the embodiments of the present application.

[0053] The present application embodiment provides a service arrangement method, such as Figure 4 As shown, the service orchestration method may include S11-S15.

[0054] S11. Receive configuration information of a first sub-service.

[0055] In some examples, in the service orchestration method provided by the embodiments of the present disclosure, when a user needs to deploy a new first sub-service, the user can send the configuration information corresponding to the first sub-service to the server 400. In this way, after obtaining the configuration information, the server 400 can determine at least one executor for executing the first sub-service and the dependency relationship between each executor according to the configuration information, thereby completing the deployment of the first sub-service.

[0056] Of course, the user can also modify the configuration information of the first sub-service to add or delete an actuator in the first sub-service, and modify the business logic of the actuator. For example, when a new actuator is added to the first sub-service, the updated configuration information can be sent to the server 400. In this way, after obtaining the updated configuration information, the server 400 can determine at least one actuator that executes the first sub-service and the dependency relationship between each actuator according to the updated configuration information. Since the actuator that executes the first sub-service and the dependency relationship between each actuator have changed. Therefore, the server 400 also needs to release the actuator that executes the first sub-service before the update and the dependency relationship between each actuator to ensure the user experience. Alternatively, when modifying the business logic of the actuator, the updated configuration information can be sent to the server 400. In this way, after obtaining the updated configuration information, the server 400 can update the business logic of the actuator according to the updated configuration information.

[0057] In addition, the server 400 may call the external service in a hard-coded manner according to the custom logic, thereby implementing the addition of the first sub-service.

[0058] Specifically, the process of deleting an executor in the first sub-service is similar to the process of adding a new executor in the first sub-service, which will not be repeated here.

[0059] It should be noted that, since there is a dependency relationship between each executor, when deleting the executor of the first sub-service, the dependency relationship of other executors after the executor needs to be modified to ensure the normal operation of the first sub-service.

[0060] S12: Determine at least one executor for executing the first sub-service and the dependency relationship between each executor according to the configuration information, wherein the dependency relationship is used to indicate the sequence in which different executors are to be executed.

[0061] In some examples, the configuration information may be written according to a pre-configured writing rule. For example, the pre-configured writing rule specifies an identification code for representing an executor and an identification code for representing the dependency relationship between executors. Thus, after receiving the configuration information, the server 400 first parses the configuration information according to the pre-configured writing rule to determine at least one executor that executes the first sub-service and the dependency relationship between each executor.

[0062] It should be noted that the above examples are described by taking the case where the configuration information is written according to the pre-configured writing rules as an example. In some other examples, the configuration information can also be written according to the user's writing rules. In this case, the server 400 cannot directly parse the configuration information. Therefore, after receiving the configuration information, the server needs to convert the configuration information so that the converted configuration information can be recognized by the server 400, and then the at least one executor that executes the first sub-service and the dependency relationship between each executor can be determined.

[0063] In some examples, the first sub-service needs to be run in a certain order by each executor that executes the first sub-service in order to provide the first sub-service to the user. Therefore, the dependency relationship can be determined based on the input and output of each executor. For example, the first sub-service includes three executors, namely executor 1, executor 2 and executor 3. The input of executor 1 is external query information, and after processing the external query information, the first result is obtained. The input of executor 2 is the first result output by executor 1, and after processing the first result, the second result is obtained. The input of executor 2 is the second result output by executor 2, and after processing the second result, the third result is obtained. It can be seen that the dependency relationship between executor 1, executor 2 and executor 3 is: executor 3 depends on executor 2, and executor 2 depends on executor 1.

[0064] S13. Receive external query information.

[0065] In some examples, when the server 400 determines at least one executor for executing the first subservice and the dependencies between each executor according to the configuration information of the first subservice, and completes the deployment (creating the executor for executing the first subservice and the dependencies between each executor), the corresponding first subservice can be provided to the user. When the user needs to start the first subservice, the user can obtain the query result for the external query information by sending the external query information to the server 400.

[0066] S14. Determine, according to the external query information, a first sub-service corresponding to the external query information.

[0067] In some examples, each external query information corresponds to a first sub-service. For example, the external query information includes an identifier for indicating the first sub-service. The server 400 can determine the corresponding first sub-service based on the identifier in the external query information. Alternatively, the correspondence between each external query information and the first sub-service is pre-stored in the server 400. After receiving the external query information, the server 400 can query the first sub-service corresponding to the external query information in the correspondence, so as to determine the first sub-service corresponding to the external query information.

[0068] S15. Determine a query result of the external query information according to at least one executor that executes the first sub-service, a dependency relationship between each executor in the at least one executor, and the external query information.

[0069] As can be seen from the above, the executors that execute the first sub-service and the dependency relationship between each executor can be encapsulated in the configuration information. In this way, when the user adds a new first sub-service or modifies the first sub-service, the user can use the configuration information to add the new first sub-service or modify the first sub-service. Furthermore, when an external query request is received, the corresponding first sub-service can be determined according to the external query request. Thereafter, the query result of the external query information is determined according to at least one executor that executes the first sub-service, the dependency relationship between each executor in at least one executor, and the external query information. It can be seen that different first sub-services can be independently configured by means of configuration information, so that different first sub-services can be decoupled, solving the problem of multiple coupling of the calling logic of sub-services in the service in the related technology.

[0070] In some feasible examples, the external query information includes query parameters; Figure 4 ,like Figure 5 As shown, the service orchestration method adopted in the embodiment of the present disclosure also includes S16, and the above S15 can be specifically implemented through S150-S153.

[0071] S16. Create a global data container for storing query parameters and output results of each executor.

[0072] Specifically, the global data container is mainly used for data exchange. The input data of the executor is obtained from the global data container, and the output is written into the global data container.

[0073] S150. For the first executor that executes the first sub-service, perform the following operations: generate output results according to the external query information, and store them in the global data container.

[0074] S151. For executors other than the first executor that execute the first sub-service, perform the following operations: according to the dependency relationship between each executor in at least one executor, obtain the output result of the previous executor from the global data container, generate an updated output result based on the output result, and store it in the global data container.

[0075] S152. According to the dependency relationship between each executor in at least one executor, obtain the output result output by the last executor from the global data container.

[0076] S153: Determine that the query result of the external query information is the output result of the last executor output obtained in the global data container.

[0077] In some feasible examples, the global data container includes a key-value (KV) container.

[0078] In some feasible examples, the configuration information includes at least one identification code, one identification code corresponds to one actuator; Figure 4 ,like Figure 5 As shown, the above S12 can be specifically implemented through S120.

[0079] S120. Determine, according to the identification code, at least one executor for executing the first sub-service and the dependency relationship between each executor.

[0080] In some examples, in the service orchestration method adopted by the embodiments of the present disclosure, the topology of the first sub-service is defined in the form of configuration information. In order to be able to identify the executor that executes the first sub-service and the dependencies between each executor, it is necessary to set an identification code in the configuration information to determine the executor that executes the first sub-service and the dependencies between each executor. For example, the executor is represented by the processor identifier in the configuration information. Among them, the executor is the basic unit of process control, which is used to define the service dependency and business logic of a certain node. The configuration form of the executor in the configuration information is as follows:

[0081] Processor_name:{ / / Executor name

[0082] "inputQueryInfo": [], / / Special input dependency, indicating external user input parameters.

[0083] "processorInput": [], / / Input dependency, indicating the dependent input parameter. The execution controller will check whether there is a corresponding input parameter in the global data container (for example, the input parameter of executor 2 is the output parameter of executor 1. At this time, executor 2 can only be executed when the output parameter of executor 1 exists in the global data container). If it exists, it is considered that the executor has the execution condition.

[0084] "output": "", / / Main output, this configuration item, the key value of the configured output data in the global data container, the value is written by the executor.

[0085] "additionalOutput": { / / Additional output, generally used to overwrite upstream output (e.g., for some special scenarios, if the configuration information corresponding to executor 2 also includes "additionalOutput", the input parameter of executor 2 is the output parameter 1 of executor 1, and the output parameter 1 of executor 1 exists in the global data container, executor 2 determines output parameter 2 based on the output parameter 1. Executor 2 stores the determined output parameter 2 in the global data container. Since the configuration information corresponding to executor 2 also includes "additionalOutput", server 400 replaces output parameter 1 with output parameter 2).

[0086] },

[0087] "file":"" / / Configuration address of the execution component.

[0088] }

[0089] Specifically, when determining the dependency relationship, the key value in the global data container may be used as a keyword for determination.

[0090] In some possible implementation examples, combined with Figure 4 ,like Figure 6 As shown, the above S15 can be specifically implemented through S154.

[0091] S154. Determine, based on the dependency relationship between each executor in the at least one executor, that each executor in the at least one executor that executes the first sub-service runs the external query information in parallel to execute at least one executor of the first sub-service.

[0092] In some instances, the service orchestration method improved by the embodiments of the present disclosure divides and displays the dependencies according to the execution order and management traversal. That is, the parallel executors are all at the same level, such as the second level. The executors after the second level can only be triggered after all the executors in the second level have finished running. Figure 7As shown, it is assumed that the executors executing the first sub-service include 5 executors, namely executor 1, executor 2, executor 3, executor 4 and executor 5. Among them, executor 2, executor 3 and executor 4 are at the same level. When receiving external query information, executor 1 obtains the external query information from the global data container. Executor 1 determines the first result based on the external query information and stores it in the global data container. Executor 2, executor 3 and executor 4 obtain the first result from the global data container. Executor 2 determines the second result based on the first result and stores it in the global data container. Executor 3 determines the third result based on the first result and stores it in the global data container. Executor 4 determines the fourth result based on the first result and stores it in the global data container. It can be seen that when executor 5 is running, it needs to obtain the second result, the third result and the fourth result in the global data container before it can determine the fifth result. Therefore, executor 5, which is located at the next layer of executor 2, executor 3 and executor 4, can be triggered only after executor 2, executor 3 and executor 4 have all finished running. Afterwards, executor 5 obtains the second result, the third result and the fourth result from the global data container. Executor 5 determines the fifth result based on the second result, the third result and the fourth result, and stores it in the global data container. The fifth result is obtained from the global data container, and the query result of the external query information is determined to be the fifth result.

[0093] In some feasible examples, an executor includes one or more execution components, and the execution components are used to execute the business logic of the executor; Figure 4 ,like Figure 8 As shown, the service orchestration method adopted in the embodiment of the present disclosure also includes S17, and the above S15 can be specifically implemented through S155.

[0094] S17. Initialize the execution components of each executor.

[0095] In some examples, the execution component is a component of the executor. The executor is responsible for topological relationship definition, and the execution component is used to define the specific business logic of the executor. For example, the first sub-service includes one or more execution steps. Different execution steps can be encapsulated in the execution component of the executor that executes the execution step. When the subsequent executor executes the step, it can call and execute the execution component. The execution component exists as an independent configuration file in the configuration information. The configuration form of the execution component in the configuration information is as follows:

[0096] Component_name:{ / / Component name, we will load the corresponding implementation based on the name.

[0097] / / The content is customized by the component developer. The configuration parser will pass the content to the component initialization function, which is handled by the developer.

[0098] }

[0099] Exemplarily, in combination with the example given in S11 above, the process of modifying the business logic of the executor is as follows:

[0100] Since the execution component defines the specific business logic of the executor, when the business logic of the executor needs to be modified, the business logic of the executor can be modified by modifying the execution component of the executor.

[0101] Specifically, when the server 400 controls the operation of each executor according to the dependency relationship, it is necessary to control the operation of the executor according to the specific business logic of the execution component corresponding to the executor. For example, the business logic is that when the input of the executor satisfies the first condition, the executor starts. When the input of the executor does not satisfy the first condition, the executor shuts down. Exemplarily, the executor can determine whether it is currently started through the satisfied interface. For example, when the input of the executor satisfies the first condition, the satisfied interface returns true by default. At this time, when the executor determines that the satisfied interface returns true, the executor starts. When the input of the executor does not satisfy the first condition, the satisfied interface returns false by default. At this time, when the executor determines that the satisfied interface returns false, the executor shuts down.

[0102] S155. After determining that the execution components of each executor are initialized according to the dependency relationship between each executor in at least one executor, determine the query result of the external query information according to at least one executor that executes the first sub-service and the external query information.

[0103] As can be seen from the above, the service orchestration method provided by the embodiment of the present disclosure can hide the calling logic of the first sub-service to each execution component through the form of configuration files and unified interface definitions. This method achieves the benefits of the orchestration mentioned above, decouples the first sub-services, and retains the independence of each first sub-service. At the same time, the unified interface form and dependency relationship, as well as the embedded proxy logic, can well connect the execution process of the entire first sub-service and track the overall service business execution logic. In this way, it has the benefits of compilation, while strictly ensuring the execution order of key business logic, it also has a certain parallel computing capability. The established goals have been achieved very well. At the same time, the abstract process management and nodes can also transplant the entire basic platform to any other scenario.

[0104] It should be noted that the above example takes the electronic device provided in the embodiment of the present disclosure as the server 400 as an example to illustrate the service orchestration method provided in the embodiment of the present disclosure. In some other examples, the electronic device provided in the embodiment of the present disclosure may also be a television 1, and the process of the television 1 executing the service orchestration method provided in the embodiment of the present disclosure is similar to the process of the server 400 executing the service orchestration method provided in the embodiment of the present disclosure, and will not be repeated here.

[0105] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0106] The embodiment of the present application can divide the functional modules of the server and the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0107] like Fig. 9 As shown, an embodiment of the present application provides a structural diagram of a server 400. The server 400 includes a communicator 101 and a processor 102.

[0108] The communicator 101 is configured to receive configuration information of a first sub-service. The processor 102 is configured to determine, based on the configuration information received by the communicator 101, at least one executor for executing the first sub-service and the dependency relationship between each executor. The dependency relationship is used to indicate the order in which different executors run. The communicator 101 is also configured to receive external query information. The processor 102 is also configured to determine, based on the external query information received by the communicator 101, the first sub-service corresponding to the external query information. The processor 102 is also configured to determine a query result of the external query information based on at least one executor for executing the first sub-service, the dependency relationship between each executor in the at least one executor, and the external query information.

[0109] In some implementable examples, the external query information includes query parameters; the processor 102 is further configured to: create a global data container for storing the query parameters and the output results of each executor; the processor 102 is specifically configured to: for the first executor executing the first sub-service, perform the following operations: generate output results according to the external query information received by the communicator 101, and store them in the global data container; the processor 102 is specifically configured to: for the other executors executing the first sub-service except the first executor, perform the following operations: according to the dependency relationship between each executor in at least one executor, obtain the output result of the previous executor from the global data container, generate updated output results according to the output results, and store them in the global data container; the processor 102 is specifically configured to: according to the dependency relationship between each executor in at least one executor, obtain the output result output by the last executor from the global data container; the processor 102 is specifically configured to: determine that the query result of the external query information is the output result of the last executor output obtained in the global data container.

[0110] In some feasible examples, the global data container includes a KV container.

[0111] In some feasible examples, the configuration information includes at least one identification code, and one identification code corresponds to one executor; the processor 102 is specifically configured to: determine at least one executor that executes the first sub-service and the dependency relationship between each executor according to the identification code.

[0112] In some feasible examples, the processor 102 is specifically configured to: determine, based on a dependency relationship between each of the at least one executor, that each of the at least one executor executing the first sub-service runs the external query information received by the communicator 101 in parallel to execute at least one executor of the first sub-service.

[0113] In some implementable examples, an executor includes one or more execution components, and the execution components are used to execute the business logic of the executor; the processor 102 is further configured to: initialize the execution components of each executor. The processor 102 is specifically configured to: determine the query result of the external query information according to the external query information received by the at least one executor executing the first sub-service and the communicator 101 after determining that the execution components of each executor are initialized according to the dependency relationship between each executor in the at least one executor.

[0114] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and its role will not be repeated here.

[0115] Of course, the server 400 provided in the embodiment of the present application includes but is not limited to the above modules, for example, the server 400 may also include a memory 103. The memory 103 may be used to store the program code of the write server 400, and may also be used to store data generated by the write server 400 during operation, such as data in a write request.

[0116] As an example, combining Figure 3 The functions implemented by the communication control module 200 in the server 400 are similar to Fig. 9 The functions of the communicator 101 in FIG. 2 are the same as those of the file loading module 201, the rule parsing module 202, the initialization module 203, the execution control module 204 and the executor module 205. Fig. 9 The functions of the processor 102 in the embodiment are the same as those of the data container module 206. Fig. 9 The function of the memory 103 in is the same.

[0117] The present application also provides a server, which may include: a memory and one or more processors. The memory is coupled to the processor. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the server may perform the various functions or steps performed by the server 400 in the above method embodiment.

[0118] The present application also provides a chip system, which can be applied to the server 400 in the above embodiment. Fig.10 As shown, the chip system includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 may be the processor in the above-mentioned server 400. The processor 1501 and the interface circuit 1502 may be interconnected via a line. The processor 1501 may receive and execute computer instructions from the memory of the above-mentioned server 400 via the interface circuit 1502. When the computer instructions are executed by the processor 1501, the server 400 may execute the various steps executed by the server 400 in the above-mentioned embodiment. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.

[0119] The embodiment of the present application also provides a computer-readable storage medium for storing computer instructions executed by the above-mentioned server 400.

[0120] The embodiment of the present application also provides a computer program product, including computer instructions executed by the above-mentioned server 400.

[0121] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0122] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0123] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0124] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0126] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above discussion in some embodiments is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. According to the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.

Claims

1. A service orchestration method, characterized in that: include: Receiving configuration information of a first subservice; Determine, according to the configuration information, at least one executor for executing the first sub-service, and the dependency relationship between each of the executors; wherein the dependency relationship is used to indicate the order in which different executors are to be run; Creating a global data container for storing query parameters and output results of each of the executors; wherein the global data container includes a KV container; receiving external query information; wherein the external query information includes query parameters; Determine, according to the external query information, a first sub-service corresponding to the external query information; For the first executor executing the first sub-service, the following operations are performed: generating output results according to the external query information, and storing the output results in the global data container; For other executors that execute the first sub-service except the first executor, perform the following operations: according to the dependency relationship between each executor in the at least one executor, obtain the output result of the previous executor from the global data container, generate an updated output result according to the output result, and store it in the global data container; According to the dependency relationship between each executor in the at least one executor, obtaining an output result output by the last executor from the global data container; The query result of the external query information is determined to be the output result of the last executor output obtained in the global data container.

2. The service arrangement method according to claim 1, characterized in that: The configuration information includes at least one identification code, one identification code corresponds to one actuator; The step of determining, according to the configuration information, at least one executor for executing the first sub-service and the dependency relationship between each of the executors includes: At least one executor for executing the first sub-service and a dependency relationship between each of the executors are determined according to the identification code.

3. The service arrangement method according to claim 1, characterized in that: The determining, according to the at least one executor that executes the first sub-service, the dependency relationship between each executor in the at least one executor, and the external query information, a query result of the external query information includes: According to the dependency relationship between each executor in the at least one executor, it is determined that each executor in the at least one executor that executes the first sub-service runs the external query information in a parallel manner to execute the at least one executor of the first sub-service.

4. The service arrangement method according to claim 1, characterized in that: An executor includes one or more execution components, and the execution components are used to execute the business logic of the executor; Before receiving the external query information, the method further includes: Initializing the execution component of each of the executors; The determining, according to the at least one executor that executes the first sub-service, the dependency relationship between each executor in the at least one executor, and the external query information, a query result of the external query information includes: After determining that the execution components of each executor are initialized according to the dependency relationship between each executor in the at least one executor, determine the query result of the external query information according to the at least one executor that executes the first sub-service and the external query information.

5. The service arrangement method according to claim 4, characterized in that: The configuration information includes the name of at least one executor, input parameters and output parameters of each executor, and the configuration address of the execution component corresponding to each executor.

6. A service arrangement device, characterized in that: include: A receiving unit, configured to receive configuration information of a first sub-service; A processing unit, configured to determine, according to the configuration information received by the receiving unit, at least one executor for executing the first sub-service and a dependency relationship between each of the executors; wherein the dependency relationship is used to indicate a sequence in which different executors are to be run; The processing unit is further used to create a global data container for storing query parameters and output results of each of the executors; wherein the global data container includes a KV container; The receiving unit is further used to receive external query information; wherein the external query information includes query parameters; The processing unit is further configured to determine, according to the external query information received by the receiving unit, a first sub-service corresponding to the external query information; The processing unit is also used to For the first executor executing the first sub-service, the following operations are performed: generating output results according to the external query information, and storing the output results in the global data container; For other executors that execute the first sub-service except the first executor, perform the following operations: according to the dependency relationship between each executor in the at least one executor, obtain the output result of the previous executor from the global data container, generate an updated output result according to the output result, and store it in the global data container; According to the dependency relationship between each executor in the at least one executor, obtaining an output result output by the last executor from the global data container; The query result of the external query information is determined to be the output result of the last executor output obtained in the global data container.

7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to enable the electronic device to implement the service orchestration method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the service orchestration method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Information query method and device, electronic equipment, storage medium and program product

    CN112905848A