CN118012941A - Service processing method, device and computer readable storage medium - Google Patents

Service processing method, device and computer readable storage medium Download PDF

Info

Publication number
CN118012941A
CN118012941A CN202410309083.6A CN202410309083A CN118012941A CN 118012941 A CN118012941 A CN 118012941A CN 202410309083 A CN202410309083 A CN 202410309083A CN 118012941 A CN118012941 A CN 118012941A
Authority
CN
China
Prior art keywords
service
request
service request
consistency requirement
interface
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
CN202410309083.6A
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.)
China Travelsky Technology Co Ltd
Original Assignee
China Travelsky 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 China Travelsky Technology Co Ltd filed Critical China Travelsky Technology Co Ltd
Priority to CN202410309083.6A priority Critical patent/CN118012941A/en
Publication of CN118012941A publication Critical patent/CN118012941A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a service processing method, a device and a computer readable storage medium, wherein the method comprises the following steps: receiving a service request through an interface module, wherein the service request is sent out by a service client; analyzing the service request through an interface module to obtain the consistency requirement of the service request; if the consistency requirement of the service request is a strong consistency requirement, calling a target interface through a service processing module to obtain service information based on the target interface by inquiring a target cluster, wherein the target cluster is a distributed cluster without inquiring from a preset cache; if the consistency requirement of the service request is the final consistency requirement, the service information is queried in the preset cache through the service processing module, and the query is not needed in the target cluster.

Description

Service processing method, device and computer readable storage medium
Technical Field
The present application relates to the field of information processing, and more particularly, to a service processing method, apparatus, and computer readable storage medium.
Background
Data high availability is a key factor in system high availability.
With the development of new generation information technology, digital and intelligent transformation has become a core strategy of many airlines.
The existing database of airlines generally adopts Etcd databases. Etcd is used as an open-source, distributed and strong-consistency key-value type database, raft protocol is adopted as a consistency algorithm in the interior, and the key-value type database is mainly used for sharing configuration and service discovery (Service Discovery) in a distributed scene, and is usually selected as a service registry in a distributed system. CAP theory in distributed system architecture states that: in a distributed system, consistency (Consistency), availability (Availability) and partition fault tolerance (Partition tolerance) are incompatible, and at most, two are only possible, and the partition fault tolerance is divided according to the CAP theory, and Etcd belongs to a CP model. In civil aviation business scenes, on the premise of requiring consistency, the business requirements can be met by ensuring the final consistency for most business scenes except that a small number of scenes need to strictly follow a CP model.
However, under Etcd strong-consistency CP model, the usability of the system is limited to a certain extent, and the system becomes a bottleneck of the platform in a multi-connection and high-concurrency scene.
Disclosure of Invention
In view of this, the present application provides a service processing method, apparatus and computer readable storage medium, which solve the problem that the system availability is affected in the strong consistency CP model of Etcd databases in the prior art.
In order to achieve the above purpose, the present application provides the following technical solutions:
a service processing method, comprising:
Receiving a service request through an interface module, wherein the service request is sent out by a service client;
Analyzing the service request through an interface module to obtain the consistency requirement of the service request;
If the consistency requirement of the service request is a strong consistency requirement, calling a target interface through a service processing module to obtain service information based on the target interface in a target cluster query, wherein the target cluster is a distributed cluster;
And if the consistency requirement of the service request is the final consistency requirement, inquiring service information in a preset cache through a service processing module.
A service processing apparatus comprising:
A target cluster;
The interface module is used for receiving a service request, analyzing the service request to obtain the consistency requirement of the service request, and sending the service request by the service client;
the business processing module is used for calling a target interface to obtain service information based on the target interface in a target cluster query if the consistency requirement of the business request is a strong consistency requirement, wherein the target cluster is a distributed cluster; and if the consistency requirement of the service request is the final consistency requirement, inquiring service information in a preset cache.
A computer readable storage medium storing instructions which, when executed by a computer, are to perform a method as claimed in any one of the preceding claims.
As can be seen from the above technical solution, compared with the prior art, the present application provides a service processing method, apparatus and computer readable storage medium, wherein the method includes: receiving a service request sent by a service client through an interface module, analyzing the consistency requirement of the service request through the interface module, and if the service request is a strong consistency requirement, calling a target interface through a service processing module to inquire in a target cluster through the target interface to obtain service information corresponding to the service request, wherein the service information is not inquired from a preset cache, and the target cluster is a distributed Etcd cluster; if the service request is a final consistency requirement, the service processing module is used for inquiring service information in a preset cache without inquiring the service information in a target cluster, the method supports two processing modes of strong consistency and final consistency, the interface module determines the consistency requirement of the service request, and respectively triggers different service discovery logics, thereby avoiding Etcd bottlenecks by using a cache mechanism and improving integral request concurrency.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a service processing method according to an embodiment of the present application;
FIG. 2 is a system diagram of the service processing method according to the embodiment of the present application;
fig. 3 is a flowchart of querying service information in a preset cache by a service processing module in this embodiment;
fig. 4 is a flowchart of authentication of a service request by an interface module in the present embodiment;
Fig. 5 is a flowchart of the initializing process of the electronic device in the present embodiment;
fig. 6 is a schematic structural diagram of a service processing device according to an embodiment of the present application.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
Fig. 1 is a flowchart of an embodiment of a service processing method provided by the present application, where the method is applied to an electronic device, and the electronic device is provided with a distributed cluster, and the cluster adopts Etcd databases, and the method includes the following steps:
step S101: receiving a service request through an interface module, wherein the service request is sent out by a service client;
Wherein the service client sends a service request to the electronic device to request to execute a service.
The electronic equipment receives a service request sent by a service client through an interface module.
The service request may include a service request with a strong consistency requirement, a service request with a final consistency requirement, and the like, and in this embodiment, the interface module may trigger execution of different response steps for different consistency requirements of the received service request.
The interface module adopts a RESTful API (Application Program Interface ) to provide services in the form of HTTP (Hypertext Transfer Protocol ) services to the outside, and processes the requests of the business clients.
After receiving the service request, the interface module needs to authenticate the service request, and a specific flow will be illustrated in fig. 4.
Before receiving the service request, the interface module further performs an initialization process on the electronic device, and a specific flow will be illustrated in fig. 5.
Step S102: analyzing the service request through an interface module to obtain the consistency requirement of the service request;
wherein the request carries a plurality of parameters.
In some implementations, the strong and final coherency requirements are distinguished for read requests, while the final coherency requirement is generally considered to be required for query requests.
The interface module analyzes the service request, and specifically determines the consistency requirement of the service request according to different parameter options of the service request.
Wherein the consistency requirement includes a strong consistency requirement and a final consistency requirement.
The strong consistency requirement is information which is required to be obtained in the distributed cluster, so as to ensure that the obtained information is completely consistent with the information in the distributed cluster.
The final consistency requirement is that in a distributed cluster, the same data on any node at any moment is not guaranteed to be the same, but the same data on different nodes always changes in a converging direction along with the migration of time.
If it is determined that the consistency requirement of the service request is a strong consistency requirement, step S103 is triggered; if it is determined that the consistency requirement of the service request is a final consistency requirement, step S104 is triggered.
Specifically, the service information in this embodiment is information stored in the service registration stage.
Wherein the service request is specifically for service discovery, for allowing other users to discover information stored during the service registration phase.
Step S103: if the consistency requirement of the service request is a strong consistency requirement, calling a target interface through a service processing module to obtain service information based on the target interface in a target cluster query, wherein the target cluster is a distributed cluster;
if the service request is a strong consistency request, the service processing module calls a target interface, wherein the target interface is an interface for inquiring service information in a target cluster.
And inquiring the service information corresponding to the service request in the target cluster based on the target interface.
Wherein the target cluster is Etcd clusters and the target interface may be a Etcd interface.
The Etcd clusters are used for distributing storage service instance information, leader elections during network partition can be processed gracefully, faults of machines are handled, and reliability and strong consistency of cluster data are guaranteed.
If the consistency requirement of the service request is a strong consistency requirement, the target cluster is directly queried, but query is not performed from a preset cache, so that the strong consistency of query results is ensured.
It should be noted that, if the service request is a service registration and service cancellation interface, the service request belongs to a service scenario where a data strong consistency requirement exists, and the relevant interface remains unchanged.
Step S104: if the consistency requirement of the service request is the final consistency requirement, inquiring service information in a preset cache through a service processing module.
And if the service request is the final consistency requirement, inquiring in a preset cache through a service processing module of the electronic equipment.
The preset buffer may be a buffer in the service processing module.
In some implementations, after receiving a service request, the service processing module initiates a service discovery pass to effect processing of the request.
As shown in fig. 2, a system diagram to which the service processing method is applied includes an electronic device 201 and a service client 202, where the electronic device includes an interface module 2011, a service processing module 2012 and a target cluster 2013, where the distributed cluster is specifically a Etcd cluster, a preset cache is set in the service processing module, and corresponding service information is stored in the preset cache for a service required by final consistency. Only one service client is shown in fig. 2, and in a specific implementation, the electronic device may be connected to several service clients.
In some implementations, the service information is first queried in the preset buffer, and if no corresponding service information exists in the preset buffer, the service information is queried from the target cluster, and a specific flow will be illustrated in fig. 3.
In this embodiment, the electronic device supports two processing modes of strong consistency and final consistency, and the interface module determines the consistency requirement of the service request according to different parameter options in the service request, and triggers different service discovery logics respectively, so that a Etcd bottleneck is avoided by using a cache mechanism, and overall request concurrency is improved.
Fig. 3 is a flowchart of querying service information in a preset cache by a service processing module in this embodiment, where the embodiment includes the following steps:
Step S301: inquiring service information corresponding to the service name in a preset cache by a service processing module according to the service name of the service request;
In the preset cache, the service name is key, and corresponding service information is stored.
The service processing module analyzes the service request to obtain the service name.
After obtaining the service name of the service request, inquiring corresponding service information in a preset cache in the service processing module.
The service name in the cache is key, and the storage content is the registration information of a plurality of service instances of the service.
Specifically, the registration information may include version information of the service, protocol, interface name, each instance IP, provided method name, and the like.
If service information corresponding to the service name is queried in the preset cache, step S302 is executed; otherwise, steps S303-304 are performed.
Step S302: if the service information corresponding to the service name is obtained by inquiring in the preset cache through the service processing module, the service information is fed back to the interface module as an inquiring result;
If the service information corresponding to the service name exists in the preset cache, the target service information is fed back to the interface module as a query result, and the interface module further feeds back the query result to the service client to realize the query process.
Step S303: if the service information corresponding to the service name is not inquired in the preset cache through the service processing module, calling a target interface through the service processing module to inquire the service information in the target cluster based on the target interface, and feeding the service information back to the interface module as an inquiry result;
If the service information corresponding to the service name does not exist in the preset cache, the service information corresponding to the service name is not inquired in the preset cache, and then the service information corresponding to the service name is inquired in the target cluster.
Specifically, a target interface is called, service information corresponding to the service name is inquired in a target cluster through the target interface, and the service information is fed back to an interface module as an inquiry result.
Then, the interface module further feeds back the query result to the service client to realize the query process
Step S304: and storing the service information into a preset cache.
After service information is obtained from the target cluster by inquiry, the service information is stored in a preset cache, so that the service information can be directly obtained by searching from the preset cache when a service request with a subsequent final consistency requirement is subsequently inquired, the number of times of inquiry in the target cluster is reduced, and the Etcd bottleneck is avoided.
The method for storing the service information in the preset cache specifically comprises the following steps: and correspondingly storing the service information and the corresponding service name in a preset cache.
In the preset cache, the name corresponding to the service information is key, and the service information is stored as a value in a key-value (key value) pair mode.
Of course, in the specific implementation, other modes may be adopted to store the service name and the corresponding service information, which is not limited in the present application.
In this embodiment, for the service request of the final consistency requirement, the service request is firstly queried in a preset buffer locally of the service processing module, if the preset buffer has corresponding service information, the service request is fed back to the interface module, if the preset buffer has no corresponding service information, the target interface is invoked, the service information is queried in the target cluster through the target interface, so that the query response of the service request of the final consistency requirement is realized, the invocation of the interface is reduced Etcd, and the Etcd bottleneck is avoided.
In some implementations, it is also necessary to update the service information in the cache.
And if the service information of the first service in the target cluster is monitored to be updated through the service processing module, the service information of the first service in the preset cache is cleared.
The service processing module is further provided with Etcd interception cooperative distance to intercept Etcd events in the target cluster, clear data in a preset cache according to the interception result, and then can save the service information of the first service in the preset cache when the service information of the first service is requested, so as to ensure that the service information in the preset cache is consistent with the service information in the target cluster finally.
The target cluster comprises a plurality of services, each service corresponds to service information, and if the service processing module monitors that the service information of the first service in the target cluster is updated, the service information of the first service in the preset cache can be marked as dirty data, and the dirty data is cleared.
In some implementations, the service processing module starts Etcd the listening coordination process immediately after establishing a connection with the target cluster, listens for Etcd events of the target cluster, if a Etcd response fed back from the target cluster is detected, circularly reads Etcd an event list in the response result, obtains a key value in a single event through analysis of each event data, and then collects a complete event key value list related to modification (EVENTKEYLIST). If an event key exists in the event key list, for example, k0, the stored data in the Etcd clusters with k0 as the key changes. At this time, the cache data having k0 as a key value in the cache becomes dirty data, and need to be cleared. And cleaning the cache dirty data according to the event key value list, and continuing to monitor after cleaning is completed.
Wherein the Etcd event represents a change in the service information.
The answer result includes adding and deleting information of the stored information Etcd, such as adding a certain node, deleting a certain node, or updating the content of a certain node.
The dirty data in the cache may be directly deleted, or after the dirty data is set, the dirty data is triggered to be deleted after a subsequent request is received.
In some implementations, the service processing module performs data transmission with the target cluster through a pipeline, the Etcd listens to the Cheng Zhenting pipeline information, and if an exit signal is received, the resource is released, and the protocol is exited; if the exit signal is not received, judging that the connection is released abnormally according to the connection state with Etcd, if the connection is abnormal, releasing resources, exiting the cooperative journey, and if the connection is normal, performing interception release from a pipeline of Etcd to receive a Etcd response.
In some implementations, in the service processing module, a service discovery processing protocol is created for each service request, if the Etcd listens to the protocol Cheng Zhenting pipe information, an exit signal is received, and after releasing the resource, the service discovery processing protocol that is not currently processed is also notified to exit.
In this embodiment, the service information update of each service in the Etcd cluster is also monitored, if the service information update of the first service in the Etcd cluster is performed on the first service in the preset cache, the service information of the first service in the preset cache is cleared, and then the service information of the first service in the Etcd cluster is stored in the preset cache according to the request, so as to ensure that the preset cache is finally consistent with the service information in the Etcd cluster.
In some implementations, the service information obtained from the query for service requests requiring strong consistency also needs to be cached.
And if the consistency requirement of the service request is a strong consistency requirement, calling a target interface through the service processing module so as to store the service information into a preset cache after the service information is obtained by inquiring the target cluster based on the target interface.
After the service processing module queries the service information of a certain service in the target interface through the target interface, the service information is stored in a preset cache, so that a subsequent service request with a final consistency requirement can be directly obtained from the preset cache when the service information of the service is requested.
And storing the service name and the service information in a key-value form in a preset cache.
The process of storing the service information in the preset buffer is similar to the process in fig. 3, and is not described in detail in this embodiment.
Fig. 4 is a flowchart of authentication of a service request by an interface module in this embodiment, and the embodiment includes the following steps:
step S401: analyzing and obtaining the authority of a service client corresponding to the service request through an interface module;
for the operation of the target cluster, different service clients have different execution authorities, for example, some service clients allow write operations to be performed, and some service clients only allow query operations to be performed.
After receiving a service request sent by a service client, the interface analysis module can identify the execution authority of the service client corresponding to the service request.
Specifically, the service request carries identity information of the service client, and corresponding execution authority can be inquired and obtained through the identity information and the authorization record.
The interface module also determines whether the request operation of the service request is a query operation or a write operation.
Step S402: triggering a step of analyzing the service request through the interface module to obtain the consistency requirement of the service request based on the permission of the service client and the request operation matching of the service request.
When determining the authority of the service client corresponding to the service request and the request operation of the service request, comparing the authority of the service client and the request operation of the service request, and if the authority of the service client can execute the request operation, triggering a subsequent interface module to analyze and obtain the consistency requirement of the service request; otherwise, ending.
In some implementations, if the authority of the service client is not capable of performing the request operation, a reason for the failure of the request, etc. may also be fed back to the service client.
By identifying the authority of the service client, illegal system access override operation is avoided, and the security of the target cluster is improved.
In this embodiment, the Etcd clusters are used as the underlying data storage, which provides a strong consistency and high availability guarantee for service information sharing among clusters in a distributed environment. Etcd clusters are positioned at the rear end of the device and do not directly provide services to the outside. In addition, authentication needs to be carried out on the service request, illegal system access and unauthorized operation are avoided, the security of data processing is improved, meanwhile, the concurrency of connection to the Etcd cluster is controlled, and the stability and security of the Etcd cluster are enhanced.
In some implementations, when querying for service information in the target cluster, locking for querying for the service is also required.
If the consistency requirement of the service request is a strong consistency requirement, acquiring the distributed lock by the service name corresponding to the service request, so that the target cluster only receives the query operation executed by the target interface called by the service request at the current moment.
In some implementations, in the service processing module, a service discovery processing assistant is created for each service request, and the service discovery processing assistant is responsible for the service request transferred between the service processing module and the interface module, and the generation and consumption of cache information can be involved in the processing process.
Before a service processing module invokes a target interface, a service discovery processing cooperative program obtains a distributed lock by requesting a service name as a key, so that only one query request to a Etcd cluster can be provided for the query of the same service at the same time, and after the service discovery processing cooperative program is completely operated, other requests initiated by the service discovery processing cooperative program directly obtain data from a cache, thereby avoiding the impact on the Etcd cluster during cache breakdown.
Fig. 5 is a flowchart of an initializing process performed by the electronic device in the present embodiment, and the present embodiment includes the following steps:
Step S501: creating a preset cache through a service processing module;
wherein, a preset buffer memory is created in the service processing module to store the query result.
Specifically, the service name is key in the preset cache, and the registration information of a plurality of service instances corresponding to the service is stored, wherein the registration information is the service information corresponding to the service name.
Step S502: communication resources between the interface module and the traffic handling module are created.
The communication resource between the interface module and the service processing module can be pipeline resource, and the pipeline resource is a resource for communication between modules in the implementation process, and specifically comprises a message queue for system process communication, a channel for communication between coroutines, and the like.
In some implementations, during the initialization process, the business client also initializes to maintain its connection with the Etcd clusters.
Wherein, after the initialization process is completed, a snoop coroutine may be initiated to snoop Etcd events.
In this embodiment, the electronic device is initialized, a preset cache is created in the service processing module, and a communication resource between the interface module and the service processing module is created, so that a service discovery query mechanism capable of providing two modes of strong consistency and final consistency is ensured.
Although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Corresponding to the embodiment of the service processing method provided by the application, the application also provides an embodiment of a device applying the service processing method.
Fig. 6 is a schematic structural diagram of a service processing device according to an embodiment of the present application, where the device includes the following structures: an interface module 601, a traffic handling module 602 and a target cluster 603;
the interface module 601 is configured to receive a service request, analyze the service request to obtain a consistency requirement of the service request, and send the service request by a service client;
The service processing module 602 is configured to invoke a target interface if the consistency requirement of the service request is a strong consistency requirement, so as to query a target cluster based on the target interface to obtain service information, where the target cluster is a distributed cluster; if the consistency requirement of the service request is the final consistency requirement, inquiring service information in a preset cache.
Optionally, if the consistency requirement of the service request is a final consistency requirement, the service processing module includes:
The query unit is used for querying service information corresponding to the service name in a preset cache according to the service name of the service request;
The feedback unit is used for feeding back the service information serving as a query result to the interface module if the service information corresponding to the service name is obtained by querying in the preset cache;
The calling unit is used for calling the target interface if the service information corresponding to the service name is not inquired in the preset cache, so that the service information is inquired in the target cluster based on the target interface, and the service information is fed back to the interface module as an inquiry result;
the first storage unit stores the service information into a preset cache.
Optionally, the storage unit is specifically configured to:
the service information and the corresponding service name are created in the cache in the form of key-value pairs.
Optionally, the service processing module further includes:
The clearing unit is used for presetting the service information of the first service stored in the cache, and clearing the service information of the first service in the cache if the update of the service information of the first service in the target cluster is monitored.
Optionally, the service processing module further includes:
And the second storage unit is used for calling the target interface through the service processing module if the consistency requirement of the service request is a strong consistency requirement so as to store the service information into a preset cache after the service information is obtained by inquiring the target cluster based on the target interface.
Optionally, the interface module is further configured to:
Before analyzing the service request to obtain the consistency requirement of the service request, analyzing to obtain the authority of the service client corresponding to the service request;
And triggering the service processing module based on the permission of the service client and the request operation matching of the service request.
Optionally, the service processing module is further configured to:
before the target interface is called, the distributed lock is acquired by the service name corresponding to the service request, so that the target cluster only receives the query operation executed by the target interface called by the service request at the current moment.
Optionally, the service processing module is further configured to:
Before receiving the service request through the interface module, a preset cache is created to create communication resources between the interface module and the service processing module.
In this embodiment, in the service processing apparatus, for a service request required by final consistency, a query is first performed in a preset buffer locally provided by the service processing module, if there is corresponding service information in the preset buffer, the service request is fed back to the interface module, if there is no corresponding service information in the preset buffer, a target interface is invoked, service information is obtained by querying a target cluster through the target interface, so that a query response to the service request required by final consistency is realized, and the invocation of the interface Etcd is reduced, thereby avoiding the Etcd bottleneck.
It should be noted that, the modules/units described in the embodiments of the present disclosure may be implemented by software, or may be implemented by hardware. Wherein the name of the module/unit does not constitute a limitation of the module/unit itself in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
Corresponding to the embodiment of the service processing method provided by the application, the application also provides a computer readable storage medium embodiment applying the service processing method.
The computer readable storage medium has stored therein instructions which, when executed by a computer, are adapted to carry out the method according to any of the method embodiments described above.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).

Claims (10)

1. A service processing method, comprising:
Receiving a service request through an interface module, wherein the service request is sent out by a service client;
Analyzing the service request through an interface module to obtain the consistency requirement of the service request;
If the consistency requirement of the service request is a strong consistency requirement, calling a target interface through a service processing module to obtain service information based on the target interface in a target cluster query, wherein the target cluster is a distributed cluster;
And if the consistency requirement of the service request is the final consistency requirement, inquiring service information in a preset cache through a service processing module.
2. The service processing method according to claim 1, wherein if the consistency requirement of the service request is a final consistency requirement, querying, by the service processing module, service information in a preset cache includes:
Inquiring service information corresponding to the service name in a preset cache by a service processing module according to the service name of the service request;
If the service information corresponding to the service name is obtained by inquiring in a preset cache through the service processing module, the service information is fed back to the interface module as an inquiring result;
if the service information corresponding to the service name is not inquired in the preset cache through the service processing module, calling a target interface through the service processing module to inquire the service information in a target cluster based on the target interface, and feeding the service information back to the interface module as an inquiry result; and storing the service information into a preset cache.
3. The service processing method according to claim 2, wherein storing the service information in a preset cache includes:
and creating the service information and the corresponding service name in a cache in a key value pair mode.
4. The service processing method according to claim 2, characterized by further comprising:
And if the service information of the first service in the target cluster is monitored to be updated through the service processing module, the service information of the first service in the preset cache is cleared.
5. The service processing method according to claim 1, wherein if the consistency requirement of the service request is a strong consistency requirement, calling, by a service processing module, a target interface to obtain service information after a target cluster query based on the target interface, further comprising:
And storing the service information into a preset cache.
6. The service processing method according to claim 1, wherein before the analyzing the service request by the interface module obtains the consistency requirement of the service request, further comprising:
analyzing and obtaining the authority of the service client corresponding to the service request through an interface module;
And triggering the step of analyzing the service request through an interface module to obtain the consistency requirement of the service request based on the permission of the service client and the request operation matching of the service request.
7. The service processing method according to claim 1, wherein before the target interface is called by the service processing module, further comprising:
And acquiring a distributed lock according to the service name corresponding to the service request, so that the target cluster only receives the query operation executed by the target interface called by the service request at the current moment.
8. The service processing method according to claim 8, wherein before receiving the service request through the interface module, further comprising:
Creating a preset cache through the service processing module;
And creating communication resources between the interface module and the service processing module.
9. A service processing apparatus, comprising:
A target cluster;
The interface module is used for receiving a service request, analyzing the service request to obtain the consistency requirement of the service request, and sending the service request by the service client;
the business processing module is used for calling a target interface to obtain service information based on the target interface in a target cluster query if the consistency requirement of the business request is a strong consistency requirement, wherein the target cluster is a distributed cluster; and if the consistency requirement of the service request is the final consistency requirement, inquiring service information in a preset cache.
10. A computer readable storage medium storing instructions which, when executed by a computer, are adapted to carry out the method of any one of claims 1 to 6.
CN202410309083.6A 2024-03-18 2024-03-18 Service processing method, device and computer readable storage medium Pending CN118012941A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410309083.6A CN118012941A (en) 2024-03-18 2024-03-18 Service processing method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410309083.6A CN118012941A (en) 2024-03-18 2024-03-18 Service processing method, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN118012941A true CN118012941A (en) 2024-05-10

Family

ID=90956317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410309083.6A Pending CN118012941A (en) 2024-03-18 2024-03-18 Service processing method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN118012941A (en)

Similar Documents

Publication Publication Date Title
WO2020062131A1 (en) Container cloud management system based on blockchain technology
US9787671B1 (en) Highly available web-based database interface system
CN109684285B (en) User mode network file system file locking method, device and equipment
US7321566B2 (en) Hierarchical management system on distributed network management platform
US7925751B1 (en) Mechanism for controlled sharing of files in a clustered application environment
CN109960634B (en) Application program monitoring method, device and system
WO2017107827A1 (en) Method and apparatus for isolating environment
WO2011097932A1 (en) Method and apparatus for accessing database, database application system
CN112929180B (en) Kubernetes zero trust network security system and implementation method thereof
CN111698126A (en) Information monitoring method, system and computer readable storage medium
JP2023078322A (en) Method and apparatus for ensuring continued device operational reliability in cloud-degraded mode
CN115695139A (en) Method for enhancing micro-service system architecture based on distributed robust
CN109327506A (en) A kind of resource allocation methods, device and readable storage medium storing program for executing
CN113810474B (en) Request distribution method and terminal
CN118012941A (en) Service processing method, device and computer readable storage medium
CN104754029B (en) Determine the methods, devices and systems of master management server
US7350065B2 (en) Method, apparatus and program storage device for providing a remote power reset at a remote server through a network connection
CN114338177B (en) Directional access control method and system for Internet of things
CN110430258A (en) A kind of distributed type lock management method and device
CN113014565B (en) Zero trust architecture for realizing port scanning prevention and service port access method and equipment
US7912922B2 (en) Globally unique instance identification
WO2020259326A1 (en) Signal transmission method and apparatus
CN113590711A (en) High-elasticity extensible multi-chain data hierarchical shared storage system and method
CN112347141B (en) Data access control method, system, device and medium
CN115102854B (en) Remote procedure call route management control method, system and equipment for micro-service

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