CN113672309A - Business service method, device, electronic equipment and readable storage medium - Google Patents

Business service method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113672309A
CN113672309A CN202110962822.8A CN202110962822A CN113672309A CN 113672309 A CN113672309 A CN 113672309A CN 202110962822 A CN202110962822 A CN 202110962822A CN 113672309 A CN113672309 A CN 113672309A
Authority
CN
China
Prior art keywords
service
target
component
business
middleware
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110962822.8A
Other languages
Chinese (zh)
Inventor
杨天
朱航杰
贾平辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lexuebang Network Technology Co ltd
Original Assignee
Beijing Lexuebang Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lexuebang Network Technology Co ltd filed Critical Beijing Lexuebang Network Technology Co ltd
Priority to CN202110962822.8A priority Critical patent/CN113672309A/en
Publication of CN113672309A publication Critical patent/CN113672309A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a business service method, a business service device, electronic equipment and a readable storage medium, which relate to the technical field of software, wherein the business service method is suitable for a client, the client comprises a plurality of business components which are not coupled with each other, and each business component can operate independently, and the business service method comprises the following steps: responding to the trigger operation of a user, and determining a service request corresponding to the trigger operation; calling a target service component corresponding to the service request according to the target-action mechanism and the runtime system; sending the service request to a target server corresponding to the target service component through the target service component; and receiving the business service provided by the target service end through the target business component. Therefore, by implementing the implementation mode, the real decoupling among all the business codes can be realized, so that the management effect of the business codes is improved, and the effect of the business service is further improved.

Description

Business service method, device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of software technologies, and in particular, to a business service method, an apparatus, an electronic device, and a readable storage medium.
Background
With the continuous increase of company business, the functions of projects become more and more complex, so that the coupling among all business codes becomes more and more, the business codes cannot be efficiently managed, and the effect of business service is reduced. To address this problem, the skilled person has developed object-action mechanisms to reduce the coupling between the service codes. However, in practice, it is found that the problem of coupling between service codes still cannot be solved completely after the existing method is used, so that the management effect of the service codes still is poor, and the effect of the service is poor.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for service, which can implement true decoupling between service codes, thereby improving the management effect of the service codes and further improving the effect of the service.
A first aspect of an embodiment of the present application provides a service method, where the method is applicable to a client, where the client includes multiple service components that are not coupled to each other, and each service component can operate independently, and the method includes:
responding to a trigger operation of a user, and determining a service request corresponding to the trigger operation;
calling a target service component corresponding to the service request according to a target-action mechanism and a runtime system;
sending the service request to a target server corresponding to the target service component through the target service component;
and receiving the business service provided by the target service terminal through the target business component.
In the implementation process, the method can preferentially respond to the trigger operation of the user and simultaneously determine the service request corresponding to the trigger operation; then, a target service component corresponding to the service request is obtained through a target-action mechanism and a runtime system, and the service request is sent to a target server corresponding to the target service component through the target service component; and receiving the business service provided by the target service end through the target business component. Therefore, by implementing the implementation mode, the service components can realize complete decoupling among the service codes, and the service components are called under the condition of complete decoupling among the service codes, so that the service components are mutually independent, and the efficient implementation of service is facilitated; meanwhile, the implementation of the implementation mode can also improve the management effect of the business codes, and the effect of the business service is greatly improved compared with the effect of the traditional business service.
Further, the invoking a target service component corresponding to the service request includes:
and calling the target service component corresponding to the service request through the middle layer.
In the implementation process, the method can call a target service component corresponding to the service request through a middle layer of a target-action mechanism. Therefore, by implementing the implementation mode, the intermediate layer of the target-action mechanism can be used as the transfer between the user and the target business component, so that the user can use the service provided by the target business component, the user is prevented from directly searching the business component, and convenience is provided for the business service.
Further, the invoking, by the middle layer, the target service component corresponding to the service request includes:
determining target middleware corresponding to the service request, and calling a target service component corresponding to the target middleware based on the target middleware; the middle layer comprises a plurality of middleware, and the plurality of middleware and the plurality of service components are in one-to-one correspondence.
In the implementation process, the method may preferentially determine a target middleware corresponding to the service request in a process of calling a target service component, and call the corresponding target service component based on the target middleware. Therefore, by implementing the implementation mode, the target service component can be searched and called through the middleware of the middle layer, so that the target service component corresponding to the service request can be more easily acquired.
Further, the plurality of middleware are packaged together, or each middleware is packaged together with the corresponding service component.
In the implementation process, the method can package a plurality of middleware in the middle layer, so that the middleware can be uniformly called by the middle layer; or, the middleware and the service component are packaged together in the middle layer, so that the middle layer can directly and quickly call the service component through the middleware.
Further, the invoking a target business component corresponding to the target middleware based on the target middleware comprises:
determining a target business component matched with the target middleware based on the target middleware, and determining a component type of the target business component;
dynamically creating and running a component instance according to the component category and an API of a runtime system to determine a calling method matched with the component category;
and calling the target service component through the calling method.
In the implementation process, the method can determine a calling method through the component type and the runtime system of the service component, and call the target service component according to the calling method; in addition, the method can separate the service codes based on the component type, thereby avoiding the condition that all codes are piled up in the middle layer to cause the bulkiness.
Further, the client also comprises a general component, and the general component does not comprise the service code.
In the implementation process, the client further includes other general components unrelated to the service, and the general components are not used for implementing the service and cannot implement the service. Thus, the generic component does not include a business code.
Further, the method further comprises:
and if the business service is determined to be abnormal, the target business component is checked.
In the implementation process, when the business service is abnormal, the target business component can be automatically checked, so that the checking accuracy and the checking efficiency can be improved.
Further, the step of invoking the target service component corresponding to the service request comprises:
the middle layer of the control target-action mechanism creates a request object corresponding to the service request through an API of a runtime system; the request object is in the form of a character string;
and the intermediate layer of the control target-action mechanism searches according to the request object and the service object included in the service component to obtain the service component matched with the service request.
In the implementation process, the method can enable the middle layer to create a request object in a character string mode by using an API of a runtime system, and then deliver the request object to the middle layer to search the service component for calling. Therefore, by implementing the embodiment, the target object can be created through the API, so that the created target object can be used for matching the business object to realize the search of the business component, and the accurate search of the business component is realized.
Further, the step of finding, by the intermediate layer of the control target-action mechanism, according to the request object and the service object included in the service component to obtain the service component matched with the service request includes:
the middle layer of the control target-action mechanism creates a selector corresponding to the service request through an API of a runtime system;
and the intermediate layer of the control target-action mechanism searches the main class according to the request object, the selector and the service object included in the service component to obtain the service component matched with the service request.
In the implementation process, the method can create a selector through the API, and perform main-class searching according to the selector and the request object so as to acquire the accurate service component. Therefore, by implementing the implementation mode, the main class searching can be carried out based on the two types of characteristics, so that the accurate service component is obtained, the management effect of the service code is improved, and the effect of the service is improved.
A second aspect of the embodiments of the present application provides a service device, where the service device is applicable to a client, where the client includes a plurality of service components that are not coupled to each other, and each service component can operate independently, including:
the determining unit is used for responding to the triggering operation of a user and determining a service request corresponding to the triggering operation;
the calling unit is used for calling a target service component corresponding to the service request according to a target-action mechanism and a runtime system;
the sending unit is used for sending the service request to a target server corresponding to the target service component through the target service component;
and the receiving unit is used for receiving the service provided by the target service end through the target service component.
In the implementation process, the device can enable the service components to realize complete decoupling among the service codes, and call the service components under the condition of complete decoupling among the service codes, so that the service components are mutually independent, and the efficient implementation of service is facilitated; meanwhile, the implementation of the implementation mode can also improve the management effect of the business codes, and the effect of the business service is greatly improved compared with the effect of the traditional business service.
Further, the invoking unit is specifically configured to invoke, according to a target-action mechanism and a runtime system, the target service component corresponding to the service request through an intermediate layer.
In the implementation process, the device can use the intermediate layer of the target-action mechanism as the transfer between the user and the target service component, so that the user can use the service provided by the target service component, the user is prevented from directly searching for the service component, and convenience is provided for the service.
Further, the invoking unit is specifically configured to determine, according to a target-action mechanism and a runtime system, a target middleware corresponding to the service request, and invoke, based on the target middleware, a target service component corresponding to the target middleware; the middle layer comprises a plurality of middleware, and the plurality of middleware and the plurality of service components are in one-to-one correspondence.
In the implementation process, the device can search and call the target service component through the middleware of the middle layer, so that the target service component corresponding to the service request can be more easily acquired.
Further, the plurality of middleware are packaged together, or each middleware is packaged together with the corresponding service component.
In the implementation process, a plurality of middleware can be packaged in the middle layer in such a way, so that the middleware can be uniformly called by the middle layer; or, the middleware and the service component are packaged together in the middle layer, so that the middle layer can directly and quickly call the service component through the middleware.
Further, the calling unit includes:
a first subunit, configured to determine, according to a target-action mechanism and a runtime system, a target middleware corresponding to the service request;
the second subunit is used for determining a target business component matched with the target middleware based on the target middleware and determining the component category of the target business component;
the third subunit is used for dynamically creating and running a component instance according to the component category and the API of the runtime system so as to determine a calling method matched with the component category;
and the fourth subunit is used for calling the target service component through the calling method.
In the implementation process, the device can determine a calling method through the component type and the runtime system of the service component, and call the target service component according to the calling method; in addition, the device can separate the service codes according to the component types, so that the phenomenon that all codes are stacked in the middle layer to cause bulkiness is avoided.
Further, the client also comprises a general component, and the general component does not comprise the service code.
In the implementation process, the client further includes other general components unrelated to the service, and the general components are not used for implementing the service and cannot implement the service. Thus, the generic component does not include a business code.
Further, the service device further includes:
and the checking unit is used for checking the target business component when the business service is determined to be abnormal.
In the implementation process, when the business service is abnormal, the target business component can be automatically checked, so that the checking accuracy and the checking efficiency can be improved.
Further, the calling unit includes:
the first subunit is used for controlling the middle layer of the target-action mechanism to create a request object corresponding to the service request through an API of the runtime system; the request object is in the form of a character string;
and the second subunit is used for controlling an intermediate layer of the target-action mechanism, and searching according to the request object and the service object included in the service component to obtain the service component matched with the service request.
In the implementation process, the device can create the target object through the API, so that the created target object can be used for matching the business object, so as to implement the search for the business component, thereby implementing the accurate search for the business component.
Further, the second subunit is specifically configured to control the middle layer of the target-action mechanism to create, through an API of the runtime system, a selector corresponding to the service request; and the intermediate layer of the control target-action mechanism searches the main class according to the request object, the selector and the service object included in the service component to obtain the service component matched with the service request.
In the implementation process, the device can perform main-class searching based on the two types of characteristics, so that an accurate service component is obtained, the management effect of the service code is improved, and the effect of the service is improved.
A third aspect of the embodiments of the present application provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the business service method according to any one of the first aspect of the embodiments of the present application.
A fourth aspect of the present embodiment provides a computer-readable storage medium, which stores computer program instructions, where the computer program instructions, when read and executed by a processor, perform the business service method according to any one of the first aspect of the present embodiment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of a business service method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another business service method provided in the embodiment of the present application;
fig. 3 is a schematic diagram of a component relationship of a business service method according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating an implementation effect of a service method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a business service apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another business service apparatus provided in the embodiment of the present application;
fig. 7 is a schematic diagram of an exemplary APP structure of a service method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a business service method according to an embodiment of the present application. The business service method comprises the following steps:
s101, responding to the trigger operation of the user, and determining the service request corresponding to the trigger operation.
In this embodiment, the service request is a request for requesting a service, which is sent by a user.
And S102, calling a target service component corresponding to the service request according to the target-action mechanism and the runtime system.
In this embodiment, the Target-action mechanism is Target-action.
In this embodiment, the business components in the Target-action are usually packaged in a wrapper to provide services to the outside world, and the user can use the services through the middle layer.
In this embodiment, the middle layer generally calls the service of the business component through a runtime system (runtime), so as to achieve decoupling in a true sense.
For example, two service requests (a first service request and a second service request) are currently received. When searching for service components corresponding to two service requests, a first sub-component and a second sub-component matching the first service request, and a first sub-component and a third sub-component matching the second service request are specifically found. It can be seen that both service requests can find the same first subcomponent, so that the first subcomponent is a generic subcomponent, and the second and third subcomponents are referred to as specific subcomponents because of their independence and specificity. It is evident from this example that using this approach allows for complete decoupling between subassemblies, thereby facilitating individual management and overall reuse.
In this embodiment, the business component may have some unique small functions (e.g., timing functions).
S103, sending the service request to a target server corresponding to the target service component through the target service component.
In this embodiment, the method may be executed by a service system, wherein the execution of the corresponding step may be specifically performed through an intermediate layer in the Target-action. That is, the execution subject of the method may be an intermediate layer in Target-action.
In this embodiment, the service component includes a service object and a service category, the intermediate layer of the target-action mechanism includes a service category, and the service category includes a service category; wherein the service class is used to separate the traffic codes in the middle tier.
By implementing the implementation mode, the business component is encapsulated with a layer of Target to provide services to the outside, and the invasion to the business component is not caused. Moreover, the service is provided to the user by realizing Category of the middle layer, so that the user only needs to rely on the middle layer, and the business component does not need to rely on the middle layer.
This implementation is implemented as if the controls were packaged, as complex controls are typically packaged. Here, the assembly is only to extract each assembly individually and then to form a complete project as a plurality of small projects.
And S104, receiving the business service provided by the target service terminal through the target business component.
In this embodiment, the client further includes a general component, and the general component does not include the service code. It is to be understood that a generic component is a component that is not business related.
As an optional implementation, the method further comprises:
and if the business service is determined to be abnormal, checking the target business component.
That is to say, in the embodiment of the present application, each business component is independent from each other, and therefore, when a problem occurs in a business service, it is only necessary to examine a target business component without examining other business components.
Of course, when necessary, the target server needs to be checked, which is not described in detail.
In this embodiment, the main body of the method may be a computing device such as a computer, and this embodiment is not limited in any way.
In this embodiment, an execution subject of the method may also be an intelligent device such as a smart phone and a tablet computer, which is not limited in this embodiment.
At present, with the continuous development of company business, the functions of projects are more and more complex, each business code is more and more coupled, the code amount is increased sharply, and the traditional MVC (M refers to a business model, V refers to a user interface, and C refers to a controller) or MVVM architecture (an improved version of MVC) cannot manage the engineering code efficiently, so that a technology is needed to manage the engineering code better, and componentization is a technology capable of solving the code coupling.
Based on this, the business service method described in this embodiment can preferentially respond to the trigger operation of the user, and simultaneously determine the business request corresponding to the trigger operation; then, a target service component corresponding to the service request is obtained through a target-action mechanism and a runtime system, and the service request is sent to a target server corresponding to the target service component through the target service component; and receiving the business service provided by the target service end through the target business component. Therefore, by implementing the implementation mode, the service components can realize complete decoupling among the service codes, and the service components are called under the condition of complete decoupling among the service codes, so that the service components are mutually independent, and the efficient implementation of service is facilitated; meanwhile, the implementation of the implementation mode can also improve the management effect of the business codes, and the effect of the business service is greatly improved compared with the effect of the traditional business service.
Referring to fig. 2, fig. 2 is a schematic flow chart of a business service method according to an embodiment of the present application. As shown in fig. 2, the business service method includes:
s201, responding to the trigger operation of the user, and determining the service request corresponding to the trigger operation.
As an optional implementation manner, after the step of determining, in response to the triggering operation of the user, the service request corresponding to the triggering operation, the method further includes:
and calling a target service component corresponding to the service request through the middle layer according to the target-action mechanism and the runtime system.
As a further optional implementation manner, according to the target-action mechanism and the runtime system, invoking, through the middle layer, a target service component corresponding to the service request includes:
determining a target middleware corresponding to the service request according to a target-action mechanism and a runtime system, and calling a target service component corresponding to the target middleware based on the target middleware; the middle layer comprises a plurality of middleware, and the plurality of middleware and the plurality of service components are in one-to-one correspondence.
In this embodiment, a plurality of middleware are packaged together, or each middleware is packaged together with a corresponding service component. Therefore, complete decoupling is achieved, calling among the service components can be achieved based on the middle layer, the service components cannot be influenced, and flexibility is improved.
As a further alternative embodiment, the step of invoking, by the middle layer, the target business component corresponding to the business request based on the target middleware to invoke the target business component corresponding to the target middleware according to the target-action mechanism and the runtime system may include steps S202 to S204.
S202, based on the target middleware, determining a target business component matched with the target middleware, and determining a component type of the target business component.
S203, according to the component category and the API of the runtime system, dynamically creating and running the component instance to determine the calling method matched with the component category.
In this embodiment, the API is an application program interface.
In this embodiment, the request object is a target object in the form of a character string.
In this embodiment, a business component is referred to in a business object (target in the business component), so it is sufficient for a Mediator (middle layer) to find the business object.
And S204, calling the target service component by calling the method.
As an optional implementation, the step of calling the target service component corresponding to the service request includes:
the middle layer of the control target-action mechanism creates a request object corresponding to the service request through an API of the runtime system; the request object is in the form of a character string;
and the middle layer of the control target-action mechanism searches according to the request object and the service object included in the service component to obtain the service component matched with the service request.
As a further optional implementation, the intermediate layer of the control target-action mechanism searches according to the request object and the service object included in the service component, and the step of obtaining the service component matching the service request includes:
the middle layer of the control target-action mechanism creates a selector corresponding to the service request through an API of the runtime system;
and the intermediate layer of the control target-action mechanism searches the main class according to the request object, the selector and the service object included in the service component to obtain the service component matched with the service request.
Referring to fig. 3, fig. 3 illustrates an intermediate layer, a login component, a home page display component, a payment component, and an accounting page component, wherein the login component, the home page display component, the payment component, and the accounting page component are all business components; meanwhile, as can be seen from the direction of the arrows in fig. 3, the service components may not need to rely on an intermediate layer.
In this embodiment, the middle layer may be referred to as a Mediator.
In this embodiment, the Mediator can be understood as a Mediator mode.
In this embodiment, the service component includes a service object and a service category, the intermediate layer of the target-action mechanism includes a service category, and the service category includes a service category; wherein the service class is used to separate the traffic codes in the middle tier.
In this embodiment, the method may preferentially perform Target and Category configurations on each service component, and one service component may correspond to one or more targets. The Target can refer to and depend on the service component, the Category is the classification of the middle layer of the Mediator, and the use of the classification can separate the service codes in the middle layer of the Mediator, so that the situation that the middle layer of the Mediator is bloated due to the accumulation of all the codes in the middle layer of the Mediator is avoided.
In this embodiment, the mutually independent service components may generate a request for calling the next service component according to the component service completed, and call other service components through the same steps as the above steps, thereby implementing calling between components.
In this embodiment, Category creates a request object (target) and a Selector (Selector) in a character string form by using an API (application program interface) of a runtime system, and then delivers the request object and the Selector to a main class of a Mediator (middle layer) to call a service component.
S205, the service request is sent to the target service end corresponding to the target service component through the target service component.
S206, receiving the service provided by the target service end through the target service component.
As an optional implementation, the method may further include:
detecting whether a correlation instruction is received;
when receiving the association instruction, calling other business components associated with the business service according to the target-action mechanism and the runtime system;
sending the association instruction to a target server corresponding to other business components through other business components;
and receiving the business services provided by other service terminals through other business components.
As a further optional embodiment, the method may further comprise:
establishing a communication channel between the target service assembly and other service assemblies;
determining a target business component, other business components and the communication channel as service components;
receiving an operation instruction;
and responding to the operation instruction through the service component, and providing a service corresponding to the operation instruction.
Referring to FIG. 4, the invocation of the Login Module (Login component) is depicted in FIG. 4. Wherein, the left side of fig. 4 describes the middle layer and the service object in the target-action, when the user requests to log in the service, the media + log in fig. 4 is selected, so that the target-action calls the Login service module (Login component), so that the Login service module (Login component) performs the subsequent operation (i.e. Login or registration, etc.).
Referring to fig. 5, in the structure diagram of the APP shown in fig. 5, instant messaging (im), AddressBook, GlobalSearch, Workbench, and Personal are five service components, and similarly, the five service components may also exist as five separate projects.
Examples are: referring to fig. 5, the instant messaging component may be operated as a single project after being developed in a componentized manner, and if other teams want to develop an IM function, the instant messaging component may be directly accessed and reused without further development.
By implementing the embodiment, when the number of the component libraries is large enough, the project can complete most of the development work only by combining the components.
Examples are: referring to fig. 5, when three components of instant messaging, AddressBook and Personal are extracted and combined, a chat software having most functions of the chat software can be obtained, so that a developer can quickly develop a chat APP by adding some own specific functions.
By implementing the embodiment, the code structure of the componentized project is clearer, and the problems are tracked, bugs are repaired and the demand is increased more conveniently.
Examples are: referring to fig. 5, after modularization is adopted, the components are independent of each other, the structure is clear at a glance, and if a bug appears in IM, the problem only needs to be tracked in an InstantMessaging component, so that the code quantity needing to be checked is effectively reduced.
By implementing the implementation mode, different business components are mutually independent, thereby being beneficial to determining the business boundary of team development and increasing the team cooperation efficiency.
Examples are: referring to fig. 5, each component in fig. 5 is responsible for different developers, a Personal component is responsible for one developer, and a GlobalSearch component is responsible for another developer, so that the method can clarify business boundaries of team development and increase team cooperation efficiency.
In this embodiment, the components begin to become more complex as the project is iterated. On this basis, the various components are interdependent, and each component may have common business logic, thereby making the entire project cumbersome to maintain. The implementation of the implementation mode can adopt componentization, and each service logic and each component are separated and managed independently, so that the boundary is maintained, and each developer only needs to care about the components of the developer.
It can be seen that, by implementing the service method described in this embodiment, complete decoupling between service codes can be realized for service components, and the service components are invoked under the condition of complete decoupling between service codes, so that the service components are independent from each other, which is beneficial to efficient service; meanwhile, the implementation of the implementation mode can also improve the management effect of the business codes, and the effect of the business service is greatly improved compared with the effect of the traditional business service.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a business service apparatus according to an embodiment of the present application. As shown in fig. 6, the service device includes:
a determining unit 310, configured to determine, in response to a trigger operation of a user, a service request corresponding to the trigger operation;
a calling unit 320, configured to call a target service component corresponding to the service request according to the target-action mechanism and the runtime system;
a sending unit 330, configured to send the service request to a target server corresponding to the target service component through the target service component;
the receiving unit 340 is configured to receive a service provided by the target service end through the target service component.
In this embodiment, the service request is a request for requesting a service, which is sent by a user.
In this embodiment, the Target-action mechanism is Target-action.
In this embodiment, the business components in the Target-action are usually packaged in a wrapper to provide services to the outside world, and the user can use the services through the middle layer.
In this embodiment, the middle layer generally calls the service of the business component through a runtime system (runtime), so as to achieve decoupling in a true sense.
In this embodiment, the method may be executed by a service system, wherein the execution of the corresponding step may be specifically performed through an intermediate layer in the Target-action. That is, the execution subject of the method may be an intermediate layer in Target-action.
In this embodiment, the service component includes a service object and a service category, the intermediate layer of the target-action mechanism includes a service category, and the service category includes a service category; wherein the service class is used to separate the traffic codes in the middle tier.
By implementing the implementation mode, the business component is encapsulated with a layer of Target to provide services to the outside, and the invasion to the business component is not caused. Moreover, the service is provided to the user by realizing Category of the middle layer, so that the user only needs to rely on the middle layer, and the business component does not need to rely on the middle layer.
This implementation is implemented as if the controls were packaged, as complex controls are typically packaged. Here, the assembly is only to extract each assembly individually and then to form a complete project as a plurality of small projects.
In this embodiment, the service component includes a service object and a service category, the intermediate layer of the target-action mechanism includes a service category, and the service category includes a service category; wherein the service class is used to separate the traffic codes in the middle tier.
In the embodiment of the present application, for the explanation of the service device, reference may be made to the above contents in the embodiment, and details are not repeated in this embodiment.
It can be seen that, by implementing the service device described in this embodiment, complete decoupling between service codes can be realized for service components, and the service components are invoked under the condition of complete decoupling between service codes, so that the service components are independent from each other, which is beneficial to efficient service; meanwhile, the implementation of the implementation mode can also improve the management effect of the business codes, and the effect of the business service is greatly improved compared with the effect of the traditional business service.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a business service device according to an embodiment of the present application. The service device shown in fig. 7 is optimized by the service device shown in fig. 6. As shown in fig. 7, the invoking unit 320 is specifically configured to invoke, through the middle layer, a target service component corresponding to the service request according to the target-action mechanism and the runtime system.
As an optional implementation manner, the invoking unit 320 is specifically configured to determine, according to the target-action mechanism and the runtime system, a target middleware corresponding to the service request, and invoke, based on the target middleware, a target service component corresponding to the target middleware; the middle layer comprises a plurality of middleware, and the plurality of middleware and the plurality of service components are in one-to-one correspondence.
In an alternative embodiment, a plurality of middleware are packaged together, or each middleware is packaged together with a corresponding service component.
As an alternative embodiment, the invoking unit 320 includes:
a first subunit 321, configured to determine, according to a target-action mechanism and a runtime system, a target middleware corresponding to the service request;
a second subunit 322, configured to determine, based on the target middleware, a target business component matching the target middleware, and determine a component class of the target business component;
a third subunit 323, configured to dynamically create and run a component instance according to the component category and an API of the runtime system, so as to determine a calling method matching the component category;
a fourth subunit 324 is configured to invoke the target business component by invoking a method.
As an optional implementation, the client further includes a general component, and the general component does not include the service code.
As an optional implementation manner, the service device further includes:
and the checking unit 350 is configured to check the target business component when it is determined that the business service is abnormal.
As an alternative embodiment, the invoking unit 320 includes:
a first subunit 321, configured to control a middle layer of the target-action mechanism to create a request object corresponding to the service request through an API of the runtime system; the request object is in the form of a character string;
a second subunit 322, configured to control an intermediate layer of the target-action mechanism, to find, according to the request object and the service object included in the service component, a service component matching the service request.
As an optional implementation manner, the second subunit 322 is specifically configured to control the middle layer of the target-action mechanism to create a selector corresponding to the service request through an API of the runtime system; and the intermediate layer of the control target-action mechanism searches the main class according to the request object, the selector and the service object included in the service component to obtain the service component matched with the service request.
In the embodiment of the present application, the explanation of the service device may refer to the above contents of the embodiment, and details are not repeated in this embodiment.
By implementing the embodiment, the components can run independently, and the reusability of the code is improved, wherein the finer the componentized granularity is, the higher the reusability is.
It can be seen that, by implementing the service device described in this embodiment, complete decoupling between service codes can be realized for service components, and the service components are invoked under the condition of complete decoupling between service codes, so that the service components are independent from each other, which is beneficial to efficient service; meanwhile, the implementation of the implementation mode can also improve the management effect of the business codes, and the effect of the business service is greatly improved compared with the effect of the traditional business service.
An embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the electronic device execute the business service method described in the embodiment of the present application.
The embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the computer program instructions execute the business service method described in the embodiment of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A business service method is characterized in that the method is applied to a client, the client comprises a plurality of business components which are not coupled with each other, each business component can operate independently, and the method comprises the following steps:
responding to a trigger operation of a user, and determining a service request corresponding to the trigger operation;
calling a target service component corresponding to the service request according to a target-action mechanism and a runtime system;
sending the service request to a target server corresponding to the target service component through the target service component;
and receiving the business service provided by the target service terminal through the target business component.
2. The business service method of claim 1, wherein said invoking a target business component corresponding to said business request comprises:
and calling a target service component corresponding to the service request through the middle layer.
3. The business service method of claim 2, wherein the invoking, by the intermediary layer, the target business component corresponding to the business request comprises:
determining target middleware corresponding to the service request, and calling a target service component corresponding to the target middleware based on the target middleware; the middle layer comprises a plurality of middleware, and the plurality of middleware and the plurality of service components are in one-to-one correspondence.
4. A business service method of claim 3 wherein the plurality of middleware components are packaged together or each middleware component is packaged together with a corresponding business component.
5. The business service method of claim 3, wherein the invoking a target business component corresponding to the target middleware based on the target middleware comprises:
determining a target business component matched with the target middleware based on the target middleware, and determining a component type of the target business component;
dynamically creating and running a component instance according to the component category and an API of a runtime system to determine a calling method matched with the component category;
and calling the target service component through the calling method.
6. The business service method of claim 1, wherein the client further comprises a generic component, and wherein the generic component does not include a business code.
7. The traffic service method of claim 1, wherein the method further comprises:
and if the business service is determined to be abnormal, the target business component is checked.
8. A business service apparatus, wherein the apparatus is adapted to a client, the client includes a plurality of business components that are not coupled to each other, each business component is capable of operating independently, and the apparatus comprises:
the determining unit is used for responding to the triggering operation of a user and determining a service request corresponding to the triggering operation;
the calling unit is used for calling a target service component corresponding to the service request according to a target-action mechanism and a runtime system;
the sending unit is used for sending the service request to a target server corresponding to the target service component through the target service component;
and the receiving unit is used for receiving the service provided by the target service end through the target service component.
9. An electronic device, characterized in that the electronic device comprises a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to perform the business service method of any one of claims 1 to 7.
10. A readable storage medium having stored thereon computer program instructions which, when read and executed by a processor, perform the business service method of any one of claims 1 to 7.
CN202110962822.8A 2021-08-20 2021-08-20 Business service method, device, electronic equipment and readable storage medium Pending CN113672309A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110962822.8A CN113672309A (en) 2021-08-20 2021-08-20 Business service method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110962822.8A CN113672309A (en) 2021-08-20 2021-08-20 Business service method, device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN113672309A true CN113672309A (en) 2021-11-19

Family

ID=78544647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110962822.8A Pending CN113672309A (en) 2021-08-20 2021-08-20 Business service method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113672309A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729061A (en) * 2017-10-12 2018-02-23 武汉市灯塔互动文化传播有限公司 The modularization construction method of engineering project under a kind of ios platform
CN108419089A (en) * 2018-02-08 2018-08-17 广州虎牙信息科技有限公司 Module data processing method, device, equipment and storage medium
CN112328330A (en) * 2020-11-25 2021-02-05 北京五八信息技术有限公司 iOS component calling method, device, middleware, electronic equipment and medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729061A (en) * 2017-10-12 2018-02-23 武汉市灯塔互动文化传播有限公司 The modularization construction method of engineering project under a kind of ios platform
CN108419089A (en) * 2018-02-08 2018-08-17 广州虎牙信息科技有限公司 Module data processing method, device, equipment and storage medium
CN112328330A (en) * 2020-11-25 2021-02-05 北京五八信息技术有限公司 iOS component calling method, device, middleware, electronic equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
_UDOCTOR: "ios:组件化之Target-Action模式", Retrieved from the Internet <URL:http://blog.csdn.net/pk_sir/article/details/108077994> *

Similar Documents

Publication Publication Date Title
CN110249307B (en) System and method for executing native contracts on blockchains
US9311214B2 (en) System and methods for tracing individual transactions across a mainframe computing environment
CN108255545B (en) Function calling method and device between components and modular architecture system
WO2020211483A1 (en) Method and apparatus for storing and executing smart contract in blockchain, and electronic device
US11893367B2 (en) Source code conversion from application program interface to policy document
CN110780870A (en) Service execution method, device, equipment and storage medium
CN112787999B (en) Cross-chain calling method, device, system and computer readable storage medium
CN111858083A (en) Remote service calling method and device, electronic equipment and storage medium
JP2019509567A (en) Resource loading method, service function implementing method and apparatus for application (APP)
CN114549068A (en) Short link generation method, equipment, device and computer readable storage medium
CN112817600A (en) Program annotation compiling method and corresponding device, equipment and medium
CN109857716B (en) System interaction log recording method and device, storage medium and server
US10467076B1 (en) System and method of input validation
CN113672309A (en) Business service method, device, electronic equipment and readable storage medium
CN115469833A (en) Method and device for implementing dynamic rule engine, electronic equipment and storage medium
CN112764897B (en) Task request processing method, device and system and computer readable storage medium
CN114358936A (en) Intelligent contract operation method based on micro-service block chain
CN111061576B (en) Method and system for creating entity object
CN113282541A (en) File calling method and device and electronic equipment
CN116756048B (en) Code analysis method, device, computer equipment and storage medium
CN113986379B (en) Application starting method and device, computer equipment and storage medium
CN115686676B (en) Dynamic calling method and device for object and electronic equipment
CN112884586B (en) Transaction execution method and block link point
CN112416312B (en) Object acquisition method and device, electronic equipment and storage medium
CN110191141B (en) Service calling information processing method and device and computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination