Module processing method, device and server
By obtaining the characteristic information of the target function module in the virtual resource application service and encapsulating it to generate an independent process, the problem of poor change flexibility caused by functional module code coupling is solved, and the flexibility of the virtual resource application service is improved and the ability to quickly iterate is achieved.
Patent Information
- Application Number
- CN202010968055.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-15
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2040-09-15
AI Technical Summary
Existing virtual resource application services have poor change flexibility due to code coupling between functional modules, and require frequent updates to the entire API cluster.
By obtaining the characteristic information of the target function module, encapsulating it according to its dependencies, and generating an independent process, so that only the relevant content of the target function module needs to be updated when changes are made, avoiding the deployment and update of the entire API cluster.
It improves the change flexibility of virtual resource application services, reduces the change cycle, supports rapid iterative launch, and avoids unnecessary deployment and updates of other functional modules and API interfaces.
Smart Images

Figure CN112051988B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a module processing method, device and server. Background Art
[0002] At present, virtual resource application services are usually composed of many functional modules. For example, pet application services involve basic information, rankings, social networking, backpacks, tasks, and experience modules. Each functional module can implement a function of the pet application service, and there can be dependencies between these functional modules. For example, in the pet application service, the ranking function module can call the basic information function module to implement the function of pet ranking.
[0003] In the related art, these functional modules are usually processed in a code dependency manner. However, although the code logic of the code dependency method is simple and direct, the codes of multiple functional modules are coupled with each other. If the logic of a functional module changes, the application programming interface (API) cluster of the entire application service needs to be deployed and updated.
[0004] Thus, there are many instances involved in the change and the change cycle is long, which results in poor flexibility in the change of virtual resource application services. Summary of the invention
[0005] The present disclosure provides a module processing method, device and server to at least solve the problem in the related art that the codes of multiple functional modules are coupled together, resulting in poor flexibility in changing virtual resource application services. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a module processing method is provided, including:
[0007] Acquire characteristic information of a target function module of a virtual resource application service; wherein the target function module is used to process data of virtual resources during a live broadcast, and the characteristic information represents a dependency relationship between the target function module and other function modules during the data processing of the virtual resources;
[0008] When the characteristic information meets the preset conditions, the target function module is encapsulated to generate a first process corresponding to the target function module, wherein the first process is used to perform a first data processing on the virtual resources during the live broadcast, and the preset condition is that the characteristic information characterizes that the target function module depends on the other function modules during the data processing of the virtual resources.
[0009] Optionally, the other functional modules include other functional modules in the virtual resource application service, and the characteristic information includes the first external interface information, which represents the calling relationship between the target functional module and other functional modules in the virtual resource application service during data processing of the virtual resource;
[0010] The step of obtaining characteristic information of the target function module of the virtual resource application service comprises:
[0011] Acquire the first external interface information of the target functional module;
[0012] When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes:
[0013] When the first external interface information indicates that the target function module is called by other function modules in the virtual resource application service during data processing of the virtual resource, the target function module is encapsulated to generate a first process corresponding to the target function module.
[0014] Optionally, after the step of encapsulating the target functional module to generate a first process corresponding to the target functional module, the method further includes:
[0015] In the case of obtaining a call request of a function module in the other function modules to call the target function module, encapsulating the call request;
[0016] Serializing the encapsulated call request to generate a byte stream; wherein the byte stream is used to request the first process to call the target function module;
[0017] The byte stream is sent to the first process, and the first process responds to the byte stream to call the target functional module.
[0018] Optionally, the characteristic information includes the service change information, and the service change information represents the association relationship between the target function module and other function modules in the virtual resource application service during the data processing of the virtual resource;
[0019] The step of obtaining characteristic information of the target function module of the virtual resource application service comprises:
[0020] Obtaining business change information of the target functional module;
[0021] When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes:
[0022] When the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during data processing of the virtual resource, encapsulating the target function module to generate a first process corresponding to the target function module;
[0023] Among them, when the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
[0024] Optionally, after the step of encapsulating the target functional module to generate a first process corresponding to the target functional module, the method further includes:
[0025] When a service change request for the target functional module is obtained, the first process is exited to perform service changes on the target functional module.
[0026] Optionally, the other functional modules include functional modules outside the virtual resource application service, and the characteristic information includes second external interface information of the target functional module, wherein the second external interface information represents a calling relationship or data processing relationship between the target functional module and the functional module outside the virtual resource application service during data processing of the virtual resource;
[0027] The step of obtaining characteristic information of the target function module of the virtual resource application service comprises:
[0028] Acquire the second external interface information of the target functional module;
[0029] When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes:
[0030] When the second external interface information indicates that the target function module is called by a function module outside the virtual resource application service during data processing of the virtual resources, or when the second external interface information indicates that the data processing of the virtual resources by the target function module and the data processing by the function module outside the virtual resource application service are asynchronously processed, the target function module is encapsulated to generate a first process corresponding to the target function module.
[0031] Optionally, the method further includes:
[0032] In the case where the characteristic information does not satisfy the preset condition, encapsulating the target functional module into a second process corresponding to other functional modules in the virtual resource application service;
[0033] The second process is used to perform second data processing on the virtual resource during the live broadcast.
[0034] Optionally, the first data processing is data processing that depends on other processes, and the second data processing is data processing that does not depend on other processes.
[0035] According to a second aspect of an embodiment of the present disclosure, a module processing device is provided, including:
[0036] An acquisition module is configured to execute the acquisition of characteristic information of a target function module of a virtual resource application service; wherein the target function module is used to process data of the virtual resource during the live broadcast, and the characteristic information represents the dependency relationship between the target function module and other function modules during the data processing of the virtual resource;
[0037] The first encapsulation module is configured to execute encapsulation of the target function module when the characteristic information meets a preset condition to generate a first process corresponding to the target function module, wherein the first process is used to perform a first data processing on the virtual resource during a live broadcast, and the preset condition is that the characteristic information represents that the target function module depends on the other function modules during the data processing of the virtual resource.
[0038] Optionally, the other functional modules include other functional modules in the virtual resource application service, and the acquisition module is specifically configured to execute the acquisition of the first external interface information of the target functional module; wherein the characteristic information includes the first external interface information, and the first external interface information represents the calling relationship between the target functional module and other functional modules in the virtual resource application service during the data processing of the virtual resource;
[0039] The first encapsulation module is specifically configured to encapsulate the target function module when the first external interface information indicates that the target function module is called by other function modules in the virtual resource application service during data processing of the virtual resource, so as to generate a first process corresponding to the target function module.
[0040] Optionally, the device further comprises:
[0041] A second encapsulation module is configured to execute encapsulation of the call request when a call request of a function module in the other function modules to call the target function module is obtained;
[0042] A serialization module is configured to serialize the encapsulated call request to generate a byte stream; wherein the byte stream is used to request the first process to call the target function module;
[0043] The sending module is configured to execute sending the byte stream to the first process, and the first process responds to the byte stream to call the target function module.
[0044] Optionally, the acquisition module is specifically configured to execute acquisition of business change information of the target functional module; wherein the characteristic information includes the business change information, and the business change information represents the association relationship between the target functional module and other functional modules in the virtual resource application service during the data processing of the virtual resource;
[0045] The first encapsulation module is specifically configured to perform encapsulation of the target function module to generate a first process corresponding to the target function module when the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resource;
[0046] Among them, when the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
[0047] Optionally, the device further comprises:
[0048] The exit module is configured to exit the first process when a service change request for the target functional module is obtained, so as to perform service change on the target functional module.
[0049] Optionally, the other functional modules include functional modules outside the virtual resource application service, and the acquisition module is specifically configured to execute acquisition of the second external interface information of the target functional module; the characteristic information includes the second external interface information of the target functional module, and the second external interface information represents the calling relationship or data processing relationship between the target functional module and the functional module outside the virtual resource application service during the data processing of the virtual resource;
[0050] The first encapsulation module is specifically configured to encapsulate the target function module to generate a first process corresponding to the target function module when the second external interface information indicates that the target function module is called by a function module outside the virtual resource application service during data processing of the virtual resource, or when the second external interface information indicates that there is asynchronous processing between the data processing of the virtual resource by the target function module and the data processing by the function module outside the virtual resource application service.
[0051] Optionally, the device further comprises:
[0052] A third encapsulation module is specifically configured to execute, when the characteristic information does not meet the preset condition, encapsulating the target function module into a second process corresponding to other function modules in the virtual resource application service;
[0053] The second process is used to perform second data processing on the virtual resource during the live broadcast.
[0054] Optionally, the first data processing is data processing that depends on other processes, and the second data processing is data processing that does not depend on other processes.
[0055] According to a third aspect of an embodiment of the present disclosure, a server is provided, including:
[0056] processor;
[0057] a memory for storing instructions executable by the processor;
[0058] The processor is configured to execute the instructions to implement the module processing method described in any one of the first aspects.
[0059] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided. When instructions in the storage medium are executed by a processor of a server, the server is enabled to execute the module processing method described in any one of the first aspects:
[0060] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising: executable instructions, which, when executed on a computer, enable the computer to execute the module processing method described in any one of the first aspects.
[0061] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0062] By obtaining the characteristic information of the target function module of the virtual resource application service that processes the data of the virtual resource during the live broadcast, and when the characteristic information of the target function module indicates that the target function module depends on other function modules in the process of processing the data of the virtual resource, the target function module is encapsulated to generate the first process corresponding to the target function module. In this way, by servitizing the target function module that depends on other function modules, if the target function module needs to be changed later, only the relevant content of the target function module needs to be changed, which can avoid the situation where the API cluster of the entire virtual resource application service needs to be deployed and updated due to the complex code dependency of the target function module, thereby improving the flexibility of virtual resource application service changes.
[0063] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0065] Figure 1 is a flowchart of a module processing method according to an exemplary embodiment;
[0066] Figure 2 It is a diagram of the dependency relationship between the functional modules in the pet application service;
[0067] Figure 3 is a block diagram of a module processing device according to an exemplary embodiment;
[0068] Figure 4 It is a block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION
[0069] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0070] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0071] Figure 1 is a flowchart of a module processing method according to an exemplary embodiment. Figure 1 As shown, the module processing method is used in a server and includes the following steps.
[0072] In step S101, characteristic information of a target function module of a virtual resource application service is obtained; wherein the target function module is used to process data of virtual resources during live broadcasting, and the characteristic information represents the dependency relationship between the target function module and other function modules during data processing of the virtual resources;
[0073] In step S102, when the characteristic information meets the preset conditions, the target function module is encapsulated to generate a first process corresponding to the target function module, wherein the first process is used to perform a first data processing on the virtual resources during the live broadcast, and the preset condition is that the characteristic information characterizes that the target function module depends on the other function modules during the data processing of the virtual resources.
[0074] In step S101, the virtual resource application service is a service of a virtual resource application program, which is set in a server, specifically a process that provides services for the virtual resource application program. The virtual resources in the virtual resource application service can be pets, virtual farms, etc. In the following embodiments, the virtual resources will be described in detail using pets as an example.
[0075] For example, for the pet application of the client, the server can set up a process of the pet application service, the purpose of which is to provide services for the pet during the live broadcast of the pet application of the client. The pet application service includes multiple functional modules, each of which is used to process the data of the pet during the live broadcast to provide corresponding services, such as establishing social relationships for the pet, providing social services for the pet, updating the rations fed to the pet, and providing a list service for the pet.
[0076] The pet application service can usually include at least two functional modules. Figure 2 , Figure 2 This is a diagram of the dependency relationships of the functional modules in the pet application service. Figure 2 As shown, the pet application service may include a list module, a social module, a basic information module, a backpack module, an experience module, and a task module. These function modules are usually processed in a code dependency manner, that is, when a function module calls another function module to access the relevant content of the other function module, the function module directly calls the other function module through the code dependency relationship between the function module and the other function module.
[0077] At the same time, the functional modules in the pet application service can depend on the client through the API interface. That is to say, the client can call the pet application service through the API interface to access the relevant content of the pet application service. For example, for the pet application, during the live broadcast, the client can call the basic information module of the pet application service through the API interface to provide pet information display service, that is, display the basic information of the pet to the client.
[0078] In addition, the functional modules in the pet application service can also rely on the functional modules outside the virtual resource application service. The functional modules outside the virtual resource application service can be called external services in addition to the internal services provided by the virtual resource application service itself, that is, the functional modules in the pet application service can rely on external services, and there are three ways to rely on external services. The first is that the external service can call the pet application service through the data protocol to access the relevant content of the functional module in the pet application service. The second is that the functional module in the pet application service can also call the external service through the data protocol to access the relevant content of the external service. For example, for the backpack module in the pet application service, it can call the external service to obtain the relevant item information in the backpack. The third is that the functional module in the pet application service can asynchronously process external service messages. For example, for the task module in the pet application service, it can asynchronously process external service messages such as likes, comments and gifts to realize the tasks of the pet application service such as likes, comments and gifts. Among them, the external service refers to the service scope that does not belong to the pet application service.
[0079] The target functional module may be any functional module in the virtual resource application service, which is used to perform data processing on the virtual resources during the live broadcast process.
[0080] Since the dependency relationship between each functional module and other functional modules in the pet application service is different, each functional module in the pet application service has its corresponding characteristic information. For the target functional module, its characteristic information can characterize the dependency relationship between the target functional module and other functional modules in the process of processing pet data.
[0081] There may be a variety of information representing the dependency of the target functional module on other functional modules during the process of processing data on pets. For example, the dependency between functional modules may be represented by an external interface, the characteristic information of the target functional module may include the external interface information, and the characteristic information of the target functional module may be obtained by obtaining the external interface information of the target functional module. When the external interface information indicates that there is a target external interface, it can be determined that the target functional module depends on other functional modules, and the target external interface is the external interface of the target functional module that depends on other functional modules.
[0082] Among them, the external interface information can include two types, namely the first external interface information and the second external interface information. The first external interface information is the information of the external interface on which the target functional module depends on the functional module in the pet application service, that is, the interface information called within the process. The second external interface information is the information of the external interface on which the target functional module depends on the external service, that is, the interface information called between processes.
[0083] The target function module depends on other function modules in the pet application service, which means that other function modules call the target function module to provide corresponding services during the data processing of the pet, that is, the target function module is not a single function module, but depends on other function modules in the pet application service to provide services for the pet. In this scenario, the target external interface is the external interface of other function modules calling the target function module.
[0084] The target function module depends on the external service, which means that the external service calls the target function module during the data processing of the pet, or the target function module can asynchronously process the message of the external service. In this scenario, the target external interface is the external interface of the target function module called by the external service or the external interface for asynchronous processing with the external service.
[0085] Of course, the call requests of other functional modules to call the target functional module can also be monitored to determine the first external interface information and the second external interface information of the target functional module. When the call requests of other functional modules to call the target functional module are monitored, or when the target functional module asynchronously processes messages of external services, it can be determined that the target functional module depends on other functional modules.
[0086] For example Figure 2 The basic information module in the pet application service shown above relies on many and diverse services, including API interfaces to obtain pet information and display it to the client, the task module to process task flows based on pet information, and the social module to query pet information to establish social relationships. Its dependency relationships are complex. For the list module, social module, and experience module, the dependent services are mainly API interfaces, and their dependency relationships are simple.
[0087] It can be determined whether the characteristic information of the target function module indicates that the target function module depends on other function modules in the process of processing pet data. If so, the target function module is encapsulated to generate a process corresponding to the target function module. The target function module is any one of the multiple function modules in the pet application service, that is, each function module in the pet application service can be judged accordingly to determine whether to perform service processing.
[0088] like Figure 2 As shown, for the basic information module in the pet application service, since this functional module depends on other functional modules in the process of pet data processing, for example, it depends on the task module, the task module needs to obtain the pet information from the basic information module to process the task flow, depends on the social module, the social module needs to query the pet information from the basic information module to establish social relationships, and also depends on the backpack module and the task module. Both the backpack module and the task module need to obtain the pet information from the basic information module to provide corresponding services.
[0089] Among them, the first process corresponding to the target function module is a new process relative to the second process of the pet application service. That is to say, after the target function module is encapsulated to generate the first process, for the pet application service, during the live broadcast process, it includes multiple processes to jointly provide services for pets.
[0090] If not, that is, the characteristic information does not meet the preset condition, the target function module may not be encapsulated separately, that is, the target function module may not be service-oriented separately, and the target function module may be encapsulated into the second process corresponding to other function modules in the virtual resource application service.
[0091] For another example, the dependency relationship between functional modules can be represented by business change information, and the characteristic information may include business change information. When the business change information represents that the target functional module has a business change, it is determined that the target functional module is associated with other functional modules in the virtual resource application service during the data processing of the virtual resource. When the business change information represents that the target functional module has no business change, it is determined that the target functional module is not associated with other functional modules in the virtual resource application service during the data processing of the virtual resource.
[0092] That is to say, when there is a business change in the target functional module, it is necessary to exit the entire process of the pet application service when the change occurs, that is, it is necessary to exit the entire process of the target functional module and other functional modules in order to modify the target functional module. At this time, the target functional module and other functional modules are associated through processes.
[0093] When the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during data processing of the virtual resource, the target function module is encapsulated to generate a first process corresponding to the target function module.
[0094] When the business change information indicates that the target function module has no association with other function modules in the virtual resource application service during data processing of the virtual resources, that is, when the characteristic information does not meet the preset conditions, the target function module is encapsulated into the second process corresponding to other function modules in the virtual resource application service.
[0095] Among them, the first process is used to perform the first data processing on the virtual resource during the live broadcast, and the second process is used to perform the second data processing on the virtual resource during the live broadcast, the first data processing is data processing that depends on other processes, and the second data processing is data processing that does not depend on other processes. In other words, the first process will be called by other processes during the data processing of the virtual resources, that is, it will depend on the data of other processes during the data processing, while the second process will not be called by other processes during the data processing of the virtual resources, and usually only calls between processes or calls other processes, that is, it will not depend on the data of other processes during the data processing.
[0096] In this embodiment, by obtaining the characteristic information of the target function module of the virtual resource application service that processes the data of the virtual resource during the live broadcast, and when the characteristic information of the target function module indicates that the target function module depends on other function modules in the process of processing the data of the virtual resource, the target function module is encapsulated to generate a first process corresponding to the target function module. In this way, by servitizing the target function module that depends on other function modules, that is, not a single function module, if the target function module needs to be changed, only the relevant content of the target function module needs to be changed. This can avoid the situation where the entire virtual resource application service API cluster needs to be deployed and updated due to the complex code dependency of the target function module, thereby improving the flexibility of virtual resource application service changes.
[0097] Moreover, based on the characteristic information of the functional modules, it is evaluated separately whether each functional module in the pet application service needs to be service-oriented. This can reasonably evaluate the functional modules that need to be service-oriented and avoid the complexity of service maintenance and reduced system stability caused by service-oriented processing of all functional modules.
[0098] Optionally, based on the first embodiment, the other functional modules include other functional modules in the virtual resource application service, and step S101 specifically includes:
[0099] Acquire the first external interface information of the target functional module; wherein the characteristic information includes the first external interface information, and the first external interface information represents the calling relationship between the target functional module and other functional modules in the virtual resource application service during the data processing of the virtual resource;
[0100] Correspondingly, when the characteristic information of the target functional module is represented by the first external interface information, step S102 specifically includes:
[0101] When the first external interface information indicates that the target function module is called by other function modules in the virtual resource application service during data processing of the virtual resource, the target function module is encapsulated to generate a process corresponding to the target function module.
[0102] The first external interface information of the target functional module may include the external interface type and the number of external interfaces of the target functional module.
[0103] In the pet application service, there are many types of calls to function modules, including: being called by other function modules, calling other function modules, being called by external services, calling external services, and asynchronously processing with other external services.
[0104] Correspondingly, the external interface types of the functional module may include multiple types. The first type is an API interface, which is connected to the pet application program of the client and is called in an API calling manner.
[0105] The second type is a direct call interface, which uses variable parameters to transfer information. In other words, the external interface is a dependency interface between functional modules in the pet application service. According to the information transfer method, the types of direct call interfaces can be divided into external interfaces of other functional modules calling target functional modules and target functional modules calling other functional modules. If the information transfer direction is that the variable parameters are transferred from other functional modules to the input of the target functional module, the external interface is the interface of other functional modules calling the target functional module. If the information transfer direction is that the variable parameters are transferred from the output of the target functional module to other functional modules, the external interface is the interface of the target functional module calling other functional modules.
[0106] The third type is an indirect call interface, which can be a transmission mechanism remote call (RPC, Remote Procedure Call) interface, and its calling method is the GRPC protocol calling method, which is used to call external services or be called by external services.
[0107] The external interface type of the target functional module can be obtained. If the external interface type of the target functional module includes a direct calling interface, and the direct calling interface includes external interfaces of other functional modules calling the target functional module, that is, the number of external interfaces of other functional modules calling the target functional module is greater than 0, then the first external interface information of the target functional module indicates that the target functional module depends on other functional modules in the pet application service, that is, it is determined that the target functional module is not a single functional module and needs to be service-oriented.
[0108] In this embodiment, the first external interface information of the target functional module is obtained, and whether the target functional module is a single functional module is determined based on the first external interface information. If not, the target functional module can be serviced. The evaluation method is simple and reliable.
[0109] Optionally, based on the first embodiment, after step S102, the method further includes:
[0110] In the case of obtaining a call request of a function module in the other function modules to call the target function module, encapsulating the call request;
[0111] Serializing the encapsulated call request to generate a byte stream; wherein the byte stream is used to request the first process to call the target function module;
[0112] The byte stream is sent to the first process, and the first process responds to the byte stream to call the target functional module.
[0113] In this embodiment, after the target functional module is service-oriented and a new independent process in the pet application service is generated, the pet application service can correspond to at least two processes, including a first process corresponding to the target functional module and a second process corresponding to other functional modules in the pet application service except the target functional module.
[0114] There are two ways to call between functional modules. One is in-process calling, that is, calling directly in the process. If the process includes multiple functional modules, the functional modules in the process can use this calling method to call other functional modules in the process. Specifically, in the process, if a call request is obtained for a functional module to call another functional module, the input parameters in the call request are obtained; the input parameters are passed to the other functional module to call the other functional module. After the call, if there are output parameters returned, the output parameters are directly returned to the functional module.
[0115] The other is an inter-process call, that is, a call is made through a preset protocol such as the GRPC protocol. If a functional module in other functional modules in the second process needs to call the target software module, this calling method can be used to call the target software module.
[0116] Specifically, the call request is encapsulated; the encapsulated call request is serialized to generate a byte stream; then, the byte stream is sent to the first process through the RPC interface, and the first process responds to the byte stream, deserializes and decapsulates the byte stream to obtain the call request, and calls the target software module. Then, if the call result needs to be returned, the call result is encapsulated and serialized to generate another byte stream, which is returned to the second process through the RPC interface, and the second process deserializes and decapsulates the byte stream to return the call result to the function module that calls the target function module.
[0117] In this embodiment, after the target software module is serviced, if the target software module needs to be called, the target software module can be called by using an inter-process calling method, which is simple.
[0118] Optionally, the other functional modules include functional modules outside the virtual resource application service, and the characteristic information includes second external interface information of the target functional module, wherein the second external interface information represents a calling relationship or data processing relationship between the target functional module and the functional module outside the virtual resource application service during data processing of the virtual resource;
[0119] The step of obtaining characteristic information of the target function module of the virtual resource application service comprises:
[0120] Acquire the second external interface information of the target functional module;
[0121] When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes:
[0122] When the second external interface information indicates that the target function module is called by a function module outside the virtual resource application service during data processing of the virtual resources, or when the second external interface information indicates that the data processing of the virtual resources by the target function module and the data processing by the function module outside the virtual resource application service are asynchronously processed, the target function module is encapsulated to generate a first process corresponding to the target function module.
[0123] In this embodiment, the second external interface information may also include the external interface type and the number of external interfaces of the target functional module.
[0124] The external interface type of the target functional module can be obtained. If the external interface type of the target functional module includes an indirect calling interface, and the indirect calling interface includes the external interface of the external service calling the target functional module, or includes the external interface of the target functional module asynchronously processing external service messages, that is, the number of dependent external services is greater than 0 or the deployment method of the dependent external service indicates that the target functional module has a dependency relationship with the external service, then the second external interface information of the target functional module indicates that the target functional module depends on the external service and needs to be service-oriented.
[0125] For example, the backpack module in the pet application service relies on a large number of external services and needs to be processed as a service. Another example is that the deployment mode of the task module in the pet application service is asynchronous with the target function module, that is, the task module can asynchronously process the messages of the external service and needs to be processed as a service.
[0126] In this embodiment, the second external interface information of the target functional module is obtained, and whether the target functional module depends on external services is determined based on the second external interface information. If not, the target functional module can be service-oriented. The evaluation method is simple and reliable.
[0127] Optionally, the step S101 includes:
[0128] Acquire the service change information of the target function module; wherein the characteristic information includes the service change information, and the service change information represents the association relationship between the target function module and other function modules in the virtual resource application service during the data processing of the virtual resource;
[0129] The step S102 includes:
[0130] When the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during data processing of the virtual resource, encapsulating the target function module to generate a first process corresponding to the target function module;
[0131] Among them, when the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
[0132] In this embodiment, the dependency relationship between the functional modules may be represented by business change information. The characteristic information may include business change information. The business change information represents whether there is a subsequent change requirement for the target functional module.
[0133] When the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
[0134] That is to say, when there is a business change in the target functional module, it is necessary to exit the entire process of the pet application service when the change occurs, that is, it is necessary to exit the entire process of the target functional module and other functional modules in order to modify the target functional module. At this time, the target functional module and other functional modules are associated through processes.
[0135] When the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during data processing of the virtual resource, the target function module is encapsulated to generate a first process corresponding to the target function module.
[0136] When the business change information indicates that the target function module has no association with other function modules in the virtual resource application service during data processing of the virtual resources, that is, when the characteristic information does not meet the preset conditions, the target function module is encapsulated into the second process corresponding to other function modules in the virtual resource application service.
[0137] In addition, according to the business logic change and business extension change, the business change information may include business logic variability parameters and business demand scalability parameters.
[0138] Among them, the business logic variability parameter of the functional module refers to the parameter of whether the business logic of the functional module changes frequently. For example, for the pet application service, the task module has many task strategies and changes frequently. The business logic variability parameter of the task module can be set to 1, while the logic of its list module is stable and the strategy is relatively stable. The business logic variability parameter of the list module can be set to 0.
[0139] The business demand scalability parameter of a functional module refers to whether the business demand of the functional module needs to maintain the expansion parameter. For example, for pet application services, there are many services that are processed asynchronously with the backpack module, so the demand changes frequently and scalability needs to be maintained. Therefore, the business demand scalability parameter of the backpack module can be set to 1. The basic information module stores the basic information of the pet, and the frequency of business demand changes is not high. Therefore, the business demand scalability parameter of the basic information module can be set to 0.
[0140] The business change information of the target functional module can be obtained by obtaining the business logic variability parameters and business demand scalability parameters of the target functional module.
[0141] When the business logic variability parameter of the target function module indicates that the business logic of the target function module has changed, and / or when the business requirement scalability parameter of the target function module indicates that the business requirement of the target function module has changed, the target function module can also be service-oriented.
[0142] For example, Figure 2 As shown, the business requirements of the backpack module change frequently, scalability needs to be maintained, and business logic changes frequently, so service-oriented processing is required.
[0143] Due to the large number of task types, the task module relies heavily on external services, has many business logic change points, and frequently changes task strategies. Therefore, service-oriented processing is required to support business logic changes and avoid the need for too many services to be deployed and updated, thereby reducing the change cycle and enabling application services to be quickly iterated and launched.
[0144] Optionally, after step S102, the method further includes:
[0145] When a service change request for the target functional module is obtained, the first process is exited to perform service changes on the target functional module.
[0146] Afterwards, when making changes to the target function module, when a business change request for the target function module is obtained, it is only necessary to exit the first process corresponding to the target function module and iteratively update the code of the target function module, so that the pet application service can be quickly iterated and launched.
[0147] Moreover, it is possible to avoid deploying and updating other functional modules and API interfaces that have dependencies on the target functional module, i.e., it is possible to avoid deploying and updating the API cluster of the entire pet application service. Therefore, there is no need to shut down other processes of the pet application service, and the use of other functions of the pet application service will not be affected.
[0148] In this embodiment, by servitizing the target function modules that are not single in the pet application service, a new process is generated. If the target function module needs to be changed later, only the relevant content of the target function module needs to be changed. This can avoid the need to deploy and update the API cluster of the entire pet application service due to the complex code dependencies of the target function module, thereby improving the flexibility of changes in the pet application service.
[0149] In addition, the number of change instances and change cycles can be reduced, so that pet application services can be quickly iterated and launched. When the target functional module is changed, it can also avoid bringing problematic codes from other functional modules online.
[0150] Figure 3 is a block diagram of a module processing device according to an exemplary embodiment. Figure 3 The device includes an acquisition module 301 and a first encapsulation module 302.
[0151] The acquisition module 301 is configured to execute the acquisition of characteristic information of a target function module of a virtual resource application service; wherein the target function module is used to process data of the virtual resource during the live broadcast, and the characteristic information represents the dependency relationship between the target function module and the other function modules during the data processing of the virtual resource;
[0152] The first encapsulation module 302 is configured to execute encapsulation of the target function module when the characteristic information meets a preset condition to generate a first process corresponding to the target function module, wherein the first process is used to perform a first data processing on the virtual resource during the live broadcast, and the preset condition is that the characteristic information characterizes that the target function module depends on the other function modules during the data processing of the virtual resource.
[0153] Optionally, the other functional modules include other functional modules in the virtual resource application service, and the acquisition module 301 is specifically configured to execute the acquisition of the first external interface information of the target functional module; wherein the characteristic information includes the first external interface information, and the first external interface information represents the calling relationship between the target functional module and other functional modules in the virtual resource application service during the data processing of the virtual resource;
[0154] The first encapsulation module 302 is specifically configured to encapsulate the target function module when the first external interface information indicates that the target function module is called by other function modules in the virtual resource application service during data processing of the virtual resource, so as to generate a first process corresponding to the target function module.
[0155] Optionally, the device further comprises:
[0156] A second encapsulation module is configured to execute encapsulation of the call request when a call request of a function module in the other function modules to call the target function module is obtained;
[0157] A serialization module is configured to serialize the encapsulated call request to generate a byte stream; wherein the byte stream is used to request the first process to call the target function module;
[0158] The sending module is configured to execute sending the byte stream to the first process, and the first process responds to the byte stream to call the target function module.
[0159] Optionally, the acquisition module 301 is specifically configured to execute acquisition of business change information of the target functional module; wherein the characteristic information includes the business change information, and the business change information represents the association relationship between the target functional module and other functional modules in the virtual resource application service during the data processing of the virtual resource;
[0160] The first encapsulation module 302 is specifically configured to perform encapsulation of the target function module to generate a first process corresponding to the target function module when the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resource;
[0161] Among them, when the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
[0162] Optionally, the device further comprises:
[0163] The exit module is configured to exit the first process when a service change request for the target functional module is obtained, so as to perform service change on the target functional module.
[0164] Optionally, the other functional modules include functional modules outside the virtual resource application service, and the acquisition module is specifically configured to execute acquisition of the second external interface information of the target functional module; the characteristic information includes the second external interface information of the target functional module, and the second external interface information represents the calling relationship or data processing relationship between the target functional module and the functional module outside the virtual resource application service during the data processing of the virtual resource;
[0165] The first encapsulation module is specifically configured to encapsulate the target function module to generate a first process corresponding to the target function module when the second external interface information indicates that the target function module is called by a function module outside the virtual resource application service during data processing of the virtual resource, or when the second external interface information indicates that there is asynchronous processing between the data processing of the virtual resource by the target function module and the data processing by the function module outside the virtual resource application service.
[0166] Optionally, the device further comprises:
[0167] A third encapsulation module is specifically configured to execute, when the characteristic information does not meet the preset condition, encapsulating the target function module into a second process corresponding to other function modules in the virtual resource application service;
[0168] The second process is used to perform second data processing on the virtual resource during the live broadcast.
[0169] Optionally, the first data processing is data processing that depends on other processes, and the second data processing is data processing that does not depend on other processes.
[0170] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0171] Figure 4 4 is a block diagram of a server according to an exemplary embodiment, including a processing component 401, which further includes one or more processors, and a memory resource represented by a memory 402 for storing instructions executable by the processing component 401, such as an application. The application stored in the memory 402 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 401 is configured to execute instructions to perform the following process:
[0172] Acquire characteristic information of a target function module of a virtual resource application service; wherein the target function module is used to process data of virtual resources during a live broadcast, and the characteristic information represents a dependency relationship between the target function module and other function modules during the data processing of the virtual resources;
[0173] When the characteristic information meets the preset conditions, the target function module is encapsulated to generate a first process corresponding to the target function module, wherein the first process is used to perform a first data processing on the virtual resources during the live broadcast, and the preset condition is that the characteristic information characterizes that the target function module depends on the other function modules during the data processing of the virtual resources.
[0174] Optionally, the other functional modules include other functional modules in the virtual resource application service, and the processing component 401 is specifically configured to execute:
[0175] Acquire the first external interface information of the target functional module; wherein the characteristic information includes the first external interface information, and the first external interface information represents the calling relationship between the target functional module and other functional modules in the virtual resource application service during the data processing of the virtual resource;
[0176] When the first external interface information indicates that the target function module is called by other function modules in the virtual resource application service during data processing of the virtual resource, the target function module is encapsulated to generate a first process corresponding to the target function module.
[0177] Optionally, the processing component 401 is further configured to execute:
[0178] In the case of obtaining a call request of a function module in the other function modules to call the target function module, encapsulating the call request;
[0179] Serializing the encapsulated call request to generate a byte stream; wherein the byte stream is used to request the first process to call the target function module;
[0180] The byte stream is sent to the first process, and the first process responds to the byte stream to call the target functional module.
[0181] Optionally, the processing component 401 is further configured to execute:
[0182] Acquire the service change information of the target function module; wherein the characteristic information includes the service change information, and the service change information represents the association relationship between the target function module and other function modules in the virtual resource application service during the data processing of the virtual resource;
[0183] When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes:
[0184] When the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during data processing of the virtual resource, encapsulating the target function module to generate a first process corresponding to the target function module;
[0185] Among them, when the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
[0186] Optionally, the processing component 401 is further configured to execute:
[0187] When a service change request for the target functional module is obtained, the first process is exited to perform service changes on the target functional module.
[0188] Optionally, the other functional modules include functional modules other than the virtual resource application service, and the processing component 401 is further configured to execute:
[0189] Acquire the second external interface information of the target function module; the characteristic information includes the second external interface information of the target function module, the second external interface information represents the calling relationship or data processing relationship between the target function module and the function module outside the virtual resource application service during the data processing of the virtual resource;
[0190] When the second external interface information indicates that the target function module is called by a function module outside the virtual resource application service during data processing of the virtual resources, or when the second external interface information indicates that the data processing of the virtual resources by the target function module and the data processing by the function module outside the virtual resource application service are asynchronously processed, the target function module is encapsulated to generate a first process corresponding to the target function module.
[0191] Optionally, the processing component 401 is further configured to execute:
[0192] In the case where the characteristic information does not satisfy the preset condition, encapsulating the target functional module into a second process corresponding to other functional modules in the virtual resource application service;
[0193] The second process is used to perform second data processing on the virtual resource during the live broadcast.
[0194] The server 400 may further include a power supply component 403 configured to perform power management of the server 400, a wired or wireless network interface 404 configured to connect the server 400 to a network, and an input / output (I / O) interface 405. The server 400 may operate based on an operating system stored in the memory 402, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, etc.
[0195] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 402 including instructions, and the above instructions can be executed by a processing component 401 of a server 400 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0196] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0197] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A module processing method, characterized in that: include: Acquire characteristic information of a target function module of a virtual resource application service; wherein the target function module is used to process data of virtual resources during a live broadcast, and the characteristic information represents a dependency relationship between the target function module and other function modules during the data processing of the virtual resources; In the case where the characteristic information satisfies a preset condition, encapsulating the target function module to generate a first process corresponding to the target function module, wherein the first process is used to perform a first data processing on the virtual resource during the live broadcast, and the preset condition is that the characteristic information indicates that the target function module depends on the other function modules during the data processing of the virtual resource; In the case where the characteristic information does not satisfy the preset condition, encapsulating the target functional module into a second process corresponding to other functional modules in the virtual resource application service; The second process is used to perform second data processing on the virtual resource during the live broadcast, and the second process will not be called by other processes during the data processing on the virtual resource; The other functional modules also include functional modules outside the virtual resource application service, and the characteristic information includes second external interface information of the target functional module, wherein the second external interface information represents a calling relationship or data processing relationship between the target functional module and the functional module outside the virtual resource application service during data processing of the virtual resource; When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes: When the second external interface information indicates that the target functional module's data processing of the virtual resource is asynchronous with the data processing of the functional module outside the virtual resource application service, the target functional module is encapsulated to generate a first process corresponding to the target functional module.
2. The module processing method according to claim 1, characterized in that: The other function modules include other function modules in the virtual resource application service, and the characteristic information includes first external interface information of the target function module, wherein the first external interface information represents the calling relationship between the target function module and other function modules in the virtual resource application service during data processing of the virtual resource; The step of obtaining characteristic information of the target function module of the virtual resource application service comprises: Acquire the first external interface information of the target functional module; When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes: When the first external interface information indicates that the target function module is called by other function modules in the virtual resource application service during data processing of the virtual resource, the target function module is encapsulated to generate a first process corresponding to the target function module.
3. The module processing method according to claim 2, characterized in that: After the step of encapsulating the target functional module to generate a first process corresponding to the target functional module, the method further includes: In the case of obtaining a call request of a function module in the other function modules to call the target function module, encapsulating the call request; Serializing the encapsulated call request to generate a byte stream; wherein the byte stream is used to request the first process to call the target function module; The byte stream is sent to the first process, and the first process responds to the byte stream to call the target functional module.
4. The module processing method according to claim 1, characterized in that: The characteristic information includes service change information, wherein the service change information represents the association relationship between the target function module and other function modules in the virtual resource application service during the data processing of the virtual resource; The step of obtaining characteristic information of the target function module of the virtual resource application service comprises: Obtaining business change information of the target functional module; When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes: When the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during data processing of the virtual resource, encapsulating the target function module to generate a first process corresponding to the target function module; Among them, when the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
5. The module processing method according to claim 1 or 4, characterized in that: After the step of encapsulating the target functional module to generate a first process corresponding to the target functional module, the method further includes: When a service change request for the target functional module is obtained, the first process is exited to perform service changes on the target functional module.
6. The module processing method according to claim 1, characterized in that: When the characteristic information satisfies a preset condition, the step of encapsulating the target function module to generate a first process corresponding to the target function module includes: When the second external interface information indicates that the target function module is called by a function module outside the virtual resource application service during data processing of the virtual resource, the target function module is encapsulated to generate a first process corresponding to the target function module.
7. The module processing method according to claim 1, characterized in that: The first data processing is data processing that depends on other processes, and the second data processing is data processing that does not depend on other processes.
8. A module processing device, characterized in that: include: an acquisition module configured to execute acquisition of characteristic information of a target function module of a virtual resource application service; wherein the target function module is used to process data of virtual resources during a live broadcast, and the characteristic information represents a dependency relationship between the target function module and other function modules during the data processing of the virtual resources, and the other function modules include other function modules in the virtual resource application service and / or function modules outside the virtual resource application service; A first encapsulation module is configured to perform encapsulation of the target function module to generate a first process corresponding to the target function module when the characteristic information satisfies a preset condition, wherein the first process is used to perform a first data processing on the virtual resource during a live broadcast, and the preset condition is that the characteristic information indicates that the target function module depends on the other function modules during the data processing of the virtual resource; A third encapsulation module is specifically configured to execute, when the characteristic information does not meet the preset condition, encapsulating the target function module into a second process corresponding to other function modules in the virtual resource application service; The second process is used to perform second data processing on the virtual resource during the live broadcast, and the second process will not be called by other processes during the data processing on the virtual resource; The other functional modules also include functional modules outside the virtual resource application service, and the characteristic information includes second external interface information of the target functional module, wherein the second external interface information represents a calling relationship or data processing relationship between the target functional module and the functional module outside the virtual resource application service during data processing of the virtual resource; The first encapsulation module is specifically configured to execute: When the second external interface information indicates that the target functional module's data processing of the virtual resource is asynchronous with the data processing of the functional module outside the virtual resource application service, the target functional module is encapsulated to generate a first process corresponding to the target functional module.
9. The module processing device according to claim 8, characterized in that: The other function modules include other function modules in the virtual resource application service, and the acquisition module is specifically configured to execute the acquisition of the first external interface information of the target function module; wherein the characteristic information includes the first external interface information, and the first external interface information represents the calling relationship between the target function module and other function modules in the virtual resource application service during the data processing of the virtual resource; The first encapsulation module is specifically configured to encapsulate the target function module when the first external interface information indicates that the target function module is called by other function modules in the virtual resource application service during data processing of the virtual resource, so as to generate a first process corresponding to the target function module.
10. The module processing device according to claim 9, characterized in that: The device also includes: A second encapsulation module is configured to encapsulate the call request when a call request of a function module in the other function modules to call the target function module is obtained; A serialization module is configured to perform serialization on the encapsulated call request to generate a byte stream; wherein the byte stream is used to request the first process to call the target function module; The sending module is configured to execute sending the byte stream to the first process, and the first process responds to the byte stream to call the target function module.
11. The module processing device according to claim 8, characterized in that: The acquisition module is specifically configured to execute acquisition of the service change information of the target functional module; wherein the characteristic information includes the service change information, and the service change information represents the association relationship between the target functional module and other functional modules in the virtual resource application service during the data processing of the virtual resource; The first encapsulation module is specifically configured to perform encapsulation of the target function module to generate a first process corresponding to the target function module when the service change information indicates that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resource; Among them, when the business change information indicates that there is a business change in the target function module, it is determined that the target function module is associated with other function modules in the virtual resource application service during the data processing of the virtual resources; when the business change information indicates that there is no business change in the target function module, it is determined that the target function module is not associated with other function modules in the virtual resource application service during the data processing of the virtual resources.
12. The module processing device according to claim 8 or 11, characterized in that: The device also includes: The exit module is configured to exit the first process when a service change request for the target functional module is obtained, so as to perform service change on the target functional module.
13. The module processing device according to claim 8, characterized in that: The first encapsulation module is specifically configured to encapsulate the target function module when the second external interface information indicates that the target function module is called by a function module outside the virtual resource application service during data processing of the virtual resource, so as to generate a first process corresponding to the target function module.
14. The module processing device according to claim 8, characterized in that: The first data processing is data processing that depends on other processes, and the second data processing is data processing that does not depend on other processes.
15. A server, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the module processing method as described in any one of claims 1 to 7.
16. A storage medium, when instructions in the storage medium are executed by a processor of a server, enables the server to execute the module processing method according to any one of claims 1 to 7.
