Business processing method and apparatus, electronic device, and storage medium

By encapsulating different business names in the server and deploying business execution files independently, the problem of low business processing efficiency in traditional architecture is solved, and efficient business processing and independent component management are achieved.

CN114816589BActive Publication Date: 2025-11-28SHANGHAI ZHONG YUAN NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210395355.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2025-11-28
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

In traditional architectures, business modules are deployed under a large project, resulting in low business processing efficiency and high costs and resource waste in managing microservices.

Method used

Different business execution files are encapsulated for different business names on the server and deployed independently, so that the business execution files are isolated from each other. After receiving a business processing request, only the file corresponding to the business name is executed, and the processing result is obtained and sent.

Benefits of technology

It improves the efficiency of business processing, reduces maintenance workload, lowers server performance consumption, and supports independent component version management for different business execution files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114816589B_ABST
    Figure CN114816589B_ABST
Patent Text Reader

Abstract

The application relates to a business processing method and device, electronic equipment and a storage medium, and relates to the technical field of Internet. The method comprises the following steps: receiving a business processing request sent by a client, wherein the business processing request carries a business name; obtaining full path information of a business execution file corresponding to the business name, wherein different business execution files correspond to different business names, and different business execution files are isolated from each other; based on the full path information, obtaining and executing the business execution file corresponding to the business name to obtain a business processing result; and sending the business processing result to the client. Since the business execution files are isolated from each other, when the server receives the business processing request of the client, only the business execution file corresponding to the business name in the business processing request needs to be executed, so that the efficiency of business processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet, and particularly relates to a service processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the development of micro-service architecture, there is a considerable cost to manage micro-services, especially the waste of physical resources by micro-services, and the additional workload of configuring monitoring, log collection and other basic modules for each service, which makes developers tend to use lower-cost traditional architecture when facing a large number of non-core business module development. However, in the traditional architecture, all business modules are deployed in a huge project, and there is strong coupling between various business modules. As the business continues to expand, the project will become more and more bloated, resulting in low business processing efficiency when processing a single business.

[0003] Therefore, how to improve the low business processing efficiency of the traditional architecture has become a technical problem to be solved. SUMMARY

[0004] The present application provides a service processing method and device, electronic equipment and storage medium to solve the problem of low efficiency of developing and debugging business modules through traditional architecture.

[0005] In a first aspect, the present application provides a service processing method applied to a server, the method comprising:

[0006] receiving a service processing request sent by a client, the service processing request carrying a business name;

[0007] obtaining full path information of a business execution file corresponding to the business name, wherein different business execution files correspond to different business names, and different business execution files are isolated from each other;

[0008] based on the full path information, obtaining and executing the business execution file corresponding to the business name to obtain a service processing result;

[0009] sending the service processing result to the client.

[0010] In a second aspect, the present application further provides a service processing device applied to a server, the device comprising:

[0011] a first receiving module configured to receive a service processing request sent by a client, the service processing request carrying a business name;

[0012] The acquisition module is configured to acquire full path information of a service execution file corresponding to the service name, wherein different service execution files correspond to different service names, and different service execution files are isolated from each other.

[0013] The processing module is configured to acquire and execute the service execution file corresponding to the service name based on the full path information, and obtain a service processing result.

[0014] The first sending module is configured to send the service processing result to the client.

[0015] In a third aspect, the present application further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus.

[0016] The memory is configured to store a computer program.

[0017] The processor is configured to execute the program stored on the memory, and implement the steps of the service processing method according to any one of the first aspect.

[0018] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the service processing method according to any one of the first aspect.

[0019] Compared with the prior art, the above technical solution provided by the embodiments of the present application has the following advantages:

[0020] The method provided by the embodiments of the present application comprises the following steps: receiving a service processing request sent by a client, wherein the service processing request carries a service name; acquiring full path information of a service execution file corresponding to the service name, wherein different service execution files correspond to different service names, and different service execution files are isolated from each other; acquiring and executing the service execution file corresponding to the service name based on the full path information, and obtaining a service processing result; and sending the service processing result to the client. In this way, different service execution files can be encapsulated for different service names in the server, and each service execution file can be independently deployed, so that the service execution files are isolated from each other. In this way, when the server receives the service processing request of the client, only the service execution file corresponding to the service name in the service processing request needs to be executed, thereby improving the efficiency of service processing. BRIEF DESCRIPTION OF DRAWINGS

[0021] The accompanying drawings, which are incorporated into and form a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating a business processing method provided in an embodiment of this application;

[0024] Figure 2 A flowchart illustrating another business processing method provided in an embodiment of this application;

[0025] Figure 3 A schematic diagram illustrating the dependency relationship between the core code files and business execution files on the server and the UIS provided in this application embodiment;

[0026] Figure 4 This is a schematic diagram of the business processing flow between the client and the server provided in the embodiments of this application;

[0027] Figure 5 This is a schematic diagram of the structure of a service processing device provided in an embodiment of this application;

[0028] Figure 6 This is a schematic diagram of another business processing apparatus provided in an embodiment of this application;

[0029] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] See Figure 1 , Figure 1 This is a flowchart illustrating a business processing method provided in an embodiment of this application. Figure 1 As shown, this business processing method is applied to a server, and the method may include the following steps:

[0032] Step 101: Receive the service processing request sent by the client. The service processing request carries the service name.

[0033] Specifically, the service processing request can be a processing request of any service, such as a data query, data deletion, data modification, and the like. The service processing request can be a request generated based on a Hyper Text Transfer Protocol (HTTP) protocol, which can carry a service name. The service name is used to represent the type of service to be processed by the service processing request. In an optional embodiment, a serviceName field can be used to represent the service name.

[0034] In step 102, full path information of a service execution file corresponding to the service name is obtained. Different service execution files correspond to different service names, and different service execution files are isolated from each other.

[0035] Specifically, the service execution file refers to a file responsible for implementing the execution logic of a certain type of service, such as a jar package or the like. The full path information refers to a path starting with / , which represents the process from the project root directory to the target resource.

[0036] It should be noted that one or more service execution files can be pre-deployed on the server, and each service execution file is used to execute a type of service processing logic. Different service execution files execute different service processing logics, and different service execution files are isolated and decoupled from each other. In addition, core code (such as servlet, log, and the like) files can also be pre-deployed on the server, and these core code files are isolated and decoupled from the service execution files.

[0037] In this step, after receiving the service processing request, the server can parse the service processing request to obtain the service name, and then find the full path information of the service execution file corresponding to the service name from the database according to the service name.

[0038] In step 103, the service execution file corresponding to the service name is obtained and executed based on the full path information, and a service processing result is obtained.

[0039] In this step, the server can obtain the service execution file corresponding to the service name according to the full path information of the service execution file corresponding to the service name, load the service implementation class in the service execution file, execute the processing logic in the service execution file, and finally obtain the service processing result.

[0040] In step 104, the service processing result is sent to the client.

[0041] In this step, after obtaining the service processing result, the server can send the service processing result to the client, and the client receives and displays the service processing result to the user, thereby realizing the request-response whole process of service processing.

[0042] In the embodiment, different service execution files can be encapsulated for different service names in the server, and each service execution file is independently deployed to isolate the service execution files from each other. In this way, when the server receives a service processing request from a client, the server only needs to execute the service execution file corresponding to the service name in the service processing request, thereby improving the efficiency of service processing.

[0043] Further, the step 102 of obtaining the full path information of the service execution file corresponding to the service name comprises:

[0044] According to the service name and a first preset mapping relationship, a service implementation class name corresponding to the service name is determined, and based on the service implementation class name, the full path information of the service execution file corresponding to the service name is determined, wherein the first preset mapping relationship is used to represent the mapping relationship between the service name and the service implementation class name; or

[0045] According to the service name and a second preset mapping relationship, the full path information of the service execution file corresponding to the service name is determined, wherein the second preset mapping relationship is used to represent the mapping relationship between the service name and the full path information of the service execution file.

[0046] In an optional embodiment, the server is preconfigured with the first preset mapping relationship, and the first preset mapping relationship includes the service name and the service implementation class name corresponding to the service name. The first preset mapping relationship can be stored in the form of key-value in a redis, a mysql or other database of the server. After obtaining the service name carried in the service processing request, the server can match the service name with the service name in the first preset mapping relationship, so as to determine the service implementation class name corresponding to the service name, and then determine the full path information of the service execution file corresponding to the service name based on the service implementation class name. In this way, the server can accurately obtain the full path information of the corresponding service execution file based on the service name.

[0047] In another optional embodiment, the server is preconfigured with the second preset mapping relationship, and the second preset mapping relationship includes the service name and the full path information of the service execution file corresponding to the service name. The second preset mapping relationship can be stored in the form of key-value in a redis, a mysql or other database of the server. After obtaining the service name carried in the service processing request, the server can match the service name with the service name in the second preset mapping relationship, so as to determine the full path information of the service execution file corresponding to the service name. In this way, the server can accurately obtain the full path information of the corresponding service execution file based on the service name.

[0048] Further, the step of determining the full path information of the business execution file corresponding to the business name based on the business implementation class name comprises:

[0049] The business implementation class name, the preset prefix and the preset suffix are spliced to obtain the full path information of the business execution file corresponding to the business name, wherein the preset prefix is a uniform storage path of all business execution files on the server on the server, and the preset suffix is a uniform file type of all business execution files on the server.

[0050] In an embodiment, all business execution files are uniformly deployed under a specified directory of the server, and the directory is taken as the preset prefix, so that all business execution files have the same preset prefix. In addition, all business execution files adopt a uniform file type, such as a jar package, so that all business execution files have the same preset suffix.

[0051] When the server obtains the business name carried in the business processing request, the business name can be matched with the business name in the first preset mapping relationship, so as to determine the business implementation class name corresponding to the business name, and then the business implementation class name, the preset prefix and the preset suffix are spliced, that is, the combination of the preset prefix + the business implementation class name + the preset suffix ".jar" is used to find the jar package where the business implementation class is located, so as to obtain the full path information of the business execution file corresponding to the business name. For example, it is assumed that the preset prefix is "com.uis.business.api.", the preset suffix is ".jar", and the business implementation class name is "ServiceA", so the jar package path of the business implementation class name is "com.uis.business.api.ServiceA.jar".

[0052] In the embodiment, by uniformly deploying all business execution files under a specified directory of the server, it is beneficial to reduce the maintenance amount of the business execution files and the first preset mapping table.

[0053] Further, the step of determining the full path information of the business execution file corresponding to the business name based on the business implementation class name comprises:

[0054] The business execution file corresponding to the full path information is obtained;

[0055] The target business implementation class in the business execution file corresponding to the full path information is loaded and initialized through a preset dependency relationship, the preset dependency relationship refers to a dependency relationship of all business execution files on the server on a preset service, and the preset service is used to define a business execution method in the business implementation class corresponding to each business execution file;

[0056] The service execution method in the initialized target service implementation class is called to obtain a service processing result.

[0057] Specifically, the preset dependency relationship refers to a dependency relationship of all service execution files on the server on a preset service. Each service execution file needs to import a dependency on the preset service. In this way, the core code file on the server can obtain a service implementation class in real time according to the preset service on which it depends, and call a service processing method of the corresponding service implementation class to execute service processing logic. The preset service herein is used to reflectively load the service execution file. Its core is to provide a protocol (or interface) that has at least one service execution method for agreeing on a data interaction format between the client and the server. As an optional real-time manner, the preset service can be defined as a unified invocation service (UIS). Any server project that imports the dependency of the UIS can obtain a service implementation class UnifiedInvocationHelper through reflection and instant loading. The service processing logic is completed by executing the service execution method invoke() in the service implementation class UnifiedInvocationHelper.

[0058] In this embodiment, the server can load a target service implementation class in the service execution file corresponding to the full path information through a preset dependency relationship after obtaining the service execution file, and initialize the target service implementation class, so as to call a service execution method in the initialized target service implementation class to obtain a service processing result. Compared with the prior art in which the core code and different service execution codes on the server are stored in the same file, and the related codes in the entire file need to be executed when a service request is processed, the service processing method in this embodiment only needs to process a single service execution file, and thus is more efficient.

[0059] Further, after the target service implementation class in the service execution file corresponding to the full path information is loaded and initialized through the preset dependency relationship, the method further includes:

[0060] The target service implementation class is cached in a local cache of the server, so that the server can directly call a service execution method in the target service implementation class to obtain a service processing result in a case where the server receives a service processing request sent by the client;

[0061] In a case where it is detected that the service execution file corresponding to the full path information is offline, the target service implementation class is deleted from the local cache.

[0062] In an embodiment, the server needs to reflectively load the business implementation class in the business execution file each time it receives a business processing request. Frequent dynamic loading causes the performance of the server to decrease. Therefore, the target business implementation class can be cached in the local cache of the server to reduce the number of times of reflective loading, thereby ensuring the performance of the server. The overall process can be understood as follows. Since the target implementation class corresponding to the business name such as serviceName can be obtained, the business execution method invoke() in the target implementation class is executed, and the business execution result is obtained. The target implementation class corresponding to the same business name serviceName will not be frequently changed. Therefore, the cache can be set for the target implementation class. When the client-side transmits the business name serviceName, the local cache only needs to be checked to know the specific target implementation class, and the database does not need to be queried, the class loader does not need to be initialized, and the business implementation class does not need to be initialized. Instead, the target implementation class is directly obtained from the cache to save processing time. Moreover, when it is detected that the business execution file corresponding to the full path information is offline, the target business implementation class also needs to be deleted from the local cache to prevent subsequent requests from still being able to obtain the response of the offline business.

[0063] Further, all business execution files are deployed separately from the core function files of the server, and all business execution files are uniformly deployed on the local server or in the cloud. When all business execution files are uniformly deployed in the cloud, the server remotely loads the business execution file corresponding to the business name through the network.

[0064] In an embodiment, all business execution files can be uniformly deployed on the local server or in the cloud, and the present application does not make specific limitations. When all business execution files are uniformly deployed in the cloud, the configuration center of the cloud can be used to uniformly manage the business execution files. When the business execution file needs to be loaded, the business execution file corresponding to the business name can be remotely loaded through the network. In this way, the separation of the business execution file and the core code file of the server can be better implemented, and other servers can also conveniently access these business execution files.

[0065] Further, the versions of the business components relied on by different business execution files are different.

[0066] In an embodiment, since each business execution file is independently deployed, the version of the business component relied on by each business execution file is also independent, that is, the versions of the business components relied on by different business execution files can be different. The business component here refers to a business-related component required by the business execution file, such as the fastjson component for parsing json, and each business execution file can maintain the version of the business component required by itself, such as the fastjson of the a business execution file can be version 1.2.70, the fastjson of the b business execution file can be version 1.2.68, and so on. In this way, different versions of fastjson behave differently when processing different json strings. Compared with the single-point application of the traditional architecture, if fastjson is to be introduced, only one version can be configured globally, and different versions of the same dependency cannot be used according to business needs.

[0067] Referring to Figure 2 , Figure 2 Another flowchart of a business processing method provided by an embodiment of the present application is shown in FIG. 6. As shown in FIG. 6, the business processing method is applied to a client, and the method can include the following steps: Figure 2

[0068] Step 201, a business processing request is sent to a server, wherein the business processing request carries a business name, the server is used to obtain full path information of a business execution file corresponding to the business name, and based on the full path information, the business execution file corresponding to the business name is obtained and executed to obtain a business processing result, wherein different business execution files correspond to different business names, and different business execution files are isolated from each other;

[0069] Specifically, the above business processing request can be a processing request for any business, such as a processing request for data query, data deletion, data modification, and the like. The business processing request can be a request generated based on the Hyper Text Transfer Protocol (HTTP) protocol, and the request can carry a business name. The business name is used to represent the type of business to be processed by the business processing request. In an optional embodiment, the serviceName field can be used to represent the business name. The above business execution file refers to a file responsible for implementing the execution logic of a certain type of business, such as a jar package. The above full path information refers to a path starting with / , which is used to represent the process from the project root directory to the target resource.

[0070] ​In this step, the client can generate a service processing request based on the input operation of the user, and send the service processing request to the server. At this time, the server can parse the service processing request to obtain a service name, and then search for full path information of a service execution file corresponding to the service name from a database according to the service name. The server can obtain the service execution file corresponding to the service name according to the full path information of the service execution file corresponding to the service name obtained by searching, load a service implementation class in the service execution file, execute processing logic in the service execution file, and finally obtain a service processing result.

[0071] Step 202, receiving the service processing result sent by the server.

[0072] After obtaining the service processing result, the server can send the service processing result to the client, and the client receives and displays the service processing result to the user, thereby realizing the request-response whole process of service processing.

[0073] In this embodiment, different service execution files can be encapsulated for different service names in the server, and each service execution file is independently deployed, so that the service execution files are isolated from each other. In this way, when the server receives the service processing request of the client, only the service execution file corresponding to the service name in the service processing request needs to be executed, thereby improving the efficiency of service processing.

[0074] In an embodiment, in order to improve the efficiency of service processing, different business codes need to be isolated and decoupled when deploying the service execution file, such as encapsulating the core code and each business code of the server into a corresponding jar package. In this way, when a single business is changed, the influence range is limited to a single jar package, and the core code of the server can load the class file in the corresponding business interface jar package through reflection technology to execute the corresponding business processing logic. Here, the reflection technology of the server needs to rely on a pre-defined unified invocation service (Unified Invocation Service, UIS) to realize. Any server core code file that introduces the UIS dependency can obtain the business implementation class in the service execution file through reflection and instant loading, and then execute the business implementation method invoke() of the business implementation class to query, modify, delete, and other businesses of the third-party data source, and complete the business processing logic. The dependency relationship of the core code file and the service execution file on the UIS on the server is as shown in Figure 3 .

[0075] It should be noted that the main role of the core code file on the server is to be responsible for receiving the service processing request sent by the client, calling the UIS service and returning the service processing result to the client, and the core code file includes a servlet module, a log module, a request response format definition and other basic service modules. The core code file on the server needs to introduce UIS dependency, and the UIS business implementation class is obtained in real time, and the invoke() method of the corresponding business implementation class is called to execute the business processing logic. The main role of the business execution file on the server is to be responsible for the actual business processing logic. The business execution file also needs to introduce UIS dependency, and the business implementation class in the business execution file needs to implement the invoke() method defined by UIS. The business execution file should be placed in the directory specified by the server project for reflection call. The server also needs to pre-configure a mapping table of business names and full paths of business execution files, so that the server can query the mapping table through the serviceName keyword (equivalent to the business name) transmitted by the client to find the full path of the corresponding business execution file and reflectively load the business implementation class therein.

[0076] In an optional embodiment, the business processing flow of the client and the server is as shown in Figure 4 The business processing flow includes the following steps:

[0077] Step 401, the client sends a service processing request to the server.

[0078] Step 402, the core code file of the server parses the service processing request, obtains the business name, and queries the database for the full path information of the business execution file corresponding to the business name;

[0079] Step 403, the database returns the full path information of the business execution file corresponding to the business name to the core code file of the server;

[0080] Step 404, the core code file of the server calls the preset service UIS;

[0081] Step 405, the preset service UIS obtains the corresponding business execution file according to the full path information, and loads the business implementation class in the business execution file;

[0082] Step 406, the business implementation class in the business execution file is initialized, and the business processing method is called to execute the business processing logic;

[0083] Step 407, after the business processing logic is executed, the business implementation class returns the service processing result to the preset service UIS;

[0084] Step 408, the core code file of the server returns the service processing result to the client.

[0085] In addition, the application further provides a service processing device. Referring to Figure 5 , Figure 5 A structural schematic diagram of a service processing device provided by an embodiment of the application is shown in the figure. As Figure 5 indicated, the service processing device 500 is applied to a server, and the device 500 comprises:

[0086] A first receiving module 501 is configured to receive a service processing request sent by a client, the service processing request carrying a service name;

[0087] A obtaining module 502 is configured to obtain full path information of a service execution file corresponding to the service name, wherein different service execution files correspond to different service names, and different service execution files are isolated from each other;

[0088] A processing module 503 is configured to obtain and execute the service execution file corresponding to the service name based on the full path information, to obtain a service processing result;

[0089] A first sending module 504 is configured to send the service processing result to the client.

[0090] Optionally, the obtaining module 502 comprises:

[0091] A first determining sub-module is configured to determine a service implementation class name corresponding to the service name according to the service name and a first preset mapping relationship, and determine the full path information of the service execution file corresponding to the service name based on the service implementation class name, wherein the first preset mapping relationship is used to represent a mapping relationship between the service name and the service implementation class name; or

[0092] A second determining sub-module is configured to determine the full path information of the service execution file corresponding to the service name according to the service name and a second preset mapping relationship, wherein the second preset mapping relationship is used to represent a mapping relationship between the service name and the full path information of the service execution file.

[0093] Optionally, the first determining sub-module is specifically configured to:

[0094] splicing the service implementation class name, a preset prefix and a preset suffix to obtain the full path information of the service execution file corresponding to the service name, wherein the preset prefix is a uniform storage path of all service execution files on the server, and the preset suffix is a uniform file type of all service execution files on the server.

[0095] Optionally, the processing module 503 comprises:

[0096] An obtaining sub-module is configured to obtain the service execution file corresponding to the full path information;

[0097] The processing submodule is configured to load and initialize a target business implementation class in a business execution file corresponding to the full path information according to a preset dependency relationship, the preset dependency relationship refers to a dependency relationship of all business execution files on a server on a preset service, and the preset service is configured to define a business execution method in the business implementation class corresponding to each business execution file;

[0098] The calling submodule is configured to call the business execution method in the initialized target business implementation class to obtain a business processing result.

[0099] Optionally, the processing submodule is specifically configured to:

[0100] cache the target business implementation class to a local cache of the server, so that the server directly calls the business execution method in the target business implementation class to obtain a business processing result in a case where the server receives a business processing request sent by the client;

[0101] delete the target business implementation class from the local cache in a case where it is detected that the business execution file corresponding to the full path information is offline.

[0102] Optionally, all the business execution files are deployed separately from a core function file of the server, and all the business execution files are uniformly deployed on the server locally or in the cloud; in a case where all the business execution files are uniformly deployed in the cloud, the server loads the business execution file corresponding to the business name remotely through a network.

[0103] Optionally, the versions of business components that are dependent on different business execution files are different.

[0104] It should be noted that the business processing apparatus 500 can implement any step of the business processing method of the above-mentioned Figure 1 embodiments, and achieve the same technical effects, which will not be repeated here.

[0105] Referring to Figure 6 , Figure 6 FIG. 6 is a structural schematic diagram of another business processing apparatus provided by the embodiments of the present application. As shown in the figure, the business processing apparatus 600 is applied to a client, and the apparatus 600 comprises: Figure 6

[0106] The second sending module 601 is configured to send a business processing request to a server, wherein the business processing request carries a business name, the server is configured to obtain full path information of a business execution file corresponding to the business name, and obtain and execute the business execution file corresponding to the business name based on the full path information to obtain a business processing result, wherein different business execution files correspond to different business names, and different business execution files are isolated from each other;

[0107] ​The second receiving module 602 is configured to receive the service processing result sent by the server.

[0108] It should be noted that the service processing apparatus 600 can implement any step of the service processing method of the above-mentioned Figure 2 embodiments, and achieve the same technical effects, which will not be repeated here.

[0109] As shown in the above-mentioned Figure 7 The embodiment of the present application provides an electronic device, which comprises a processor 711, a communication interface 712, a memory 713 and a communication bus 714, wherein the processor 711, the communication interface 712 and the memory 713 complete mutual communication through the communication bus 714,

[0110] The memory 713 is configured to store a computer program.

[0111] In an embodiment of the present application, the processor 711 is configured to execute the program stored in the memory 713, and implement the service processing method provided by any one of the above-mentioned method embodiments, comprising the following steps:

[0112] receiving the service processing request sent by the client, wherein the service processing request carries a service name;

[0113] obtaining full path information of a service execution file corresponding to the service name, wherein different service execution files correspond to different service names, and different service execution files are isolated from each other;

[0114] based on the full path information, obtaining and executing the service execution file corresponding to the service name to obtain a service processing result;

[0115] sending the service processing result to the client.

[0116] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the service processing method provided by any one of the above-mentioned method embodiments.

[0117] It has to be noted that, in the present document, relational terms are intended only to convey a possible relationship between elements or

[0118] The foregoing is considered as illustrative only of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, which modifications and changes are to be understood as intended to be encompassed by the general scope of the application. Accordingly, the application is not to be limited to the above described or illustrated embodiments that are merely given by way of example. It is also be understood that various combinations of the above described embodiments and variations thereof are encompassed by the application.

Claims

1. A service processing method characterized by, Applied to a server, the method comprises: receiving a service processing request sent by a client, the service processing request carrying a service name; obtaining full path information of a service execution file corresponding to the service name, wherein different service execution files correspond to different service names, and different service execution files are isolated from each other, the full path information comprising a service implementation class name, a preset prefix and a preset suffix, the preset prefix being a uniform storage path of all service execution files on the server, and the preset suffix being a uniform file type of all service execution files on the server; based on the full path information, obtaining and executing the service execution file corresponding to the service name to obtain a service processing result; sending the service processing result to the client; wherein, based on the full path information, obtaining and executing the service execution file corresponding to the service name to obtain a service processing result, comprises: obtaining the service execution file corresponding to the full path information; loading and initializing a target service implementation class in the service execution file corresponding to the full path information through a preset dependency relationship, the preset dependency relationship being a dependency relationship of all service execution files on the server on a preset service, each service execution file on the server needing to import a dependency on the preset service, the preset service being used to define a service execution method in the service implementation class corresponding to each service execution file; calling the service execution method in the initialized target service implementation class to obtain the service processing result; wherein, after loading and initializing the target service implementation class in the service execution file corresponding to the full path information through the preset dependency relationship, the method further comprises: caching the target service implementation class to a local cache of the server, so that the server can directly call the service execution method in the target service implementation class to obtain the service processing result in the case that the service processing request sent by the client is received; in the case that it is detected that the service execution file corresponding to the full path information is offline, deleting the target service implementation class from the local cache.

2. The method of claim 1, wherein, the full path information of the service execution file corresponding to the service name, comprising: determining the service implementation class name corresponding to the service name according to the service name and a first preset mapping relationship, and determining the full path information of the service execution file corresponding to the service name based on the service implementation class name, wherein the first preset mapping relationship is used to represent the mapping relationship between the service name and the service implementation class name; or determining the full path information of the service execution file corresponding to the service name according to the service name and a second preset mapping relationship, wherein the second preset mapping relationship is used to represent the mapping relationship between the service name and the full path information of the service execution file.

3. The method of claim 2, wherein, the full path information of the service execution file corresponding to the service name based on the service implementation class name, comprising: The business implementation class name, the preset prefix and the preset suffix are spliced to obtain full path information of the business execution file corresponding to the business name.

4. The method of claim 1, wherein, All business execution files are deployed separately from core function files of the server, and all business execution files are uniformly deployed on the server locally or in the cloud; in the case that all business execution files are uniformly deployed in the cloud, the server loads the business execution file corresponding to the business name remotely through a network.

5. The method of claim 1, wherein, Different business execution files depend on different versions of business components.

6. A service processing apparatus characterized by comprising: The device is applied to a server and includes: The first receiving module is configured to receive a service processing request sent by a client, the service processing request carrying a business name; The obtaining module is configured to obtain full path information of a business execution file corresponding to the business name, wherein different business execution files correspond to different business names, and different business execution files are isolated from each other, the full path information including a business implementation class name, a preset prefix and a preset suffix, the preset prefix being a uniform storage path of all business execution files on the server, and the preset suffix being a uniform file type of all business execution files on the server; The processing module is configured to obtain and execute the business execution file corresponding to the business name based on the full path information to obtain a service processing result; The first sending module is configured to send the service processing result to the client; The processing module includes: The obtaining submodule is configured to obtain the business execution file corresponding to the full path information; The processing submodule is configured to load and initialize a target business implementation class in the business execution file corresponding to the full path information through a preset dependency relationship, the preset dependency relationship being a dependency relationship of all business execution files on the server on a preset service, each business execution file on the server needing to introduce a dependency on the preset service, and the preset service being configured to define a business execution method in a business implementation class corresponding to each business execution file; The calling submodule is configured to call the business execution method in the initialized target business implementation class to obtain the service processing result. The processing submodule is specifically configured to: cache the target business implementation class to a local cache of the server, so that the server directly calls the business execution method in the target business implementation class to obtain the service processing result when the server receives the service processing request sent by the client; and delete the target business implementation class from the local cache when it is detected that the business execution file corresponding to the full path information is offline.

7. An electronic device, comprising: The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is configured to store a computer program; The processor is configured to execute the program stored in the memory to implement the steps of the service processing method in any one of claims 1-5. The device is applied to a server and includes: The first receiving module is configured to receive a service processing request sent by a client, the service processing request carrying a business name; The obtaining module is configured to obtain full path information of a business execution file corresponding to the business name, wherein different business execution files correspond to different business names, and different business execution files are isolated from each other, the full path information including a business implementation class name, a preset prefix and a preset suffix, the preset prefix being a uniform storage path of all business execution files on the server, and the preset suffix being a uniform file type of all business execution files on the server; The processing module is configured to obtain and execute the business execution file corresponding to the business name based on the full path information to obtain a service processing result; The first sending module is configured to send the service processing result to the client; The processing module includes: The obtaining submodule is configured to obtain the business execution file corresponding to the full path information; The processing submodule is configured to load and initialize a target business implementation class in the business execution file corresponding to the full path information through a preset dependency relationship, the preset dependency relationship being a dependency relationship of all business execution files on the server on a preset service, each business execution file on the server needing to introduce a dependency on the preset service, and the preset service being configured to define a business execution method in a business implementation class corresponding to each business execution file; The calling submodule is configured to call the business execution method in the initialized target business implementation class to obtain the service processing result. The processing submodule is specifically configured to: cache the target business implementation class to a local cache of the server, so that the server directly calls the business execution method in the target business implementation class to obtain the service processing result when the server receives the service processing request sent by the client; and delete the target business implementation class from the local cache when it is detected that the business execution file corresponding to the full path information is offline. The device includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is configured to store a computer program; The processor is configured to execute the program stored in the memory to implement the steps of the service processing method in any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, which is executed by a processor, implements the steps of the business process method as claimed in any one of claims 1-5.

Citation Information

Patent Citations

  • Business processing system, business processing method and business updating method

    CN107277086A

  • Service execution method and device

    CN110569092A

  • Website deployment method

    CN111931103A