Instruction processing method, device, equipment and storage medium based on distributed service

By determining the target routing order in a distributed system and filtering the service provider equipment, the problem of inflexible routing order in the prior art cannot be flexibly changed, and the efficiency of transaction information processing is improved.

CN114979138BActive Publication Date: 2024-11-26INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing distributed systems, the routing sorting of service provider equipment cannot be flexibly changed, resulting in low efficiency in transaction information processing and cannot meet the requirements of multiple filtering mechanism scenarios.

Method used

By responding to the service consumption instructions issued by the service consumer device, the target routing order is determined, and the service provider device is filtered according to the preset routing filtering strategy to obtain the target service provider device to process the instructions.

Benefits of technology

It realizes the flexibility of routing sorting, ensures that transaction instructions can be carried out in the expected order in different scenarios, improves instruction processing efficiency, and avoids the problem that transaction instructions cannot be completed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979138B_ABST
    Figure CN114979138B_ABST
Patent Text Reader

Abstract

The present application provides an instruction processing method, device, equipment and storage medium based on distributed services, which involves big data technology. The method is used in a distributed system, which includes multiple service provider devices, including: responding to a service consumption instruction issued by a service consumer device, determining a target routing order corresponding to the service consumption instruction; the service consumption instruction instructs the transaction information to be processed; according to the target routing order, based on a preset routing screening strategy, the service provider devices in the distributed system are screened to obtain a target service provider device; the routing screening strategy represents the rules for screening the service provider devices; the service consumption instruction is sent to the target service provider device for processing; the target service provider device serves the service consumer device according to the service consumption instruction. The method of the present application realizes that the routing order of different services can be different, meets a variety of application scenarios, and improves the flexibility of instruction processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to big data technology, and in particular to an instruction processing method, device, equipment and storage medium based on distributed services. Background Art

[0002] A distributed system is a software system built on the network. It has a high degree of cohesion and transparency. It can be composed of multiple stand-alone devices with the same performance specifications and code meanings to ensure the feasibility of the system. When a user, as a service consumer, issues a processing instruction for transaction information, multiple service provider devices in the distributed system can be filtered to obtain devices that can provide services to the user. Appropriate service provider devices can be selected based on certain screening strategies.

[0003] In the prior art, based on the traditional distributed framework, when the routing layer performs screening and filtering of the service provider device, a preset sorting algorithm is used to sort the routes. According to the sorted routing sequence, the service provider device is filtered in sequence.

[0004] However, the preset sorting algorithm limits the sorting results of routes, for example, they can only be sorted by the first letter of the route name, or by the size of the number in the name. The sorting results of routes cannot be changed flexibly and cannot meet the requirements of various filtering mechanism scenarios, resulting in the inability to complete the processing of transaction information and affecting the processing efficiency of instructions. Summary of the invention

[0005] The present application provides a distributed service-based instruction processing method, apparatus, device and storage medium to improve instruction processing efficiency.

[0006] On the one hand, the present application provides an instruction processing method based on distributed services, which is applied in a distributed system, wherein the distributed system includes at least two service provider devices, including:

[0007] In response to a service consumption instruction issued by a service consumer device, determining a target routing sequence corresponding to the service consumption instruction; wherein the service consumption instruction is used to instruct processing of transaction information;

[0008] According to the target routing sequence, based on a preset routing screening strategy, the service provider devices in the distributed system are screened to obtain a target service provider device; wherein the preset routing screening strategy represents rule information for screening the service provider devices;

[0009] The service consumption instruction is sent to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

[0010] On the other hand, the present application provides an instruction processing device based on distributed services, which is applied in a distributed system, wherein the distributed system includes at least two service provider devices, including:

[0011] A target routing sequence determination module, configured to determine a target routing sequence corresponding to a service consumption instruction issued by a service consumer device in response to the service consumption instruction; wherein the service consumption instruction is used to instruct the processing of transaction information;

[0012] A target service provider device determination module is used to screen the service provider devices in the distributed system according to the target routing sequence and based on a preset routing screening strategy to obtain a target service provider device; wherein the preset routing screening strategy represents rule information for screening the service provider devices;

[0013] The instruction processing module is used to send the service consumption instruction to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

[0014] On the other hand, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0015] The memory stores computer-executable instructions;

[0016] The processor executes the computer-executable instructions stored in the memory to implement the distributed service provision method as described in any embodiment of the present application.

[0017] On the other hand, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the distributed service provision method as described in any embodiment of the present application.

[0018] On the other hand, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the distributed service provision method as described in any embodiment of the present application.

[0019] This application determines the need to provide services to service consumers by responding to service consumption instructions issued by service consumer devices. The distributed system includes multiple service provider devices. Therefore, the service provider devices can be screened according to the routing order based on the preset routing strategy. The routing order of different services may be different. According to the service consumption instructions, the specified target routing order can be determined. According to the target routing order, the target service provider device is screened, and the target service provider device processes the service consumption instruction to provide services to the user. The problem that the routing order of different services cannot be flexibly changed in the prior art is solved. It ensures that in different scenarios, the routes can be arranged in the desired order to avoid the inability to complete transaction instructions and improve the processing efficiency of instructions. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0021] Figure 1 A flowchart of an instruction processing method based on distributed services provided in an embodiment of the present application;

[0022] Figure 2 A flowchart of an instruction processing method based on distributed services provided in an embodiment of the present application;

[0023] Figure 3 A flowchart of an instruction processing method based on distributed services provided in an embodiment of the present application;

[0024] Figure 4 A flowchart of an instruction processing method based on distributed services provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of the structure of an instruction processing device based on distributed services provided in an embodiment of the present application;

[0026] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0027] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0028] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0029] It should be clear that the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0030] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0031] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0032] It should be noted that due to space limitations, this application specification does not list all optional implementation methods. After reading this application specification, those skilled in the art should be able to think that as long as the technical features do not contradict each other, any combination of technical features can constitute an optional implementation method. Each embodiment is described in detail below.

[0033] Figure 1 is a flow chart of a distributed service-based instruction processing method provided in an embodiment of the present application, such as Figure 1 As shown, the method provided in this embodiment is executed by an instruction processing device based on distributed services, and the method is applied to a distributed system, which includes at least two service provider devices. Figure 1 As shown, the method comprises the following steps:

[0034] S101. In response to a service consumption instruction issued by a service consumer device, determine a target routing sequence corresponding to the service consumption instruction; wherein the service consumption instruction is used to instruct processing of transaction information.

[0035] Among them, the user, as the service consumer, can issue a service consumption instruction on the device on the service consumer side. For example, the service consumption instruction can be a transaction request such as a transfer. The device on the service consumer side is the service consumer device, which can be a terminal device such as a mobile phone, a computer, and a counter device.

[0036] The service consumption instruction may include the transaction information to be processed, which is used to instruct the service provider device to process the transaction information. For example, the service consumption instruction may include transaction information such as user name, account number, request time, requested service name, service identifier, and transaction amount. After responding to the service consumption instruction issued by the service consumer device, the transaction information is obtained from the service consumption instruction to determine the service that the service consumer wants to be provided.

[0037] A distributed system may include multiple routes, and the order of each route when executing a preset routing strategy may be pre-specified, that is, the routes are specified in order. For example, the routes may be digitally labeled, and the smaller the number, the higher the order. For the unit routes of the unitized scenario, a larger number may be specified to ensure that the unit routes are ranked last. The routing strategy may be a routing screening strategy for screening the service provider device. In this embodiment, a virtual device of a sequence instruction may be created in the code of the routing sequence determination algorithm to display the order of each specified route. Multiple routes are arranged according to the specified order, that is, a column of routing orders is obtained. After receiving the service consumption instruction, the routes may be sorted according to the order specified for each route to obtain a column of routing orders as the target routing order. It is also possible to specify a routing order of different arrangements for each service consumption instruction, and after obtaining the service consumption instruction, directly determine a column of routing orders corresponding to the service consumption instruction as the target routing order.

[0038] For example, for service consumption instruction one, the specified target routing order is route one, route two, and route five, that is, route one is first filtered, then route two is filtered, and finally route five is filtered; for service consumption instruction two, the specified target routing order is route one, route three, route four, and route five, that is, route one is first filtered, then route three is filtered, then route four is filtered, and finally route five is filtered.

[0039] S102. According to the target routing sequence and based on a preset routing screening strategy, the service provider devices in the distributed system are screened to obtain the target service provider devices; wherein the preset routing screening strategy represents rule information for screening the service provider devices.

[0040] Among them, a route filtering policy can be pre-set for each route, and the route filtering policy for each route can be different. The route filtering policy is the rule information for filtering and selecting the service provider device. For example, the route filtering policy can be based on the name of the service provider device. The name of the service provider device that needs to be filtered out is specified in the route filtering policy, and the service provider device with the service provider device name is filtered. The route filtering policy can also be based on the version number of the service provider device. For example, a version number is pre-specified, and the service provider devices of the version below the version number are filtered.

[0041] The distributed system may include at least two service provider devices, where the service provider device is a computer device on the service provider side. If a service provider device fails in the distributed system, other service provider devices may be used to provide services.

[0042] The routes in the target route sequence are the target routes. After determining the target route sequence, determine the route filtering policy for each target route. Based on the target route sequence, use the route filtering policy for each target route to filter the service provider device. For example, if the target route sequence is route one, route two, and route five, first use the route filtering policy for route one, then use the route filtering policy for route two, and finally use the route filtering policy for route five.

[0043] By filtering according to the target routing order, the number of filtered service provider devices becomes smaller and smaller, and finally the target service provider device can be filtered out. For example, five service provider devices can be firstly filtered out from ten service provider devices, and then three service provider devices can be filtered out from the five service provider devices, and finally one service provider device can be filtered out from the three service provider devices as the target service provider device.

[0044] S103: Send the service consumption instruction to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

[0045] After the target service provider device is determined, the service consumption instruction is sent to the target service provider device. The target service provider device processes the service consumption instruction to provide services to the service consumer, and the service consumer device can display whether the service has been provided. For example, a user sends a transfer request, and the target service provider device completes the user's transfer request, while other filtered service provider devices will not receive the user's transfer request.

[0046] The embodiment of the present application determines that a service needs to be provided to a service consumer by responding to a service consumption instruction issued by a service consumer device. The distributed system includes multiple service provider devices. Therefore, the service provider devices can be screened according to the routing order according to the preset routing strategy. The routing order of different services can be different, and the order of each route can be pre-specified. According to the service consumption instruction, the specified target routing order can be determined. According to the target routing order, the target service provider device is screened and obtained, and the target service provider device processes the service consumption instruction to provide services to the user. The problem that the routing order of different services cannot be flexibly changed in the prior art is solved. It ensures that in different scenarios, the routes can be arranged in the desired order to avoid the inability to complete transaction instructions and improve the processing efficiency of instructions.

[0047] Figure 2 A flowchart of an instruction processing method based on distributed services provided in an embodiment of the present application is provided. This embodiment is an optional embodiment based on the above embodiment.

[0048] In this embodiment, in response to the service consumption instruction issued by the service consumer device, the target routing order corresponding to the service consumption instruction is determined, which can be further refined as: in response to the service consumption instruction issued by the service consumer device, the target service corresponding to the service consumption instruction is determined; according to the association relationship between the preset service and the routing order, the target routing order of the target service is determined.

[0049] like Figure 2 As shown, the method comprises the following steps:

[0050] S201: In response to a service consumption instruction issued by a service consumer device, determine a target service corresponding to the service consumption instruction.

[0051] The service consumption instruction includes transaction information such as the name, identifier or scenario of the service to be provided, and the service to be provided is the target service. The target service that the service consumer wants to be provided can be determined from the service consumption instruction. For example, according to the service consumption instruction, it can be determined that the target service is a unitized scenario service.

[0052] S202: Determine a target routing sequence of a target service according to a preset association relationship between services and routing sequences.

[0053] Among them, for different services, the association relationship between the service and the routing order can be preset, for example, the association relationship between the service and the routing order in different scenarios can be set. After determining the target service or the scenario of the target service, the routing order corresponding to the target service can be determined according to the preset association relationship as the target routing order. It is realized that different routing orders are used for different services, emphasizing the execution order of the screening between routes, improving the efficiency of determining the routing order, and ensuring the normal processing of instructions.

[0054] In this embodiment, the target routing order of the target service is determined based on the association relationship between the preset service and the routing order, including: determining at least two target routes corresponding to the target service based on the association relationship between the preset service and the routing; obtaining the pre-set sequence annotation in the target route, and sorting the target routes according to the sequence annotation to obtain the target routing order.

[0055] Specifically, the association relationship between different services and the entire routing sequence can be preset, or the service can be associated with a single route. For example, for a service in a unitized scenario, route one, route two, and route three can be associated, without restricting the routing sequence between route one, route two, and route three, where route three is a unit route; for a service outside a unitized scenario, route one, route two, and route four can be associated, where route one, route two, and route four are not unit routes, and there is no restriction on the routing sequence between route one, route two, and route four. Each service can be associated with multiple routes, and the route corresponding to the target service is determined as the target route based on the preset association relationship between the service and the route.

[0056] Annotate the order of each route in advance. For example, you can use numbers to annotate the order of routes. The larger the number, the later the route is in the order. After determining each target route, obtain the order annotation of each target route, sort the order annotation by size, and obtain the order result as the target route order. For example, there are three target routes, and the order annotations are 1, 5, and 3 respectively. Then, you can sort 1, 5, and 3 by size to obtain the order results of 1, 3, and 5, and obtain the corresponding target route order according to the sorting results.

[0057] For example, under the modular architecture, there will be a unit route specifically used in the modular scenario. Originally, each route filtered the service provider devices layer by layer, and did not pay much attention to the execution order. Here, it is emphasized that the role of the route is to filter out the appropriate service provider devices. After modularization, if a transaction is determined to be a call of this unit or across units, it must be a call of this unit or across units. There will be no scenario where there is no service provider device in this unit and then it is forwarded to other units for calling. Therefore, it is necessary to require the unit route to be the last execution of all routes. In this way, after all routes are filtered layer by layer, the unit route is executed, and there is no need to worry about the unit route filtering out the legitimate service provider devices of other routes. In other words, in the modular scenario, the unit route must be the last route. Therefore, a larger number of sequence annotations can be added to the unit route, so that the unit route is the last target route in the target route sorting of any modular scenario service. The order of each specified route can be displayed by creating a sequence designation device, and the order of the modular route can be set to the last one.

[0058] The beneficial effect of this setting is that the sorting of each route is annotated and the sorting of the routes is specified, so that during the execution of the transaction, the target route order can be obtained according to the expected sorting, and the transactions are executed one by one according to the target route order, avoiding the failure of transaction execution due to incorrect order, solving the problem of being unable to ensure the normal progress of transactions in the scenario, meeting a variety of application scenarios, and improving the flexibility of route sorting.

[0059] In this embodiment, before obtaining the pre-set sequence annotation in the target route, the method further includes: marking the sequence annotation on each route in the distributed system according to a preset annotation marking algorithm, wherein the sequence annotation is used to display the specified route sequence.

[0060] Specifically, mark each route with a sequence annotation in advance to facilitate the subsequent sorting of routes according to the sequence annotation. By annotating each route implementation class, the execution order of the specified routes is displayed in the code. The annotation principle can adopt Spring's order (sorting) and other methods applicable to distributed routing strategies. For example, a relatively large number can be marked on the implementation class of the unit route to ensure that the value corresponding to the unit route is at the maximum value of all routes, so that the unit route will be executed last.

[0061] The beneficial effect of this setting is that the routes are annotated in advance, the flexibility of route sorting is improved, the actual needs are met, and the efficiency of instruction processing is improved.

[0062] In this embodiment, the routing in the distributed system may include at least one of conditional routing, script routing, mock routing, unit routing, and custom routing.

[0063] S203. According to the target routing sequence and based on a preset routing screening strategy, the service provider devices in the distributed system are screened to obtain the target service provider devices; wherein the preset routing screening strategy represents rule information for screening the service provider devices.

[0064] S204: Send the service consumption instruction to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

[0065] The embodiment of the present application determines that a service needs to be provided to a service consumer by responding to a service consumption instruction issued by a service consumer device. The distributed system includes multiple service provider devices. Therefore, the service provider devices can be screened according to the routing order according to the preset routing strategy. The routing order of different services can be different, and the order of each route can be pre-specified. According to the service consumption instruction, the specified target routing order can be determined. According to the target routing order, the target service provider device is screened and obtained, and the target service provider device processes the service consumption instruction to provide services to the user. The problem that the routing order of different services cannot be flexibly changed in the prior art is solved. It ensures that in different scenarios, the routes can be arranged in the desired order to avoid the inability to complete transaction instructions and improve the processing efficiency of instructions.

[0066] Figure 3 A flowchart of an instruction processing method based on distributed services provided in an embodiment of the present application is provided. This embodiment is an optional embodiment based on the above embodiment.

[0067] In this embodiment, according to the target routing sequence, based on a preset routing screening policy, the service provider devices in the distributed system are screened to obtain the target service provider device, which can be further refined as follows: determining the routing screening policy for each target route in the target routing sequence; according to the routing screening policy for the target route, the target routes in the target routing sequence are sequentially screened for service provider devices to obtain the target service provider device.

[0068] like Figure 3 As shown, the method comprises the following steps:

[0069] S301. In response to a service consumption instruction issued by a service consumer device, determine a target routing sequence corresponding to the service consumption instruction; wherein the service consumption instruction is used to instruct processing of transaction information.

[0070] S302: Determine a route screening strategy for each target route in a target route sequence.

[0071] Among them, each route corresponds to its own route filtering policy. For example, the route filtering policy of route one can be to filter out faulty service provider devices; the route filtering policy of route two can be to filter out service provider devices with preset version numbers; the route filtering policy of route three can be to randomly filter service provider devices.

[0072] Determine each target route in the target route sequence, and determine the route screening strategy of each target route according to the association relationship between each route and the route screening strategy set in advance.

[0073] S303: According to the route screening policy of the target route, the target routes in the target route sequence are screened for service provider devices in turn to obtain the target service provider device.

[0074] Each target route filters the service provider device according to its own route filtering strategy, and filters in sequence according to the target route order. The service provider device obtained by filtering the last target route is the target service provider device. For example, if the target route order is route one, route two, and route three, route one will be filtered first, then route two, and finally route three to obtain the target service provider device.

[0075] In this embodiment, according to the route screening policy of the target route, the target routes in the target route sequence are screened for service provider devices in sequence to obtain the target service provider device, including: according to the target route sequence, determining the target route currently executing the route screening policy as the first route; according to the route screening policy of the first route, screening the service provider devices in the distributed system to obtain the first candidate service provider device; if in the target route sequence, the target route exists after the first route, then determining the target route after the first route as the second route; according to the route screening policy of the second route, screening the first candidate service provider device to obtain the second candidate service provider device; if in the target route sequence, there is no target route after the second route, then determining the second candidate service provider device as the target service provider device.

[0076] Specifically, there are multiple target routes in the target route sequence, and one of the target routes is used for filtering each time. According to the target route sequence, a target route is determined as the route that currently needs to execute the route screening policy. The determined target route is the first route. For example, the target route ranked first can be determined as the first route.

[0077] Determine a route screening strategy for the first route, and screen all service provider devices currently existing in the distributed system according to the route screening strategy for the first route, and select the service provider devices obtained after screening as the first candidate service provider devices. For example, the first route may filter out all faulty service provider devices and determine the normally operating service provider devices as the first candidate service provider devices.

[0078] In the target route sequence, whether there is a target route after the first route is determined. For example, it can be determined whether there is a second target route after the first target route. If so, the target route after the first route is determined as the second route. The route screening strategy of the second route is determined, and the first candidate service provider device obtained by the first route is screened according to the route screening strategy of the second route. The service provider device obtained after the screening is the second candidate service provider device. If there is no target route after the first route, it is determined that the first route is the last target route, the route screening ends, and the first candidate service provider device is the target service provider device.

[0079] After obtaining the second candidate service provider device, continue to determine whether there is a target route after the second route in the target route sequence. If not, determine the second route as the last target route, and the route screening is completed. The second candidate service provider device is the target service provider device. If it exists, determine the target route after the second route as the third route. Determine the route screening strategy of the third route, and screen the second candidate service provider device obtained by the second route according to the route screening strategy of the third route. The service provider device obtained after screening is the third candidate service provider device. Continue to judge according to the target route sequence until the last target route is screened, and determine the service provider device obtained by the last target route screening as the target service provider device.

[0080] The beneficial effect of such a setting is that, through the target route sequence, all target routes are filtered layer by layer, so that the filtering object of each target route is the service provider device obtained by the previous target route screening, thereby improving the filtering efficiency of the service provider device. By setting a suitable target route sequence, it is possible to avoid the target routes in front filtering out the service provider devices required to be filtered by the target routes behind, thereby affecting the filtering of the target routes behind. For example, in a unitized scenario, the unit route is set to be the last execution of all routes, and the unit route is executed after all target routes are filtered layer by layer, so as to avoid the unit route filtering out the legitimate service provider devices of other routes in advance.

[0081] S304: Send the service consumption instruction to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

[0082] The embodiment of the present application determines that a service needs to be provided to a service consumer by responding to a service consumption instruction issued by a service consumer device. The distributed system includes multiple service provider devices. Therefore, the service provider devices can be screened according to the routing order according to the preset routing strategy. The routing order of different services can be different, and the order of each route can be pre-specified. According to the service consumption instruction, the specified target routing order can be determined. According to the target routing order, the target service provider device is screened and obtained, and the target service provider device processes the service consumption instruction to provide services to the user. The problem that the routing order of different services cannot be flexibly changed in the prior art is solved. It ensures that in different scenarios, the routes can be arranged in the desired order to avoid the inability to complete transaction instructions and improve the processing efficiency of instructions.

[0083] Figure 4 A flowchart of an instruction processing method based on distributed services provided in an embodiment of the present application is provided. This embodiment is an optional embodiment based on the above embodiment.

[0084] In this embodiment, after responding to the service consumption instruction issued by the service consumer device, it can be additionally performed as follows: obtaining service parameters from the service consumption instruction, and caching the service parameters in a preset information carrier.

[0085] like Figure 4 As shown, the method comprises the following steps:

[0086] S401. In response to a service consumption instruction issued by a service consumer device, determine a target routing sequence corresponding to the service consumption instruction, obtain service parameters from the service consumption instruction, and cache the service parameters in a preset information carrier.

[0087] Wherein, in response to a service consumption instruction issued by a service consumer device, a target service is determined from the service consumption instruction, and a target routing sequence corresponding to the service consumption instruction is determined according to a pre-specified routing sequence.

[0088] The service consumption instruction may also include service-related parameters, such as service name version number, IP, number of retries, and timeout period. Service parameters may be interface information, etc. After responding to the service consumption instruction, the service parameters may be obtained from the service consumption instruction and cached in a preset information carrier. The preset information carrier may be a preset context virtual device or a distributed execution body. The information carrier is used to cache service parameters, which facilitates the subsequent acquisition of service parameters and solves the problem that interface information cannot be obtained.

[0089] In this embodiment, before responding to the service consumption instruction issued by the service consumer device, the method further includes: adding the service parameters to the annotation of the route according to a preset annotation marking algorithm.

[0090] Specifically, you can add sequential annotations to routes in advance, or you can add service parameters to the annotations. You can select a route to which you want to add annotations for service parameters from multiple routes, and add the service parameters to the annotations of the route. The service parameters added to the annotations are pre-determined parameters, for example, the service parameters can be interface class information.

[0091] Interface class information is a basic element of service call. Only after obtaining the interface class information can the assembly of other service information be further completed and the service call be completed. In the prior art, in a unitized scenario, the interface class information cannot be obtained in the unit route, which affects cross-unit forwarding. The embodiment of the present application can pre-add the interface class information to the annotation of the unit route. In other words, the service parameters can be obtained from the service consumption instruction or from the annotation.

[0092] The beneficial effect of such a setting is that service parameters such as interface class information can be directly obtained from the route, solving the problem of being unable to forward across units and further improving the processing efficiency of instructions.

[0093] In this embodiment, after responding to the service consumption instruction issued by the service consumer device and determining the target routing sequence corresponding to the service consumption instruction, it also includes: obtaining service parameters from the annotation of the target route in the target routing sequence, and caching the service parameters in a preset information carrier.

[0094] Specifically, if the target route in the target route sequence has an annotation of a service parameter, the service parameter in the annotation can be obtained when the target route is executed, and the service parameter can be cached in a preset information carrier. For example, when executing a unit route, the interface class information is obtained by scanning the annotation, and the interface class information is assigned to the information carrier, so as to obtain the interface class information from the information carrier and complete the service call.

[0095] The beneficial effect of such a setting is that service parameters are obtained through annotations, which solves the problem that interface class information cannot be obtained in the prior art and improves the processing efficiency of instructions.

[0096] S402. According to the target routing sequence and based on a preset routing screening strategy, the service provider devices in the distributed system are screened to obtain the target service provider devices; wherein the preset routing screening strategy represents rule information for screening the service provider devices.

[0097] After the target service provider device is determined, it is necessary to call the service in the target service provider device to complete the processing of the instruction.

[0098] In this embodiment, after obtaining the target service provider device, it also includes: assembling the service parameters in the information carrier in the target service provider device according to the preset information storage location, and the target service provider device makes a service call after assembly to provide services for the service consumer device.

[0099] Specifically, in the call of distributed services, interface information is the basic element of service call. Only after obtaining the interface information can other service parameters be assembled to complete the service call. Other service parameters can be service parameters other than interface information, for example, user account, initiation time, amount, etc.

[0100] The information storage location of each service parameter is pre-set in the service provider device. The service parameters are obtained from the information carrier, and the service parameters are assembled in the target service provider device according to the information storage location. After assembly, the target service provider device can make service calls, provide services to the service consumer device, and complete the processing of instructions.

[0101] The beneficial effect of such a setting is that the required service parameters can be obtained and assembled, which is conducive to the invocation of the service and improves the processing efficiency of the instructions.

[0102] S403: Send the service consumption instruction to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

[0103] The embodiment of the present application determines that a service needs to be provided to a service consumer by responding to a service consumption instruction issued by a service consumer device. The distributed system includes multiple service provider devices. Therefore, the service provider devices can be screened according to the routing order according to the preset routing strategy. The routing order of different services can be different, and the order of each route can be pre-specified. According to the service consumption instruction, the specified target routing order can be determined. According to the target routing order, the target service provider device is screened and obtained, and the target service provider device processes the service consumption instruction to provide services to the user. The problem that the routing order of different services cannot be flexibly changed in the prior art is solved. It ensures that in different scenarios, the routes can be arranged in the desired order to avoid the inability to complete transaction instructions and improve the processing efficiency of instructions.

[0104] Figure 5 This is a schematic diagram of the structure of a distributed service-based instruction processing device provided in an embodiment of the present application. The device is applied to a distributed system, which includes at least two service provider devices. The device can be implemented by software, hardware, or a combination of both. Figure 5 As shown, the apparatus includes: a target routing sequence determination module 501 , a target service provider device determination module 502 and an instruction processing module 503 .

[0105] The target routing sequence determination module 501 is used to determine the target routing sequence corresponding to the service consumption instruction issued by the service consumer device in response to the service consumption instruction; wherein the service consumption instruction is used to instruct the processing of transaction information;

[0106] The target service provider device determination module 502 is used to filter the service provider devices in the distributed system according to the target routing sequence and based on a preset routing screening strategy to obtain the target service provider device; wherein the preset routing screening strategy represents rule information for filtering the service provider devices;

[0107] The instruction processing module 503 is used to send the service consumption instruction to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

[0108] Optionally, the target routing sequence determination module 501 includes:

[0109] A target service determination unit, configured to respond to a service consumption instruction issued by a service consumer device and determine a target service corresponding to the service consumption instruction;

[0110] The sequence determination unit is used to determine the target routing sequence of the target service according to the association relationship between the preset service and the routing sequence.

[0111] Optionally, a sequence determination unit is used to:

[0112] Determine at least two target routes corresponding to the target service according to the preset association relationship between the service and the route;

[0113] The pre-set sequence annotation in the target route is obtained, and the target route is sorted according to the sequence annotation to obtain the target route sequence.

[0114] Optionally, the device further comprises:

[0115] The sequence annotation marking module is used to mark the sequence annotation on each route in the distributed system according to a preset annotation marking algorithm before obtaining the sequence annotation preset in the target route, and the sequence annotation is used to display the specified route sequence.

[0116] Optionally, the routing in the distributed system includes at least one of conditional routing, script routing, simulation routing, unit routing and custom routing.

[0117] Optionally, the target service provider device determination module 502 includes:

[0118] A screening strategy determining unit, used to determine a route screening strategy for each target route in the target route sequence;

[0119] The service provider device screening unit is used to screen the target routes in the target route sequence for service provider devices in sequence according to the route screening policy of the target route to obtain the target service provider device.

[0120] Optionally, the service provider device screening unit is specifically used to:

[0121] According to the target route sequence, determine the target route of the current execution of the route screening policy as the first route;

[0122] Filtering the service provider devices in the distributed system according to the route screening policy of the first route to obtain a first candidate service provider device;

[0123] If there is a target route after the first route in the target route sequence, determining the target route after the first route as the second route;

[0124] Screening the first candidate service provider device according to the route screening policy of the second route to obtain a second candidate service provider device;

[0125] If there is no target route after the second route in the target route sequence, the second candidate service provider device is determined as the target service provider device.

[0126] Optionally, the device further comprises:

[0127] The service parameter acquisition module is used to acquire service parameters from the service consumption instruction after responding to the service consumption instruction issued by the service consumer device, and cache the service parameters in a preset information carrier.

[0128] Optionally, the device further comprises:

[0129] The parameter assembly module is used to assemble the service parameters in the information carrier in the target service provider device according to the preset information storage location after obtaining the target service provider device, and the target service provider device makes a service call after the assembly to provide services for the service consumer device.

[0130] Optionally, the device further comprises:

[0131] The parameter marking module is used to add service parameters to the annotation of the route according to a preset annotation marking algorithm before responding to the service consumption instruction issued by the service consumer device.

[0132] Optionally, the device further comprises:

[0133] The parameter acquisition module is used to respond to the service consumption instruction issued by the service consumer device, determine the target route sequence corresponding to the service consumption instruction, obtain the service parameters from the annotation of the target route in the target route sequence, and cache the service parameters in a preset information carrier.

[0134] The embodiment of the present application determines that a service needs to be provided to a service consumer by responding to a service consumption instruction issued by a service consumer device. The distributed system includes multiple service provider devices. Therefore, the service provider devices can be screened according to the routing order according to the preset routing strategy. The routing order of different services can be different, and the order of each route can be pre-specified. According to the service consumption instruction, the specified target routing order can be determined. According to the target routing order, the target service provider device is screened and obtained, and the target service provider device processes the service consumption instruction to provide services to the user. The problem that the routing order of different services cannot be flexibly changed in the prior art is solved. It ensures that in different scenarios, the routes can be arranged in the desired order to avoid the inability to complete transaction instructions and improve the processing efficiency of instructions.

[0135] Figure 6It is a block diagram of an electronic device according to an exemplary embodiment, which device may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0136] The device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0137] The processing component 602 generally controls the overall operation of the device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0138] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0139] The power supply component 606 provides power to the various components of the device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 600.

[0140] The multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0141] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the device 600 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0142] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0143] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the device 600, and the sensor assembly 614 can also detect the position change of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration / deceleration of the device 600, and the temperature change of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0144] The communication component 616 is configured to facilitate wired or wireless communication between the device 600 and other devices. The device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0145] In an exemplary embodiment, the apparatus 600 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0146] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of the device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0147] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a terminal device, enables the terminal device to execute the above-mentioned instruction processing method based on distributed services of the terminal device.

[0148] The present application also discloses a computer program product, including a computer program. When the computer program is executed by a processor, the distributed service-based instruction processing method as described in this embodiment is implemented.

[0149] Various embodiments of the systems and techniques described above in the present application can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs, which can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor, which can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0150] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or electronic device.

[0151] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0153] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data electronic device), or a computing system that includes middleware components (e.g., an application electronic device), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0154] The computer system may include a client and an electronic device. The client and the electronic device are generally far away from each other and usually interact through a communication network. The relationship between the client and the electronic device is generated by computer programs running on corresponding computers and having a client-electronic device relationship with each other. The electronic device may be a cloud electronic device, also known as a cloud computing electronic device or a cloud host, which is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The electronic device may also be an electronic device of a distributed system, or an electronic device combined with a blockchain. It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0155] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0156] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A distributed service-based instruction processing method, characterized in that: The method is applied to a distributed system, wherein the distributed system includes at least two service provider devices, and the method includes: In response to a service consumption instruction issued by a service consumer device, determining a target service corresponding to the service consumption instruction; wherein the service consumption instruction is used to instruct processing of transaction information; Determine at least two target routes corresponding to the target service according to the association relationship between services and routes preset in different scenarios; Obtaining a pre-set sequence annotation in the target route, and sorting the target route according to the sequence annotation to obtain a target route sequence; wherein, if the target service is in a unitized scenario, the route sequence of the unit route is the last one; According to the target routing sequence, based on a preset routing screening strategy, the service provider devices in the distributed system are screened to obtain a target service provider device; wherein the preset routing screening strategy represents rule information for screening the service provider devices; The service consumption instruction is sent to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

2. The method according to claim 1, characterized in that: Before obtaining the pre-set sequence annotation in the target route, it also includes: According to a preset annotation marking algorithm, a sequence annotation is marked on each route in the distributed system, and the sequence annotation is used to display the specified route sequence.

3. The method according to claim 1, characterized in that The routing in the distributed system includes at least one of conditional routing, script routing, simulation routing, unit routing and custom routing.

4. The method according to claim 1, characterized in that: According to the target routing sequence and based on a preset routing screening strategy, the service provider devices in the distributed system are screened to obtain the target service provider devices, including: Determining a route screening strategy for each target route in the target route sequence; According to the route screening policy of the target route, the target routes in the target route sequence are screened for service provider devices in sequence to obtain the target service provider device.

5. The method according to claim 4, characterized in that According to the route screening policy of the target route, the target routes in the target route sequence are screened for service provider devices in sequence to obtain the target service provider device, including: According to the target route sequence, determine the target route of the current execution of the route screening policy as the first route; Filtering the service provider devices in the distributed system according to the route screening policy of the first route to obtain a first candidate service provider device; If there is a target route after the first route in the target route sequence, determining the target route after the first route as the second route; Screening the first candidate service provider device according to the route screening policy of the second route to obtain a second candidate service provider device; If there is no target route after the second route in the target route sequence, the second candidate service provider device is determined as the target service provider device.

6. The method according to claim 1, characterized in that After responding to the service consumption instruction issued by the service consumer device, the method further includes: The service parameters are obtained from the service consumption instruction, and the service parameters are cached in a preset information carrier.

7. The method according to claim 6, characterized in that After obtaining the target service provider device, the following steps are also included: According to a preset information storage location, the service parameters in the information carrier are assembled in the target service provider device, and the target service provider device performs a service call after the assembly to provide services for the service consumer device.

8. The method according to claim 1, characterized in that Before responding to the service consumption instruction issued by the service consumer device, the method further includes: According to the preset annotation marking algorithm, the service parameters are added to the route annotation.

9. The method according to claim 8, characterized in that After responding to the service consumption instruction issued by the service consumer device and determining the target routing sequence corresponding to the service consumption instruction, the method further includes: The service parameters are obtained from the annotation of the target route in the target route sequence, and the service parameters are cached in a preset information carrier.

10. An instruction processing device based on distributed services, characterized in that: The device is applied to a distributed system, wherein the distributed system includes at least two service provider devices, and the device includes: The target route sequence determination module is used to determine the target service corresponding to the service consumption instruction in response to the service consumption instruction issued by the service consumer device; determine at least two target routes corresponding to the target service according to the association relationship between the preset service and the route in different scenarios; obtain the sequence annotation preset in the target route, and sort the target routes according to the sequence annotation to obtain the target route sequence; wherein, if the target service is in a unitized scenario, the route sequence of the unit route is the last one; the service consumption instruction is used to instruct the processing of transaction information; A target service provider device determination module is used to screen the service provider devices in the distributed system according to the target routing sequence and based on a preset routing screening strategy to obtain a target service provider device; wherein the preset routing screening strategy represents rule information for screening the service provider devices; The instruction processing module is used to send the service consumption instruction to the target service provider device for processing; wherein the target service provider device is used to provide services to the service consumer device according to the service consumption instruction.

11. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the distributed service providing method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the distributed service providing method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the distributed service providing method as claimed in any one of claims 1 to 9.