A data processing method and device, electronic equipment and storage medium

By unifying the target service interface and dynamic library calls on the server side, the service call order is optimized, solving the problem of low efficiency in developing new services on the server side, and achieving efficient service interface management and stability.

CN116185431BActive Publication Date: 2026-04-21BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
Filing Date
2023-01-29
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, integrating new services requires a cumbersome process on the server side, and the reusability of functional modules between different services is poor, which affects the development efficiency of new services.

Method used

The system receives service call instructions through the target service interface, matches the target service and obtains the execution sequence, calls the target functional module from the dynamic library to process data based on the execution sequence, optimizes the service call order using directed acyclic graphs and topological sorting, and provides a unified service interface to reduce the number of interfaces to be developed.

Benefits of technology

It improves service development efficiency, reduces interface development costs, simplifies the service iteration and update process, and enhances the stability and flexibility of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116185431B_ABST
    Figure CN116185431B_ABST
Patent Text Reader

Abstract

This disclosure relates to a data processing method, apparatus, electronic device, and storage medium. The data processing method includes: receiving a service invocation instruction through a target service interface; responding to the service invocation instruction, matching a target service from the services corresponding to the target service interface based on the identifier of the service to be invoked; if a target service is matched, obtaining an execution sequence corresponding to the target service; and calling a target functional module from a dynamic library based on the execution sequence to process the data to be processed, obtaining a processing result for the data to be processed, wherein the processing result matches the data output format of the target service interface. This disclosure enables different services to access the server using the same service interface. Thus, during server development, different services can use the same service interface, thereby reducing the number of service interfaces to be developed, improving service development efficiency, and reducing service interface development costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Internet technology, and in particular to a data processing method, apparatus, electronic device and storage medium. Background Technology

[0002] With the advancement of artificial intelligence research technology, AI algorithms are increasingly being applied to various fields. At the same time, the computing power required for AI algorithms is also increasing. Therefore, some algorithms must be deployed on the server side. By building an AI algorithm framework on the server side, application users can call the corresponding AI algorithm interface through the network to implement specific applications.

[0003] In related technologies, due to the different implementation logics of different services on the server side, when providing a new service or integrating a new algorithm, it is necessary to call the corresponding functional modules from the underlying functional modules of the current AI algorithm architecture deployed on the server side, based on the implementation logic of the new service. Then, the corresponding functional modules are encapsulated into a software development kit (SDK), specifically a static library. Finally, based on the communication protocol, the service call interface corresponding to the SSD is implemented. The entire process is very cumbersome. Although there is reusability of functional modules between different services, different services still need to implement their own code to orchestrate and call the same functional modules, which seriously affects the development efficiency of new services. Summary of the Invention

[0004] This disclosure provides a data processing method, apparatus, electronic device, and storage medium. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a data processing method is provided, comprising:

[0006] The service call instruction is received through the target service interface. The service call instruction includes the identifier of the service to be called and the data to be processed. The target service interface includes a data input format and a data output format. The data to be processed matches the data input format of the target service interface.

[0007] In response to a service invocation command, the target service is matched from the services corresponding to the target service interface based on the identifier of the service to be invoked;

[0008] If a target service is matched, the execution sequence corresponding to the target service is obtained. The execution sequence is a sequence constructed based on the target functional modules to be scheduled in the target service.

[0009] Based on the execution sequence, the target functional module is called from the dynamic library to process the data to be processed, and the processing result is obtained for the data to be processed. The processing result matches the data output format of the target service interface.

[0010] In some possible embodiments, the method further includes:

[0011] Obtain the initial directed acyclic graph corresponding to the target service; the initial directed acyclic graph includes the target identification information of at least two target functional modules to be called by the target service;

[0012] The initial directed acyclic graph is topologically sorted to obtain the initial execution sequence corresponding to the target service. The initial execution sequence is used to indicate the calling order of at least two target functional modules.

[0013] In some possible embodiments, it also includes:

[0014] Obtain the data input format of the target functional module corresponding to the initial node in the initial execution sequence;

[0015] Obtain the data output format of the target functional module corresponding to the terminal node in the initial execution sequence;

[0016] Based on the data input format of the target functional module corresponding to the initial node and the data output format of the target functional module corresponding to the final node, determine the target service interface corresponding to the target service.

[0017] In some possible embodiments, obtaining the initial directed acyclic graph corresponding to the target service includes:

[0018] In response to a setting operation for a target functional module of a target service, determine the target identification information of at least two target functional modules to be invoked by the target service;

[0019] In response to the orchestration and processing of target identification information for at least two target functional modules, an initial directed acyclic graph corresponding to the target service is obtained.

[0020] In some possible embodiments, the initial directed acyclic graph is stored in a preset storage area; the method further includes:

[0021] In response to an update command for the initial directed acyclic graph, the initial directed acyclic graph is retrieved from a preset storage area;

[0022] In response to the update processing of the initial directed acyclic graph, obtain the updated directed acyclic graph;

[0023] Perform topological sorting on the updated directed acyclic graph to obtain the updated execution sequence;

[0024] Replace the initial execution sequence with the updated execution sequence.

[0025] In some possible embodiments, if no target service interface corresponding to the target service is matched, the method further includes:

[0026] The new service interface is determined based on the data input format of the target functional module corresponding to the initial node and the data output format of the target functional module corresponding to the terminal node;

[0027] The newly added service interface will be used as the target service interface for the target service.

[0028] According to a second aspect of the present disclosure, a data processing apparatus is provided, comprising:

[0029] The receiving module is configured to receive service call instructions through the target service interface. The service call instructions include the identifier of the service to be called and the data to be processed. The target service interface includes a data input format and a data output format. The data to be processed matches the data input format of the target service interface.

[0030] The matching module is configured to respond to service call instructions by matching the target service from the services corresponding to the target service interface based on the identifier of the service to be called.

[0031] The first acquisition module is configured to acquire the execution sequence corresponding to the target service if a target service is matched.

[0032] The first processing module is configured to execute the target function module based on the execution sequence to process the data to be processed, and obtain the processing result data for the data to be processed. The processing result data matches the data output format of the target service interface.

[0033] In some possible embodiments, the apparatus further includes:

[0034] The second acquisition module is configured to acquire the initial directed acyclic graph corresponding to the target service; the initial directed acyclic graph includes the target identification information of at least two target functional modules to be called by the target service;

[0035] The second processing module is configured to perform topological sorting on the initial directed acyclic graph to obtain the initial execution sequence corresponding to the target service. The initial execution sequence is used to indicate the calling order of at least two target functional modules.

[0036] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0037] processor;

[0038] Memory used to store processor-executable instructions;

[0039] The processor is configured to execute instructions to implement the data processing method as described in the first aspect of the embodiments of this disclosure.

[0040] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the data processing method of the first aspect of the present disclosure.

[0041] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program stored in a readable storage medium, wherein at least one processor of a computer device reads from the readable storage medium and executes the computer program, causing the computer device to perform the data processing method of the first aspect of the present disclosure.

[0042] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0043] The system receives service call instructions through a target service interface. These instructions include the identifier of the service to be called and the data to be processed. The target service interface includes a data input format and a data output format, and the data to be processed matches the data input format of the target service interface. In response to the service call instructions, the system matches a target service from the services corresponding to the target service interface based on the identifier of the service to be called. If a target service is matched, the system obtains the execution sequence corresponding to the target service. This execution sequence is constructed based on the target functional modules to be scheduled by the target service. Based on the execution sequence, the system calls the target functional modules from a dynamic library to process the data to be processed, obtaining the processing result for the data to be processed. The processing result matches the data output format of the target service interface. This disclosure allows different services to access the server using the same service interface. Therefore, during server development, different services can use the same service interface, thereby reducing the number of service interfaces to be developed, improving service development efficiency, and reducing service interface development costs.

[0044] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0046] Figure 1 This is a schematic diagram illustrating an application environment according to an exemplary embodiment;

[0047] Figure 2 This is a flowchart illustrating a data processing method according to an exemplary embodiment;

[0048] Figure 3This is a schematic diagram illustrating a service architecture according to an exemplary embodiment;

[0049] Figure 4 This is a flowchart illustrating the determination of an initial execution sequence according to an exemplary embodiment;

[0050] Figure 5 This is a flowchart illustrating an exemplary embodiment for obtaining an initial directed acyclic graph corresponding to a service to be integrated;

[0051] Figure 6 This is a schematic diagram illustrating an initial directed acyclic graph according to an exemplary embodiment;

[0052] Figure 7 This is a schematic diagram illustrating an initial execution sequence according to an exemplary embodiment;

[0053] Figure 8 This is a flowchart illustrating an initial directed acyclic graph according to an exemplary embodiment;

[0054] Figure 9 This is a flowchart illustrating a data processing method according to an exemplary embodiment;

[0055] Figure 10 This is a block diagram illustrating a data processing apparatus according to an exemplary embodiment;

[0056] Figure 11 This is a block diagram illustrating an electronic device for data processing according to an exemplary embodiment. Detailed Implementation

[0057] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0058] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar first objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0059] It should be noted that the user information involved in this disclosure (including but not limited to user device information, user personal information, etc.) is all information authorized by the user or fully authorized by all parties.

[0060] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application environment of a data processing method according to an exemplary embodiment, such as... Figure 1 As shown, the application environment can include server 01 and client 02. Server 01 is the service provider and client 02 is the service consumer. Server 01 provides a service interface to the outside world, and client 02 can use the services provided by server 01 through the service interface. This process can be called Remote Procedure Call (RPC), and the service interface can also be called an RPC interface.

[0061] In some possible embodiments, server 01 receives a service call instruction through a target service interface, which may be sent by client 02. The service call instruction includes an identifier of the service to be called and data to be processed. The target service interface includes a data input format and a data output format, and the data to be processed matches the data input format of the target service interface. In response to the service call instruction, server 01 matches a target service from the services corresponding to the target service interface based on the identifier of the service to be called. If a target service is matched, server 01 obtains the execution sequence corresponding to the target service. The execution sequence is a sequence constructed based on the target functional modules to be scheduled by the target service. Server 01 calls the target functional modules from the dynamic library based on the execution sequence to process the data to be processed, and obtains the processing result for the data to be processed. The processing result matches the data output format of the target service interface.

[0062] In some possible embodiments, server 01 may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The operating system running on the server may include, but is not limited to, Android, iOS, Linux, Windows, Unix, etc.

[0063] In some possible embodiments, the client 02 described above may include, but is not limited to, smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, and other similar clients. It may also be software running on the aforementioned client, such as applications or mini-programs. Optionally, the operating system running on the client may include, but is not limited to, Android, iOS, Linux, Windows, Unix, and other similar systems.

[0064] In addition, it should be noted that, Figure 1 The example shown is merely one application environment of the data processing method provided in this disclosure. In practical applications, other application environments may also be included.

[0065] Figure 2 This is a flowchart illustrating a data processing method according to an exemplary embodiment, such as... Figure 2 As shown, the data processing method can be applied to the server side, including the following steps:

[0066] In step S201, a service call instruction is received through the target service interface. The service call instruction includes the identifier of the service to be called and the data to be processed. The target service interface includes a data input format and a data output format. The data to be processed matches the data input format of the target service interface.

[0067] In this embodiment of the disclosure, the server pre-integrates the target service interface. After integrating the target service interface, the server registers with the service registry. Then, the client can obtain the target service interface of the server from the service registry and use the server's service by calling the target service interface.

[0068] In a specific application scenario, the server can provide artificial intelligence (AI) algorithm services through the target service interface, such as image processing services using deep synthesis technology. Currently, the server can provide a variety of image processing services, such as specific stylization (input an image and output a full-image effect with a specific style), live photo (input an image and output a video in which each face moves according to a specific template), face swapping (input an image and output a video in which the faces in the input image are swapped onto a video with a specific template), etc.

[0069] In related technologies, the server needs to integrate the corresponding service interfaces for each of the various image processing services. Typically, for each service, based on its unique implementation logic, the corresponding functional modules are called from the underlying layer. Then, all functional modules for that service are encapsulated to obtain a Software Development Kit (SDK), specifically a static library. An SDK can be a collection of documents, examples, and tools that assist in developing a particular type of software. Next, an RPC communication protocol is defined, calling code is written to invoke the corresponding service SDK, and service code is written based on an RPC framework (brpc, gRPC, etc.). Finally, the service interfaces for each service are encapsulated. Subsequently, the client uses the RPC protocol to call the service interfaces to apply the corresponding services. However, the process of integrating service interfaces in related technologies is very cumbersome. While functional modules may be reusable across different services, each service still needs to implement its own code to orchestrate and call the same functional modules, resulting in insufficient usability of the functional modules. This severely impacts the development efficiency of new services.

[0070] In this embodiment, the server uses the same target service interface for services with the same data input and output formats. For example, the live photo service and face-swapping service no longer integrate separate service interfaces, but use the same target service interface. Thus, when the client calls the target service interface, it carries the identifier of the service to be accessed in the corresponding service call instruction, along with the data to be processed. The data input format of this data matches the data input format of the target interface service.

[0071] In the above embodiments, the same service interface can be provided to the outside world for different services, which can greatly reduce the number of service interfaces provided to the outside world and facilitate interface management on the server side.

[0072] In step S203, in response to the service call instruction, the target service is matched from the services corresponding to the target service interface according to the service identifier to be called.

[0073] In this embodiment of the disclosure, the server responds to a service invocation command by matching the target service from the services corresponding to the target service interface based on the identifier of the service to be invoked. Here, the services corresponding to the target service interface include multiple services, and the data input format and data output format of each of these multiple services are the same.

[0074] In step S205, if a target service is matched, the execution sequence corresponding to the target service is obtained. The execution sequence is a sequence constructed based on the target functional modules to be scheduled in the target service.

[0075] In this embodiment of the disclosure, in practical applications, when the server matches the target service, it obtains the execution sequence corresponding to the target service. The execution sequence is determined by the server in advance based on the directed acyclic graph (DAG) of the target service; specifically, the server configures the DAG graph of the target service in advance according to the target functional modules to be scheduled, and then performs topological sorting on the DAG graph of the target service to obtain the execution sequence of the target service.

[0076] In some possible embodiments, the server-side service architecture is as follows: Figure 3 As shown, from bottom to top, the architecture includes a functional module layer, a service layer, and an interface layer. The functional module layer comprises multiple functional modules (functional module 1, functional module 2, ..., functional module n) covered by the current server. These functional modules are reusable, general, and typical functional modules across different services within the service architecture, covering common functions encountered in daily service development. Each functional module implements the corresponding function, specifically tailored to the actual application scenario. For example, in the application scenario of AI services... Figure 3 If we represent the AI ​​service architecture on the server side, then the functional module layer can include image encoding module, image decoding module, video encoding module, video decoding module, special color gamut conversion module, portrait stylization module, facial landmark recognition module, portrait segmentation module, facial attribute recognition module, etc.

[0077] The service layer comprises multiple services (Service 1, Service 2, ..., Service m), each of which can be implemented based on the functional module layer through logical orchestration using a Directed Acyclic Graph (DAG). These services are tailored to specific application scenarios. For example, in an AI service application scenario, Service 1 could be a style-specific service, Service 2 could be a live photo service, and Service 3 could be a face-swapping service.

[0078] The interface layer includes multiple service interfaces (service interface 1, service interface 2, ..., service interface k). These service interfaces do not necessarily correspond one-to-one with the services in the service layer. For example, in an AI service application scenario, service interface 1 could be an image input / output interface, service interface 2 could be a video input / output interface, and service interface 3 could be an input image / output video interface. Correspondingly, the aforementioned live photo service and face-swapping service could correspond to the same service interface 3, i.e., an input image / output video interface. Here, the target service interface can be any one of service interface 1, service interface 2, ..., service interface k.

[0079] The following describes the process of generating the initial execution sequence corresponding to the target service. Here, the initial execution sequence can represent the execution sequence established during the initial interface integration of the target service. Subsequent updates to the service can update the initial execution sequence. In some possible embodiments, the data processing method of this disclosure also includes, for example... Figure 4 The following steps are shown:

[0080] In step S401, the initial directed acyclic graph corresponding to the target service is obtained; the initial directed acyclic graph includes the target identification information of at least two target functional modules to be called by the target service.

[0081] In this step, the initial directed acyclic graph (DAG) corresponding to the target service is orchestrated based on the implementation logic of the target service. Correspondingly, the server needs to determine the initial DAG corresponding to the target service based on the orchestration operations on the terminal device.

[0082] In a specific embodiment, the above-mentioned acquisition of the initial directed acyclic graph corresponding to the target service may include, for example: Figure 5 The following steps are shown:

[0083] In step S501, in response to the setting operation for the target functional modules of the target service, the target identification information of at least two target functional modules to be invoked by the target service is determined.

[0084] Specifically, the terminal device displays a directed acyclic graph configuration page for the target service. When a setting operation for a target functional module of the target service is detected, the terminal device sends the setting operation for the target functional module of the target service to the server. In response to the setting operation for the target functional module of the target service, the server determines the target identification information of at least two target functional modules to be called by the target service. Here, the target identification information can be identification information used to distinguish different functional modules, and can be numbers, letters, pictures or other arbitrary forms.

[0085] In practical applications, for a target service, the implementation logic of the target service is first sorted out. When the target service is complex, the overall logic can be broken down into multiple functional points. Users can select multiple functional modules that match the multiple functional points from all functional modules displayed in the functional module layer on the directed acyclic graph configuration page. Each of these multiple matching functional modules is the target functional module. Based on the target functional module selected by the user, the setting operation for the target functional module of the target service is generated.

[0086] It should be noted that if the functional module layer currently maintained by the server does not contain a functional module that matches the functional point, a functional module related to that functional point needs to be developed. Then, the newly added functional module is added to the functional module layer to obtain an updated functional module layer, which can be selected by the user on the directed acyclic graph configuration page.

[0087] In step S503, in response to the orchestration processing of target identification information for at least two target functional modules, an initial directed acyclic graph corresponding to the target service is obtained.

[0088] Specifically, after identifying at least two target functional modules, users can further visualize and orchestrate the target identifier information of these modules on their terminal devices. The server responds to this orchestration process, generating a directed acyclic graph (DAG) corresponding to the target service. Taking a specific stylized service as an example, based on its implementation logic, the corresponding target functional modules include an image decoding module, a portrait segmentation module, a facial landmark recognition module, a portrait stylization module, and an image encoding module. The resulting initial DAG corresponding to this specific stylized service can be represented as follows: Figure 6 As shown.

[0089] In step S403, the initial directed acyclic graph is subjected to topological sorting to obtain the initial execution sequence corresponding to the target service. The initial execution sequence is used to indicate the calling order of at least two target functional modules.

[0090] Specifically, during the initial DAG orchestration process of the target service, each functional module in the functional module layer is treated as an independent node and orchestrated into an initial DAG according to the implementation logic of the target service. When the server initializes through the execution engine, it loads the initial DAG and initializes each node sequentially. After all nodes in the initial DAG are initialized, the entire initial DAG is topologically sorted to obtain the initial execution order of each node, which is the execution order of each target functional module. In other words, the initial execution sequence is used to indicate the calling order of at least two target functional modules.

[0091] For example, targeting Figure 6 After performing topological sorting on the initial DAG graph shown, the resulting initial execution sequence is as follows: Figure 7 As shown, Figure 7 This is a schematic diagram of a possible initial execution sequence.

[0092] In the above embodiments, by utilizing the common and typical functional modules in the functional module layer maintained by the server, in the development of new services to be integrated, only the service-related, specific functional modules need to be developed. Furthermore, there is no need to manually write code to orchestrate and call each functional module; the service implementation logic is directly visualized and configured using a DAG graph. In actual operation, the execution engine initializes and calls the functional modules to realize the overall service logic. This improves the usability of each functional module in the functional module layer, greatly simplifies the development process of new services, and increases the efficiency of new service development.

[0093] In some possible embodiments, the initial directed acyclic graph is stored in a preset storage area; the data processing method of this disclosure embodiment may further include, for example, Figure 8 The following steps are shown:

[0094] In step S801, in response to the update instruction for the initial directed acyclic graph, the initial directed acyclic graph is obtained from the preset storage area.

[0095] In this step, the preset storage area is the area used by the server to store the initial DAG graph corresponding to each service. When the target service is iteratively updated, the user can update the initial DAG graph of the target service through the terminal device. In response to the update instruction for the initial directed acyclic graph, the server retrieves the initial directed acyclic graph from the preset storage area.

[0096] In step S803, in response to the update process of the initial directed acyclic graph, the updated directed acyclic graph is obtained.

[0097] In this step, the user can update the initial directed acyclic graph through the terminal device, and the server responds to the update of the initial directed acyclic graph and obtains the updated directed acyclic graph.

[0098] In step S805, the updated directed acyclic graph is topologically sorted to obtain the updated execution sequence.

[0099] In this step, the server performs a topological sort on the updated directed acyclic graph (DAG) to obtain the updated execution sequence. This process is similar to the topological sort on the initial DAG and will not be described in detail here.

[0100] In step S807, the initial execution sequence is replaced with the updated execution sequence.

[0101] In this step, after obtaining the updated execution sequence, the server replaces the initial execution sequence in the preset storage area with the updated execution sequence to ensure that the preset storage area always stores the latest execution sequence.

[0102] In some possible embodiments, the data processing method of this disclosure may further include, for example: Figure 9 The following steps are shown:

[0103] In step S901, the data input format of the target functional module corresponding to the initial node in the initial execution sequence is obtained.

[0104] Specifically, the data input format of the target service can be determined based on the data input format of the target functional module located at the initial node in the initial execution sequence. For example, based on... Figure 7 The initial execution sequence corresponding to the specific stylized service shown indicates that the target functional module located at the initial node is the image decoding module, and the data input format of the image decoding module is an image.

[0105] In step S903, the data output format of the target functional module corresponding to the terminal node in the initial execution sequence is obtained.

[0106] Specifically, the data output format of the target service can be determined based on the data output format of the target functional module located at the final node in the initial execution sequence. For example, based on... Figure 7 The initial execution sequence corresponding to the specific stylized service shown indicates that the target functional module located at the terminal node is the image encoding module, and the data output format of the image encoding module is an image.

[0107] In step S905, the target service interface corresponding to the target service is determined based on the data input format of the target functional module corresponding to the initial node and the data output format of the target functional module corresponding to the final node.

[0108] Specifically, after determining the data input format and data output format of the target service, the server determines the matching service interface from the existing service interfaces in the current interface layer. For example, the aforementioned specific stylization service can be matched with service interface 1 from the interface layer, and service interface 1 is used as the target service interface of the specific stylization service.

[0109] In some possible embodiments, when no target service interface corresponding to the target service is matched, the data processing method of this disclosure embodiment may further include the following steps:

[0110] Based on the data input format of the target functional module corresponding to the initial node and the data output format of the target functional module corresponding to the terminal node, determine the new service interface; and use the new service interface as the target service interface of the target service.

[0111] Specifically, if a matching service interface cannot be determined from the existing service interfaces in the current interface layer, a new service interface is added for the target service. The data input and output formats of the new service interface are defined, and the new service interface is used as the target service interface of the target service.

[0112] In the above embodiments, the target service forms a DAG graph after visually arranging its various functional modules. In practical applications, after receiving a service call instruction, the server loads the dynamic library and execution sequence through a dynamic loader to implement the service logic. Since the external service interfaces of the interface layer are unified and only related to the actual service type, any service among multiple services corresponding to the same service interface generally does not change its service type (i.e., data input / output format) during iterative updates, thus eliminating the need to change its external service interface. This decouples the interface layer and the service layer. When services are iterated or updated or new services are integrated, there is no need to reconnect with the interface layer, enabling rapid service deployment and further improving service development efficiency.

[0113] In step S207, the target functional module is called from the dynamic library based on the execution sequence to process the data to be processed, and the processing result for the data to be processed is obtained. The processing result matches the data output format of the target service interface.

[0114] In this embodiment of the disclosure, the server pre-encapsulates multiple underlying functional modules into a dynamic library. After obtaining the execution sequence corresponding to the target service, it calls the target functional module from the dynamic library based on the execution sequence to process the data to be processed, and obtains the processing result for the data to be processed. The processing result matches the data output format of the target service interface.

[0115] In some possible embodiments, the data processing method of this disclosure may further include: obtaining multiple reusable functional modules currently covered by the server; and encapsulating the multiple reusable functional modules to obtain a dynamic library.

[0116] Here, the multiple reusable functional modules covered by the current server refer to the reusable, common, and typical functional modules among the different services mentioned above. Each functional module covers functions commonly used in daily service development. For example, the image encoding / decoding module, video encoding / decoding module, special color gamut conversion module, portrait stylization module, facial landmark recognition module, portrait segmentation module, and facial attribute recognition module mentioned above.

[0117] Specifically, the server encapsulates multiple reusable underlying functional modules into a dynamic library; subsequently, depending on the specific service, different service interfaces are exposed to the outside world.

[0118] In the above embodiments, the server no longer encapsulates each service to form a static library for each service. Instead, it encapsulates all the underlying functional modules to obtain a dynamic library. This reduces the impact on service interfaces during service upgrades and improves the scalability and flexibility of service interfaces.

[0119] In summary, in this embodiment, when integrating the interface of the target service, the server does not need to manually write and orchestrate the calls to each functional module. It only needs to orchestrate the service logic using a DAG graph, thus improving service development efficiency. Furthermore, different services can share a dynamic library, providing their respective service interfaces based on their service types. This reduces changes to service interfaces during service content iterations and improves server-side service stability. In practical applications, when the server receives a service call instruction through the target service interface, it first determines the identifier of the service to be accessed in the instruction, and then determines the execution sequence of the target service based on this identifier. Based on the execution sequence, it loads and executes the corresponding target functional module from the dynamic library to obtain the processing result. This allows different services to access the server using the same service interface, reducing the number of service interfaces developed and lowering development costs. Furthermore, the execution sequence-based approach to service logic ensures efficient data processing on the server.

[0120] Figure 10 This is a block diagram of a data processing apparatus according to an exemplary embodiment. (Refer to...) Figure 10 The device includes a receiving module 1001, a matching module 1002, a first acquisition module 1003, and a first processing module 1004.

[0121] The receiving module 1001 is configured to receive a service call instruction through the target service interface. The service call instruction includes the identifier of the service to be called and the data to be processed. The target service interface includes a data input format and a data output format. The data to be processed matches the data input format of the target service interface.

[0122] Matching module 1002 is configured to execute a service call instruction in response to match the target service from the services corresponding to the target service interface based on the identifier of the service to be called.

[0123] The first acquisition module 1003 is configured to acquire the execution sequence corresponding to the target service if the target service is matched;

[0124] The first processing module 1004 is configured to execute the target function module based on the execution sequence to process the data to be processed, and obtain the processing result data of the data to be processed, which matches the data output format of the target service interface.

[0125] In some possible embodiments, the apparatus further includes:

[0126] The second acquisition module is configured to acquire the initial directed acyclic graph corresponding to the target service; the initial directed acyclic graph includes the target identification information of at least two target functional modules to be called by the target service;

[0127] The second processing module is configured to perform topological sorting on the initial directed acyclic graph to obtain the initial execution sequence corresponding to the target service. The initial execution sequence is used to indicate the calling order of at least two target functional modules.

[0128] In some possible embodiments, the apparatus further includes:

[0129] The third acquisition module is configured to acquire the data input format of the target functional module corresponding to the initial node in the initial execution sequence; acquire the data output format of the target functional module corresponding to the terminal node in the initial execution sequence; and determine the target service interface corresponding to the target service based on the data input format of the target functional module corresponding to the initial node and the data output format of the target functional module corresponding to the terminal node.

[0130] In some possible embodiments, the third acquisition module is further configured to perform a setting operation in response to the target functional modules of the target service, determine the target identification information of at least two target functional modules to be invoked by the target service; and obtain the initial directed acyclic graph corresponding to the target service in response to the orchestration processing of the target identification information of the at least two target functional modules.

[0131] In some possible embodiments, the initial directed acyclic graph is stored in a preset storage area; the apparatus further includes:

[0132] The update module is configured to execute the following actions in response to an update instruction on the initial directed acyclic graph: retrieve the initial directed acyclic graph from a preset storage area; retrieve the updated directed acyclic graph in response to the update process of the initial directed acyclic graph; perform topological sorting on the updated directed acyclic graph to obtain the updated execution sequence; and replace the initial execution sequence with the updated execution sequence.

[0133] In some possible embodiments, if no target service interface corresponding to the target service is matched, the apparatus further includes:

[0134] The newly added module is configured to determine the new service interface based on the data input format of the target function module corresponding to the initial node and the data output format of the target function module corresponding to the end node; and to use the new service interface as the target service interface of the target service.

[0135] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0136] Figure 11 This is a block diagram illustrating an electronic device for data processing according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 11 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a data processing method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.

[0137] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0138] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the data processing method as described in the embodiments of this disclosure.

[0139] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the data processing method of the present disclosure embodiments.

[0140] In an exemplary embodiment, a computer program product including instructions is also provided. The computer program product includes a computer program stored in a readable storage medium. At least one processor of a computer device reads from the readable storage medium and executes the computer program, causing the computer device to perform the data processing method of the present disclosure embodiments.

[0141] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0142] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0143] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A data processing method, characterized in that, include: The service call instruction is received through the target service interface. The service call instruction includes the identifier of the service to be called and the data to be processed. The target service interface includes a data input format and a data output format. The data to be processed matches the data input format of the target service interface. The target service interface corresponds to multiple services, and the data input format and data output format of each of the multiple services are the same. In response to the service invocation instruction, a target service is matched from the services corresponding to the target service interface based on the service identifier to be invoked; If the target service is matched, the execution sequence corresponding to the target service is obtained. The execution sequence is a sequence constructed based on the target functional modules to be scheduled for the target service. Based on the execution sequence, the target functional module is called from the dynamic library to process the data to be processed, and a processing result for the data to be processed is obtained, wherein the processing result matches the data output format of the target service interface.

2. The data processing method according to claim 1, characterized in that, The method further includes: Obtain the initial directed acyclic graph corresponding to the target service; the initial directed acyclic graph includes target identification information of at least two target functional modules to be invoked by the target service; The initial directed acyclic graph is topologically sorted to obtain the initial execution sequence corresponding to the target service. The initial execution sequence is used to indicate the calling order of at least two of the target functional modules.

3. The data processing method according to claim 2, characterized in that, Also includes: Obtain the data input format of the target functional module corresponding to the initial node in the initial execution sequence; Obtain the data output format of the target functional module corresponding to the terminal node in the initial execution sequence; Based on the data input format of the target functional module corresponding to the initial node and the data output format of the target functional module corresponding to the final node, the target service interface corresponding to the target service is determined.

4. The data processing method according to claim 2, characterized in that, The process of obtaining the initial directed acyclic graph corresponding to the target service includes: In response to a setting operation for a target functional module of the target service, target identification information of at least two target functional modules to be invoked by the target service is determined; In response to the orchestration processing of the target identification information for the at least two target functional modules, an initial directed acyclic graph corresponding to the target service is obtained.

5. The data processing method according to claim 2, characterized in that, The initial directed acyclic graph is stored in a preset storage area; the method further includes: In response to an update instruction for the initial directed acyclic graph, the initial directed acyclic graph is retrieved from the preset storage area; In response to the update process of the initial directed acyclic graph, the updated directed acyclic graph is obtained; The updated directed acyclic graph is topologically sorted to obtain the updated execution sequence; The updated execution sequence replaces the initial execution sequence.

6. The data processing method according to claim 3, characterized in that, If no target service interface corresponding to the target service is matched, the method further includes: The new service interface is determined based on the data input format of the target functional module corresponding to the initial node and the data output format of the target functional module corresponding to the final node; The newly added service interface is used as the target service interface for the target service.

7. A data processing apparatus, characterized in that, include: The receiving module is configured to receive a service call instruction through a target service interface. The service call instruction includes an identifier of the service to be called and data to be processed. The target service interface includes a data input format and a data output format. The data to be processed matches the data input format of the target service interface. The target service interface corresponds to multiple services, and the data input format and data output format of each of the multiple services are the same. The matching module is configured to respond to the service call instruction by matching the target service from the services corresponding to the target service interface based on the service identifier to be called. The first acquisition module is configured to acquire the execution sequence corresponding to the target service if the target service is matched. The first processing module is configured to execute a call to the target function module based on the execution sequence to process the data to be processed, and obtain processing result data for the data to be processed, wherein the processing result data matches the data output format of the target service interface.

8. The data processing apparatus according to claim 7, characterized in that, The device further includes: The second acquisition module is configured to acquire the initial directed acyclic graph corresponding to the target service; the initial directed acyclic graph includes target identification information of at least two target functional modules to be invoked by the target service; The second processing module is configured to perform topological sorting on the initial directed acyclic graph to obtain an initial execution sequence corresponding to the target service. The initial execution sequence is used to indicate the calling order of at least two of the target functional modules.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the data processing method as described in any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the data processing method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Task scheduling method and device based on directed acyclic graph, equipment and medium

    CN114281552A

  • Edge cloud network system, scheduling method, equipment, system and storage medium

    CN115002229A