WO2023240840A1 - 基于微服务的多渠道信息隔离方法、装置和计算机设备 - Google Patents

基于微服务的多渠道信息隔离方法、装置和计算机设备 Download PDF

Info

Publication number
WO2023240840A1
WO2023240840A1 PCT/CN2022/122102 CN2022122102W WO2023240840A1 WO 2023240840 A1 WO2023240840 A1 WO 2023240840A1 CN 2022122102 W CN2022122102 W CN 2022122102W WO 2023240840 A1 WO2023240840 A1 WO 2023240840A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
channel
microservice
information
channel identifier
Prior art date
Application number
PCT/CN2022/122102
Other languages
English (en)
French (fr)
Inventor
张文辉
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2023240840A1 publication Critical patent/WO2023240840A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5061Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the interaction between service providers and their network customers, e.g. customer relationship management

Definitions

  • This application relates to the field of data processing technology, and in particular to a microservice-based multi-channel information isolation method, device, computer equipment, storage media and computer program products.
  • Microservices are a software architecture that is gradually being widely used. Most online Internet medical platforms adopt microservice architecture. In the process of applying microservices, there are business scenarios with high concurrency and large transaction volume. Online Internet medical platform microservices The number ranges from hundreds to thousands. The structure of a single microservice is simple, but the overall system structure is very complex.
  • each application on the microservice platform will distinguish business data from different sources under the same user according to channels, and display them in a personalized manner; however, the inventor realized that the applications where each request source is located are very different.
  • this application also provides a multi-channel information isolation device based on microservices.
  • the device includes:
  • the service request receiving module is used to receive the service request sent by the user terminal to the server, and the server provides a microservice chain for the user terminal;
  • the target microservice in the microservice chain that has channel isolation requirements obtains the user channel identifier from the attachment information, isolates the channel information, and processes the business request.
  • this application also provides a computer-readable storage medium.
  • the computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by the processor, the following steps are implemented:
  • the target microservice in the microservice chain that has channel isolation requirements obtains the user channel identifier from the attachment information, isolates the channel information, and processes the business request.
  • the multi-channel information isolation method, device, computer equipment, storage medium and computer program product based on microservices when receiving the business request sent by the user terminal to the server, by analyzing the user channel information carried in the business request, we obtain The user accesses the channel identifier and passes the user channel identifier to the attachment information of the temporary status recorder; the target microservice in the microservice chain that needs to isolate the channel information obtains the user channel identifier from the attachment information for business request processing and does not require modification.
  • Microservices that are hierarchically called with the target microservice are used to obtain the user channel identification; based on the context information transfer in the microservice mode, the link transmission of the user channel identification information is realized without modifying the interface between the original microservices. Converging the scope of changes on the microservice chain greatly simplifies the development process, reduces the cost of transformation, and reduces the difficulty of transformation.
  • Figure 1 is an application environment diagram of the multi-channel information isolation method based on microservices in one embodiment
  • Figure 4 is a schematic diagram of a microservice chain in an embodiment
  • Figure 5 is a structural block diagram of a multi-channel information isolation device based on microservices in one embodiment
  • Figure 6 is an internal structure diagram of a computer device in one embodiment.
  • the multi-channel information isolation method based on microservices can be applied to the application environment as shown in Figure 1.
  • the terminal 102 communicates with the server 104 through the network.
  • the data storage system can store data that the server 104 needs to process.
  • the data storage system can be integrated on the server 104, or can be placed on the cloud or other network servers.
  • the server adopts a microservice architecture.
  • the server can be but is not limited to an Internet medical platform; the server provides a microservice chain for user terminals.
  • the server receives business requests sent by user terminals and processes the user channel information carried by the business requests.
  • the terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices, portable wearable devices, etc.
  • the server 104 can be implemented as an independent server or a server cluster composed of multiple servers.
  • a multi-channel information isolation method based on microservices is provided.
  • the application of this method to the server in Figure 1 is used as an example to illustrate, including the following steps:
  • Step 202 Receive the service request sent by the user terminal to the server, and the server provides a microservice chain for the user terminal.
  • Step 204 Parse the user channel information carried in the service request to obtain the user access channel identifier.
  • the business request also carries user channel information.
  • the user channel information includes the user channel identifier that refers to the user who initiates the business request; user channels include but are not limited to applications, sub-applications, third-party plug-ins, etc.; different user channels have different User channel identifier.
  • User channel identifier (APPID) is used to distinguish different user channels; for example, user channels include application APP, WeChat applet, and third-party plug-ins.
  • the corresponding user channel identifier 01 represents AndriodAPP
  • the user channel identifier 02 represents For IOS APP
  • the user channel identifier 03 represents the WeChat applet
  • the user channel identifier 04 represents the plug-in.
  • the server receives the service request sent by the user terminal, and the gateway on the server parses the user channel information carried in the service request sent by the user side to obtain the user access channel identifier. That is, the gateway is modified and parameters for transmitting user channel identification are added on the gateway side.
  • Step 206 Pass the user channel identifier into the attachment information of the temporary status recorder.
  • the temporary status recorder refers to RpcContext, which is a ThreadLocal temporary status recorder.
  • RpcContext is a ThreadLocal temporary status recorder.
  • Attachment information refers to attachments. Attachment information can be used to store the user channel identifier of a business request. When responding to a business request, based on the Dubbo framework and calling microservices through the RPC interface, it is used to pass in the user channel identifier to achieve insensitivity to the user channel identifier. transfer.
  • the new ConsumerAppIdFilter interface access the new ConsumerAppIdFilter interface and pass the user channel identification AppID into the attachment information attachments of the temporary status recorder RpcContext to achieve insensitive transfer of the user channel identification without calling the interface for modification;
  • the user channel identifier passed into the attachment information of the temporary status recorder can be expressed as:
  • Step 208 The target microservice in the microservice chain that has channel isolation requirements obtains the user channel identifier from the attachment information, isolates the channel information, and processes the business request.
  • the target microservice is a microservice with channel isolation message requirements.
  • Channel isolation message means that the content of the same user terminal on different channels has channel characteristics (it can be understood that each channel has the personalized characteristics of the corresponding channel); for example , in the field of logistics, when the same user terminal has a shipping demand, it logs in to the logistics server through different user channels and calls the microservice chain of the shipping demand.
  • the microservice chain includes the user center, coupon platform, address management, and shipping rights. Service; among them, the same user terminal sends items through different user channels, and the coupon platform has different coupons for different user channels. For example, a coupon for an application is 10 off for purchases over 100, and the use period is from Monday to Friday; Coupons for subroutines mean that if the shipping frequency is greater than the set shipping frequency, the shipping fee will be discounted by 15%, with no time limit.
  • the microservice chain includes microservices such as consultation services, user centers, coupon platforms, and consultation rights services.
  • Services among them, the user center includes user mobile phone number, rights identification, user rights name, etc.; consultation services include expert registration, hospitalization green pass, online consultation, traditional Chinese medicine consultation card, traditional Chinese medicine coupon, VIP health examination card, VIP Medical companionship, car wash coupons, etc. are not specifically limited as examples here; the coupon platform includes user rights types; consultation rights services include user rights validity period, user rights details status and user rights details usage time, etc.
  • the user consultation rights service on the microservice chain has different rights and interests used by the same user terminal through different channels; that is, the consultation rights service is the target microservice and has channel isolation message requirements.
  • the microservices in the microservice chain are called step by step.
  • the target microservice with channel isolation requirements in the microservice chain is called to process the business request, it is obtained from the attachment information.
  • User channel identification put the user channel information into MDC (Mapped Diagnostic Context, mapping debugging context) information, obtain the user channel identification from the MDC, isolate the channel information; obtain the corresponding business data from the business database according to the user channel identification, and Make a personalized presentation.
  • MDC Mapped Diagnostic Context, mapping debugging context
  • multi-channel information isolation method based on microservices
  • the user access channel identification is obtained by parsing the user terminal user channel information; the user channel identification is passed into the temporary state In the attachment information of the recorder; when executing business processing, the user channel identification is obtained from the attachment information and sent to the target microservice in the service chain that needs to isolate the channel information.
  • the microservices with hierarchical calls. It realizes the link transmission of channel identification and other information without modifying the interfaces between the original microservices. Only the service interfaces that need to isolate channel information are modified, and the scope of the modification is converged, reducing the cost and difficulty of the modification.
  • a multi-channel information isolation method based on microservices is provided.
  • the application of this method to the server in Figure 1 is used as an example to illustrate, including the following steps:
  • Step 302 Receive the service request sent by the user terminal to the server, and the server provides a microservice chain for the user terminal.
  • Step 304 Parse the user channel information carried in the service request to obtain the user access channel identifier.
  • the user channel information is parsed through the gateway to obtain the user access channel identifier; the user channel identifier includes any of the channel identifiers of applications, sub-applications, and third-party plug-ins.
  • Step 306 Store the user channel identifier in the first mapping debugging context.
  • mapped debugging context Mapped Diagnostic Context, MDC
  • Slf4j Mapped Diagnostic Context, Slf4j
  • the service request sent by the user terminal is received, and based on the Dubbo framework, the user channel information carried in the service request is parsed through the gateway to obtain the user channel identifier, and the user channel identifier is placed in the first mapping debugging context MDC.
  • Step 308 Pass the user channel identifier into the attachment information of the temporary status recorder via the first mapping debugging context.
  • the user channel identifier in the first mapping debugging context MDC is passed into the attachment information attachments of the temporary status recorder RpcContext to realize the insensitive transfer of the user channel identifier.
  • Step 310 Pass the user channel identifier in the attachment information to the second mapping debugging context.
  • the user channel identifier in the attachment information attachments of the temporary status recorder RpcContext is passed into the second mapping debugging context MDC, and the user channel identifier is read from the second mapping debugging context MDC. , upload the user channel identification to the microservice chain.
  • Step 312 The target microservice in the microservice chain that has channel isolation requirements obtains the user channel identifier from the second mapping debugging context, isolates the channel information, and processes the business request.
  • the target microservice can be determined according to the corresponding calling interface attribute.
  • the corresponding microservice is determined to be the target microservice;
  • the calling interface attribute can be, but is not limited to, represented by numbers and/or characters. , for example, if the calling interface attribute is 1, it means that the channel information needs to be isolated, and if the calling interface attribute is 0, it means that the channel information does not need to be isolated.
  • microservices on the microservice chain determine the calling interface attributes of each microservice on the microservice chain; when the calling interface attribute requires isolation of channel information, determine the corresponding microservice as the target microservice; determine the microservices on the microservice chain that need to isolate channel information and those that do not. Microservices that need to isolate channel information; when calling the microservice chain, make hierarchical calls to the microservices on the microservice chain.
  • the called microservice does not need to isolate channel information, it is implemented according to the existing context information transmission method; here Not going into details; when the called target microservice needs to isolate channel information, the user channel identifier is obtained from the second mapping debugging context, and the business data corresponding to the user channel identifier is obtained from the database; the business data is sent to the user terminal Make a personalized presentation.
  • user channels include application channels and plug-in channels.
  • the user terminal sends messages through the application.
  • the business request carries user channel information.
  • the server provides the microservice chain "Inquiry Service-User Center-Coupon Center" for the user terminal. - Right to Consultation Service”; among them, Right to Consultation Service has channel isolation requirements.
  • RpcContext When calling the microservice chain, The user channel identifier in attachments is written to the second mapping debugging context. Consultation service, user center, and coupon center do not have channel isolation requirements. There is no need to obtain the user channel identifier when calling the interface. Through non-sensing delivery, consultation The authority service obtains the user channel identifier from the second mapping debugging context, isolates the channel information, and processes the service request. That is, the Dubbo framework is modified by adding MDC and RpcContext to achieve implicit parameter transfer.
  • microservices with hierarchical calls. That is, based on the context information transfer in the microservice mode, the original microservices can be realized without modifying them.
  • the interface between them realizes the link transmission of information such as channel identification, converges the scope of changes, reduces the cost of transformation, and reduces the difficulty of transformation.
  • link tracking is performed on the microservices involved in the business request processing process according to the user access channel identifier.
  • the application framework based on Dubbo receives the business request for medical services sent by the user terminal to the server.
  • the server provides the microservice chain "Service A->Service B->Service C->Service" for the user terminal.
  • D->Service E" parse the user channel information carried in the service request to obtain the user access channel identifier; store the user channel identifier in the first mapping debugging context; use the first mapping debugging context to The user channel identifier is passed into the attachment information of the temporary status recorder.
  • microservice A is the target microservice
  • microservice A performs corresponding business processing based on obtaining the user channel identification AppID and transmits the user channel identification to the microservice
  • microservice B is not the target Microservices do not need to read the user channel ID and perform corresponding business processing
  • microservice B is the target microservice, it needs to read the user channel ID and perform corresponding business processing based on the user channel ID until the business request processing is completed. , and perform personalized display of the business data obtained by business requests.
  • multi-channel information isolation method based on microservices
  • the microservice mode multi-channel information is isolated, and the user access channel identification is obtained by parsing the user terminal user channel information; the user channel identification is passed into the temporary state In the attachment information of the recorder; when executing business processing, the user channel identification is obtained from the attachment information and sent to the target microservice in the service chain that needs to isolate the channel information. There is no need to modify the microservices with hierarchical calls.
  • embodiments of the present application also provide a microservice-based multi-channel information isolation device for implementing the above-mentioned microservice-based multi-channel information isolation method.
  • the solution to the problem provided by this device is similar to the solution recorded in the above method. Therefore, the specific limitations in the one or more microservice-based multi-channel information isolation device embodiments provided below can be found in the above. The limitations of the multi-channel information isolation method based on microservices will not be repeated here.
  • a multi-channel information isolation device based on microservices including: a business request receiving module 502, a parsing module 504, a parameter passing module 506 and a business processing module 508, wherein:
  • the service request receiving module 502 is used to receive service requests sent by the user terminal to the server, and the server provides a microservice chain for the user terminal.
  • the parsing module 504 is used to parse the user channel information carried in the service request to obtain the user access channel identification.
  • the parameter passing module 506 is used to pass the user channel identifier into the attachment information of the temporary status recorder.
  • the business processing module 508 is used for target microservices with channel isolation requirements in the microservice chain, obtains user channel identifiers from attachment information, isolates channel information, and processes business requests.
  • the above-mentioned multi-channel information isolation device based on microservices when receiving the business request sent by the user terminal to the server, analyzes the user channel information carried in the business request to obtain the user access channel identifier; by passing the user channel identifier to In the attachment information of the temporary status recorder; when executing business processing, the user channel identification is obtained from the attachment information and sent to the target microservice in the service chain that needs to isolate the channel information.
  • the microservices with hierarchical calls that is Realize the link transmission of channel identification and other information without modifying the interfaces between the original microservices, converge the scope of changes, reduce the cost of modification, and reduce the difficulty of modification.
  • the parameter passing module 506 is also configured to store the user channel identification in the first mapping debugging context; pass the user channel identification to the attachment information of the temporary status recorder via the first mapping debugging context. middle.
  • the parameter passing module 506 is also used to pass the user channel identifier in the attachment information into the second mapping debugging context.
  • the business processing module 508 is also used for target microservices with channel isolation requirements in the microservice chain, obtains user channel identifiers from the second mapping debugging context, isolates channel information, and responds to business requests for processing.
  • the parameter transfer module 506 is also used for target microservices in the microservice chain that have channel isolation requirements to obtain the user channel identifier from the second mapping debugging context.
  • the business processing module 508 is also configured to obtain business data corresponding to the user channel identifier from the database; and send the business data to the user terminal for personalized display.
  • the multi-channel information isolation device based on microservices also includes a target microprogram determination module for determining the calling interface attributes of each microservice on the microservice chain; when the calling interface attributes require isolation Channel information determines the corresponding microservice as the target microservice.
  • the parsing module 504 is also used to parse the user channel information through the gateway to obtain the user access channel identifier; the user channel identifier includes channel identifiers of applications, sub-applications, and third-party plug-ins. Any kind.
  • the multi-channel information isolation device based on microservices also includes a full-link tracking module.
  • the full-link tracking module is used to respond to full-link tracking instructions and respond to business requests based on user access channel identification.
  • Microservices involved in the processing process perform link tracking.
  • Each module in the above-mentioned microservice-based multi-channel information isolation device can be implemented in whole or in part through software, hardware, and combinations thereof.
  • Each of the above modules can be embedded in or independent of the processor of the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 6 .
  • the computer device includes a processor, memory, and network interfaces connected through a system bus. Wherein, the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes non-volatile storage media and internal memory.
  • the non-volatile storage medium stores operating systems, computer programs and databases. This internal memory provides an environment for the execution of operating systems and computer programs in non-volatile storage media.
  • the computer device's database is used to store business data.
  • the network interface of the computer device is used to communicate with external terminals through a network connection.
  • the computer program is executed by the processor to implement a multi-channel information isolation method based on microservices.
  • FIG. 6 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied.
  • Specific computer equipment can May include more or fewer parts than shown, or combine certain parts, or have a different arrangement of parts.
  • a computer device including a memory and a processor.
  • a computer program is stored in the memory.
  • the processor executes the computer program, it implements the following steps:
  • the target microservice with channel isolation requirements in the microservice chain obtains the user channel identifier from the attachment information, isolates the channel information, and processes the business request.
  • the processor also implements the following steps when executing the computer program:
  • the user channel identifier is passed into the attachment information of the temporary status recorder via the first mapping debugging context.
  • the processor also implements the following steps when executing the computer program:
  • the target microservice in the microservice chain that has channel isolation requirements obtains the user channel identifier from the second mapping debugging context, isolates the channel information, and processes the business request.
  • the processor also implements the following steps when executing the computer program:
  • the processor also implements the following steps when executing the computer program:
  • the processor also implements the following steps when executing the computer program:
  • the processor also implements the following steps when executing the computer program:
  • the computer program when executed by the processor, also implements the following steps:
  • the user channel identifier is passed into the attachment information of the temporary status recorder via the first mapping debugging context.
  • the computer program when executed by the processor, also implements the following steps:
  • the target microservice in the microservice chain that has channel isolation requirements obtains the user channel identifier from the second mapping debugging context, isolates the channel information, and processes the business request.
  • the computer program when executed by the processor, also implements the following steps:
  • the target microservice with channel isolation requirements in the microservice chain obtains the user channel identifier from the second mapping debugging context
  • the computer program when executed by the processor, also implements the following steps:
  • the computer program when executed by the processor, also implements the following steps:
  • the user channel information is parsed through the gateway to obtain the user access channel identifier; the user channel identifier includes any of the channel identifiers of applications, sub-applications, and third-party plug-ins.
  • the computer program when executed by the processor, also implements the following steps:
  • a computer program product comprising a computer program that when executed by a processor implements the following steps:
  • the target microservice with channel isolation requirements in the microservice chain obtains the user channel identifier from the attachment information, isolates the channel information, and processes the business request.
  • the computer program when executed by the processor, also implements the following steps:
  • the user channel identifier is passed into the attachment information of the temporary status recorder via the first mapping debugging context.
  • the computer program when executed by the processor, also implements the following steps:
  • the target microservice in the microservice chain that has channel isolation requirements obtains the user channel identifier from the second mapping debugging context, isolates the channel information, and processes the business request.
  • the computer program when executed by the processor, also implements the following steps:
  • the target microservice with channel isolation requirements in the microservice chain obtains the user channel identifier from the second mapping debugging context
  • the computer program when executed by the processor, also implements the following steps:
  • the computer program when executed by the processor, also implements the following steps:
  • the user channel information is parsed through the gateway to obtain the user access channel identifier; the user channel identifier includes any of the channel identifiers of applications, sub-applications, and third-party plug-ins.
  • the computer program when executed by the processor, also implements the following steps:
  • the user information including but not limited to user equipment information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • the computer program can be stored in a non-volatile computer-readable storage.
  • the computer program when executed, may include the processes of the above method embodiments.
  • Any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory.
  • Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetic variable memory (Magnetoresistive Random Access Memory (MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc.
  • Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory, etc.
  • RAM Random Access Memory
  • RAM random access memory
  • RAM Random Access Memory
  • the databases involved in the various embodiments provided in this application may include at least one of a relational database and a non-relational database.
  • Non-relational databases may include blockchain-based distributed databases, etc., but are not limited thereto.
  • the processors involved in the various embodiments provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to this.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer And Data Communications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请涉及一种基于微服务的多渠道信息隔离方法、装置和计算机设备。所述方法包括:接收用户终端向服务端发送的业务请求,服务端为用户终端提供微服务链;对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;将用户渠道标识传入至临时状态记录器的附件信息中;微服务链中具有渠道隔离需求的目标微服务,从附件信息中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。采用本方法在数字医疗领域,能够降低微服务改造难度以及减少改造成本。

Description

基于微服务的多渠道信息隔离方法、装置和计算机设备
本申请要求于2022年06月14日提交中国专利局、申请号为202210669271.0,发明名称为“基于微服务的多渠道信息隔离方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理技术领域,特别是涉及一种基于微服务的多渠道信息隔离方法、装置、计算机设备、存储介质和计算机程序产品。
背景技术
微服务是目前逐渐被广泛应用的软件架构,在线互联网医疗平台大多采用的都是微服务架构;在应用微服务的过程中,存在高并发、大交易量的业务场景,在线互联网医疗平台微服务数量从几百到上千,单个微服务结构简单,但整体系统结构非常复杂。
在医疗场景应用中,微服务平台上的各应用会根据渠道来区分同一用户下的不同来源下的业务数据,并进行个性化显示;然而,发明人意识到:各请求来源所在应用又千差万别,在对业务数据进行个性化展示以及合并数据时,对微服务的改造难度大以及改造成本高。
发明内容
基于此,有必要针对上述技术问题,提供一种能够降低微服务改造难度以及减少改造成本的基于微服务的多渠道信息隔离方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。
第一方面,本申请提供了一种基于微服务的多渠道信息隔离方法。所述方法包括:
接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
将所述用户渠道标识传入至临时状态记录器的附件信息中;
所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
第二方面,本申请还提供了一种基于微服务的多渠道信息隔离装置。所述装置包括:
业务请求接收模块,用于接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
解析模块,用于对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
传参模块,用于将所述用户渠道标识传入至临时状态记录器的附件信息中;
业务处理模块,用于所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
第三方面,本申请还提供了一种计算机设备。所述计算机设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
将所述用户渠道标识传入至临时状态记录器的附件信息中;
所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
第四方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
将所述用户渠道标识传入至临时状态记录器的附件信息中;
所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:
接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
将所述用户渠道标识传入至临时状态记录器的附件信息中;
所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
上述基于微服务的多渠道信息隔离方法、装置、计算机设备、存储介质和计算机程序产品中,在接收用户终端向服务端发送的业务请求时,通过对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识,并将用户渠道标识传入至临时状态记录器的附件信息中;微服务链中需要隔离渠道信息的目标微服务从附件信息中获取用户渠道标识进行业务请求处理,不需要改造与目标微服务存在层级调用的微服务来获取用户渠道标识;基于微服务模式下的上下文信息传递来实现在不改造原有微服务之间接口的情况下实现用户渠道标识信息的链路传递,对微服务链上的改动范围进行收敛,极大简化了开发过程,减少改造成本并降低改造难度。
附图说明
图1为一个实施例中基于微服务的多渠道信息隔离方法的应用环境图;
图2为一个实施例中基于微服务的多渠道信息隔离方法的流程示意图;
图3为另一个实施例中基于微服务的多渠道信息隔离方法的流程示意图;
图4为一个实施例中微服务链的示意图;
图5为一个实施例中基于微服务的多渠道信息隔离装置的结构框图;
图6为一个实施例中计算机设备的内部结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供的基于微服务的多渠道信息隔离方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与服务端104进行通信。数据存储系统可以存储服务端104需要处理的数据。数据存储系统可以集成在服务端104上,也可以放在云上或其他网络服务端上。服务端采用的是一种微服务架构,服务端可以但不仅限于是互联网医疗平台;服务端为用户终端提供微服务链,服务端接收用户终端发送的业务请求,对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识,将用户渠道标识传入至临时状态记录器的附件信息中;微服务链中具有渠道隔离需求的目标微服务,从附件信息中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑、物联网设备和便携式可穿戴设备等。服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一个实施例中,如图2所示,提供了一种基于微服务的多渠道信息隔离方法,以该方法应用于图1中的服务端为例进行说明,包括以下步骤:
步骤202,接收用户终端向服务端发送的业务请求,服务端为用户终端提供微服务链。
其中,服务端上部署了微服务架构,微服务架构是用于实施业务功能的组件架构;根据业务需求,服务端为用户端提供了对应业务的微服务链;微服务链上各微服务通过RPC(Remote Procedure Calls,远程过程调用)接口进行调用,微服务与微服务之间存在层级调用。各个微服务可被独立部署,各个微服务之间是松耦合的。每个微服务仅关注于完成一件任务。在所有情况下,每个任务代表着一个小的业务能力。例如,在互联网医疗业务中,微服务包括问诊服务、用户中心、优惠券平台和问诊权益服务,问诊服务、用户中心、优惠券 平台和问诊权益服务分别代表不同的业务能力。业务请求携带业务请求标识。
具体地,服务端接收用户终端发送的业务请求,根据业务请求携带的业务请求标识调用与业务请求标识对应的微服务链。在互联网医疗业务场景中,业务请求为医疗服务请求,根据医疗服务请求的业务请求标识获取对应的医疗服务微服链;通过调用医疗服务微服链,可以从医疗服务链上的各微服务获取与用户相关的医疗信息,其中,医疗信息包括就医信息、健康信息和医疗资讯信息等。
步骤204,对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识。
其中,业务请求还携带了用户渠道信息,用户渠道信息包括指用户发起业务请求的用户渠道标识;用户渠道包括但不仅限于是应用程序、子应用以及第三方插件等;不同的用户渠道存在不同的用户渠道标识,用户渠道标识(即APPID)用于区分不同的用户渠道;例如,用户渠道包括应用程序APP,微信小程序,第三方插件,对应的用户渠道标识01表示AndriodAPP,用户渠道标识02表示IOS APP,用户渠道标识03表示微信小程序,用户渠道标识04表示插件。
具体地,服务端接收到用户终端发送的业务请求,在服务端的网关对用户侧的发送的业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识。即对网关进行改造,在网关侧增加传递用户渠道标识的参数。
步骤206,将用户渠道标识传入至临时状态记录器的附件信息中。
其中,临时状态记录器是指RpcContext,RpcContext是一个ThreadLocal的临时状态记录器,当接收到RPC请求,或发起RPC请求时,RpcContext的状态都会变化。比如A调用B,B再调用C,则B机器上,在B调用C之前,RpcContext记录的是A调用B的信息,在B调用C之后,RpcContext记录的是B调用C。
附件信息是指attachments,附件信息可用于存储业务请求的用户渠道标识,在响应业务请求,基于Dubbo框架,通过RPC接口调用微服务时,用于传入用户渠道标识,实现用户渠道标识的无感传递。
具体地,在调用微服务之前,通过新建ConsumerAppIdFilter接口访问,将 用户渠道标识AppID传入至临时状态记录器RpcContext的附件信息attachments中,实现用户渠道标识的无感传递,不需要调用接口进行改造;其中,将用户渠道标识传入至临时状态记录器的附件信息中可以表示为:
RpcContext.getContext().setAttachment(“appID”,appID)。
步骤208,微服务链中具有渠道隔离需求的目标微服务,从附件信息中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
其中,目标微服务是具有渠道隔离消息需求的微服务,渠道隔离消息是指同一用户终端在不同的渠道上的内容具有渠道特征(可以理解为每个渠道具有对应渠道的个性化特征);例如,在物流领域,同一用户终端有寄件需求时,通过不同的用户渠道登录物流服务端,调用寄件需求的微服务链,微服务链包括用户中心、优惠券平台和地址管理以及寄件权益服务;其中,同一用户终端通过不同的用户渠道进行寄件,优惠券平台针对不同用户渠道的优惠券不同,例如,针对应用程序的优惠券为满100减10,使用期限为周一至周五;针对子程序的优惠券为寄件频次大于设定寄件频次,寄件费用打8.5折,不限时间段。
又如,在互联网医疗场景,用户终端向服务端发送医疗业务请求时,服务端要调用对应的微服链,微服务链包括问诊服务、用户中心、优惠券平台和问诊权要服务等微服务;其中,用户中心包括用户手机号、用于权益标识、用户权益名称等;问诊服务包括专家挂号、住院绿通、在线问诊、中医问诊卡、中药券、VIP健康体检卡、VIP陪诊、洗车券等,在此举例不做具体限定;优惠券平台包括用户权益类型;问诊权益服务包括用户权益有效时间段、用户权益详情状态和用户权益详情使用时间等。根据实际业务需求,微服务链上的用户问诊权益服务,同一用户终端通过不同渠道,拥有的权益以及已使用的权益不同;即问诊权要服务为目标微服务,具有渠道隔离消息需求。
具体地,接收到微服务链的请求时,对微服务链中的微服务进行逐级调用,当调用微服务链中具有渠道隔离需求的目标微服务对业务请求进行处理,从附件信息中获取用户渠道标识,将用户渠道信息放入MDC(Mapped Diagnostic Context,映射调试上下文)信息中,从MDC中获取用户渠道标识,隔离渠道信息;根据用户渠道标识从业务数据库中获取对应的业务数据,并进行个性化 展示。
上述基于微服务的多渠道信息隔离方法中,在微服务模式下,对多渠道的信息进行隔离,通过解析用户终端用户渠道信息,得到用户访问渠道标识;通过将用户渠道标识传入至临时状态记录器的附件信息中;在执行业务处理时,从附件信息中获取用户渠道标识发送至服务链中需要隔离渠道信息的目标微服务,不需要对存在层级调用的微服务进行改造。实现了在不改造原有微服务之间接口的情况实现渠道标识等信息的链路传递,只对需要隔离渠道信息的服务接口进行改动,将改动范围进行收敛,减少改造成本以及降低改造难度。
在一个实施例中,如图3所示,提供了一种基于微服务的多渠道信息隔离方法,以该方法应用于图1中的服务端为例进行说明,包括以下步骤:
步骤302,接收用户终端向服务端发送的业务请求,服务端为用户终端提供微服务链。
其中,微服务链上的各微服务之间存在层级调用关系。
步骤304,对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识。
具体地,通过网关对用户渠道信息进行解析,得到用户访问渠道标识;用户渠道标识包括应用程序、子应用以及第三方插件的渠道标识中的中任意一种。
步骤306,将用户渠道标识存储在第一映射调试上下文中。
其中,“第一”和“第二”仅用于区分不同的映射调试上下文;映射调试上下文(Mapped Diagnostic Context,MDC)是Slf4j提供的一种便于对用户请求的流程进行归类标记的机制,利用ThreadLocal实现MDC,达到不同线程间日志信息互不影响的目的。
具体地,接收用户终端发送的业务请求,基于Dubbo框架,通过网关对业务请求携带的用户渠道信息进行解析,得到用户渠道标识,将用户渠道标识放入第一映射调试上下文MDC中。
步骤308,经由第一映射调试上下文将用户渠道标识传入至临时状态记录器的附件信息中。
具体地,新建接口调用,在调用微服务链之前,将第一映射调试上下文MDC 中的用户渠道标识传入临时状态记录器RpcContext的附件信息attachments中,实现用户渠道标识的无感传递。
步骤310,将附件信息中的用户渠道标识传入第二映射调试上下文。
具体地,在响应微服务链的请求时,将临时状态记录器RpcContext的附件信息attachments中的用户渠道标识传入第二映射调试上下文MDC中,从第二映射调试上下文MDC中读取用户渠道标识,将用户渠道标识上传至微服务链中。
步骤312,微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
其中,目标微服务可以根据对应的调用接口属性来确定,当调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务;调用接口属性可以但不仅限于用数字和/或字符来表示,例如,调用接口属性为1表示需要隔离渠道信息,调用接口属性为0表示不需要隔离渠道信息。
具体地,确定微服务链上各微服务的调用接口属性;当调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务;确定微服务链上需要隔离渠道信息的微服务和不需要隔离渠道信息的微服务;在调用微服务链时,对微服务链上的微服务进行层级调用,当调用的微服务不需要隔离渠道信息,按照现有的上下文信息传递方式实现;在此不做赘述;当调用的目标微服务有隔离渠道信息的需求时,从第二映射调试上下文中获取用户渠道标识,从数据库中获取与用户渠道标识对应的业务数据;将业务数据发送至用户终端进行个性化展示。
例如,在医疗场景中,如图4所示,用户渠道包括应用程序渠道和插件渠道,应用程序渠道的用户渠道标识AppID=31,插件渠道的用户渠道标识AppID=51,用户终端通过应用程序发送业务请求,业务请求携带用户渠道信息,在网关Mobile API GateWay解析用户渠道信息,得到用户渠道标识AppID=31;服务端为所述用户终端提供微服务链“问诊服务-用户中心-优惠券中心-问诊权要服务”;其中,问诊权要服务具有渠道隔离需求。将获取的用户渠道标识放入MDC,将MDC中的用户渠道标识参数传入至RpcContext的attachments (RpcContext.getContext().setAttachment(“appID”,appID);)中,在调用微服链时,将attachments中的用户渠道标识写入到第二映射调试上下文中,问诊服务、用户中心、优惠券中心不具有渠道隔离需求,在接口调用时不需要获取用户渠道标识,通过无感传递,问诊权要服务从第二映射调试上下文中获取用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。即通过增加MDC以及RpcContext对Dubbo框架进行改造,实现隐式传参,不需要对中存在层级调用的微服务进行改造,即基于微服务模式下的上下文信息传递来实现在不改造原有微服务之间接口的情况实现渠道标识等信息的链路传递,将改动范围进行收敛,减少改造成本以及降低改造难度。
可选地,在一个实施例中,当完成业务请求处理后,响应全链路追踪指令,根据用户访问渠道标识对业务请求处理过程中涉及的微服务进行链路追踪。
在医疗场景中,基于Dubbo的应用框架,接收用户终端向服务端发送的医疗服务的业务请求,服务端为所述用户终端提供微服务链“服务A->服务B->服务C->服务D->服务E”;对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;将所述用户渠道标识存储在第一映射调试上下文中;经由所述第一映射调试上下文将所述用户渠道标识传入至临时状态记录器的附件信息中。
当接收到微服务链的请求,即对微服务链上的微服务进行层级调用时,通过从附件信息中所述用户渠道标识传入第二映射调试上下文,将第二映射调试上下文中的用户渠道标识上传至微服务链上,若微服务A为目标微服务,微服务A根据获取用户渠道标识AppID执行对应的业务处理,并将用户渠道标识传送至微服务;若微服务B不为目标微服务,不需要读取该用户渠道标识,进行对应的业务处理;若微服务B为目标微服务,需要读取该用户渠道标识,根据用户渠道标识进行对应的业务处理,直到完成业务请求处理,并对业务请求获取的业务数据进行个性化展示。
上述基于微服务的多渠道信息隔离方法中,在微服务模式下,对多渠道的信息进行隔离,通过解析用户终端用户渠道信息,得到用户访问渠道标识;通过将用户渠道标识传入至临时状态记录器的附件信息中;在执行业务处理时, 从附件信息中获取用户渠道标识发送至服务链中需要隔离渠道信息的目标微服务,不需要对存在层级调用的微服务进行改造。
应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的基于微服务的多渠道信息隔离方法的基于微服务的多渠道信息隔离装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个基于微服务的多渠道信息隔离装置实施例中的具体限定可以参见上文中对于基于微服务的多渠道信息隔离方法的限定,在此不再赘述。
在一个实施例中,如图5所示,提供了一种基于微服务的多渠道信息隔离装置,包括:业务请求接收模块502、解析模块504、传参模块506和业务处理模块508,其中:
业务请求接收模块502,用于接收用户终端向服务端发送的业务请求,服务端为用户终端提供微服务链。
解析模块504,用于对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识。
传参模块506,用于将用户渠道标识传入至临时状态记录器的附件信息中。
业务处理模块508,用于微服务链中具有渠道隔离需求的目标微服务,从附件信息中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
上述基于微服务的多渠道信息隔离装置,在接收用户终端向服务端发送的业务请求时,通过对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;通过将用户渠道标识传入至临时状态记录器的附件信息中;在执行业 务处理时,从附件信息中获取用户渠道标识发送至服务链中需要隔离渠道信息的目标微服务,不需要对存在层级调用的微服务进行改造,即实现在不改造原有微服务之间接口的情况实现渠道标识等信息的链路传递,将改动范围进行收敛,减少改造成本以及降低改造难度。
可选地,在一个实施例中,传参模块506还用于将用户渠道标识存储在第一映射调试上下文中;经由第一映射调试上下文将用户渠道标识传入至临时状态记录器的附件信息中。
可选地,在一个实施例中,传参模块506还用于将附件信息中的用户渠道标识传入第二映射调试上下文。
可选地,在一个实施例中,业务处理模块508还用于微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
可选地,在一个实施例中,传参模块506还用于微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识。
可选地,在一个实施例中,业务处理模块508还用于从数据库中获取与用户渠道标识对应的业务数据;将业务数据发送至用户终端进行个性化展示。
可选地,在一个实施例中,基于微服务的多渠道信息隔离装置中还包括目标微程序确定模块,用于确定微服务链上各微服务的调用接口属性;当调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务。
可选地,在一个实施例中,解析模块504还用于通过网关对用户渠道信息进行解析,得到用户访问渠道标识;用户渠道标识包括应用程序、子应用以及第三方插件的渠道标识中的中任意一种。
可选地,在一个实施例中,基于微服务的多渠道信息隔离装置中还包括全链路追踪模块,全链路追踪模块用于响应全链路追踪指令,根据用户访问渠道标识对业务请求处理过程中涉及的微服务进行链路追踪。
上述基于微服务的多渠道信息隔离装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于 处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储业务数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于微服务的多渠道信息隔离方法。
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:
接收用户终端向服务端发送的业务请求,服务端为用户终端提供微服务链;
对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
将用户渠道标识传入至临时状态记录器的附件信息中;
微服务链中具有渠道隔离需求的目标微服务,从附件信息中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
将用户渠道标识存储在第一映射调试上下文中;
经由第一映射调试上下文将用户渠道标识传入至临时状态记录器的附件信息中。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
将附件信息中的用户渠道标识传入第二映射调试上下文;
微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识;
从数据库中获取与用户渠道标识对应的业务数据;
将业务数据发送至用户终端进行个性化展示。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
确定微服务链上各微服务的调用接口属性;
当调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
通过网关对用户渠道信息进行解析,得到用户访问渠道标识;用户渠道标识包括应用程序、子应用以及第三方插件的渠道标识中的中任意一种。
在一个实施例中,处理器执行计算机程序时还实现以下步骤:
响应全链路追踪指令,根据用户访问渠道标识对业务请求处理过程中涉及的微服务进行链路追踪。
在一个实施例中,提供了一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:
接收用户终端向服务端发送的业务请求,服务端为用户终端提供微服务链;
对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
将用户渠道标识传入至临时状态记录器的附件信息中;
微服务链中具有渠道隔离需求的目标微服务,从附件信息中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
将用户渠道标识存储在第一映射调试上下文中;
经由第一映射调试上下文将用户渠道标识传入至临时状态记录器的附件信息中。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
将附件信息中的用户渠道标识传入第二映射调试上下文;
微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识;
从数据库中获取与用户渠道标识对应的业务数据;
将业务数据发送至用户终端进行个性化展示。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
确定微服务链上各微服务的调用接口属性;
当调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
通过网关对用户渠道信息进行解析,得到用户访问渠道标识;用户渠道标识包括应用程序、子应用以及第三方插件的渠道标识中的中任意一种。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
响应全链路追踪指令,根据用户访问渠道标识对业务请求处理过程中涉及的微服务进行链路追踪。
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:
接收用户终端向服务端发送的业务请求,服务端为用户终端提供微服务链;
对业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
将用户渠道标识传入至临时状态记录器的附件信息中;
微服务链中具有渠道隔离需求的目标微服务,从附件信息中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
将用户渠道标识存储在第一映射调试上下文中;
经由第一映射调试上下文将用户渠道标识传入至临时状态记录器的附件信息中。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
将附件信息中的用户渠道标识传入第二映射调试上下文;
微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识,隔离渠道信息,并对业务请求进行处理。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
微服务链中具有渠道隔离需求的目标微服务,从第二映射调试上下文中获取用户渠道标识;
从数据库中获取与用户渠道标识对应的业务数据;
将业务数据发送至用户终端进行个性化展示。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
确定微服务链上各微服务的调用接口属性;
当调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
通过网关对用户渠道信息进行解析,得到用户访问渠道标识;用户渠道标识包括应用程序、子应用以及第三方插件的渠道标识中的中任意一种。
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:
响应全链路追踪指令,根据用户访问渠道标识对业务请求处理过程中涉及的微服务进行链路追踪。
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器 (Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种基于微服务的多渠道信息隔离方法,其中,所述方法包括:
    接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
    对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
    将所述用户渠道标识传入至临时状态记录器的附件信息中;
    所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  2. 根据权利要求1所述的方法,其中,所述将所述用户渠道标识传入至临时状态记录器的附件信息中,包括:
    将所述用户渠道标识存储在第一映射调试上下文中;
    经由所述第一映射调试上下文将所述用户渠道标识传入至临时状态记录器的附件信息中。
  3. 根据权利要求1所述的方法,其中,所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理,包括:
    将所述附件信息中的所述用户渠道标识传入第二映射调试上下文;
    所述微服务链中具有渠道隔离需求的目标微服务,从所述第二映射调试上下文中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  4. 根据权利要求3所述的方法,其中,所述微服务链中具有渠道隔离需求的目标微服务,从所述第二映射调试上下文中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理,包括:
    所述微服务链中具有渠道隔离需求的目标微服务,从所述第二映射调试上下文中获取所述用户渠道标识;
    从数据库中获取与所述用户渠道标识对应的业务数据;
    将所述业务数据发送至所述用户终端进行个性化展示。
  5. 根据权利要求1所述的方法,其中,在所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理之前,所述方法还包括:
    确定所述微服务链上各微服务的调用接口属性;
    当所述调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务。
  6. 根据权利要求1所述的方法,其中,所述对所述用户渠道信息进行解析,得到用户访问渠道标识,包括:
    通过网关对所述用户渠道信息进行解析,得到用户访问渠道标识;所述用户渠道标识包括应用程序、子应用以及第三方插件的渠道标识中的中任意一种。
  7. 根据权利要求1所述的方法,其中,所述方法还包括:
    响应全链路追踪指令,根据所述用户访问渠道标识对所述业务请求处理过程中涉及的微服务进行链路追踪。
  8. 一种基于微服务的多渠道信息隔离装置,其中,所述装置包括:
    业务请求接收模块,用于接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
    解析模块,用于对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
    传参模块,用于将所述用户渠道标识传入至临时状态记录器的附件信息中;
    业务处理模块,用于所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  9. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:
    接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
    对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
    将所述用户渠道标识传入至临时状态记录器的附件信息中;
    所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  10. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算 机程序被处理器执行时实现以下步骤:接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
    对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
    将所述用户渠道标识传入至临时状态记录器的附件信息中;
    所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  11. 根据权利要求10所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时实现以下步骤:
    将所述用户渠道标识存储在第一映射调试上下文中;
    经由所述第一映射调试上下文将所述用户渠道标识传入至临时状态记录器的附件信息中。
  12. 根据权利要求10所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现以下步骤:
    将所述附件信息中的所述用户渠道标识传入第二映射调试上下文;
    所述微服务链中具有渠道隔离需求的目标微服务,从所述第二映射调试上下文中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  13. 根据权利要求12所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现以下步骤:
    所述微服务链中具有渠道隔离需求的目标微服务,从所述第二映射调试上下文中获取所述用户渠道标识;
    从数据库中获取与所述用户渠道标识对应的业务数据;
    将所述业务数据发送至所述用户终端进行个性化展示。
  14. 根据权利要求10所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现以下步骤:
    确定所述微服务链上各微服务的调用接口属性;
    当所述调用接口属性为需要隔离渠道信息,确定对应的微服务为目标微服务。
  15. 根据权利要求10所述的计算机可读存储介质,其中,所述计算机程序 被处理器执行时还实现以下步骤:
    通过网关对所述用户渠道信息进行解析,得到用户访问渠道标识;所述用户渠道标识包括应用程序、子应用以及第三方插件的渠道标识中的中任意一种。
  16. 根据权利要求10所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现以下步骤:
    响应全链路追踪指令,根据所述用户访问渠道标识对所述业务请求处理过程中涉及的微服务进行链路追踪。
  17. 一种计算机程序产品,包括计算机程序,其中,该计算机程序被处理器执行时实现以下步骤:
    接收用户终端向服务端发送的业务请求,所述服务端为所述用户终端提供微服务链;
    对所述业务请求携带的用户渠道信息进行解析,得到用户访问渠道标识;
    将所述用户渠道标识传入至临时状态记录器的附件信息中;
    所述微服务链中具有渠道隔离需求的目标微服务,从所述附件信息中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  18. 根据权利要求17所述的计算机程序产品,其中,所述计算机程序被处理器执行时实现以下步骤:
    将所述用户渠道标识存储在第一映射调试上下文中;
    经由所述第一映射调试上下文将所述用户渠道标识传入至临时状态记录器的附件信息中。
  19. 根据权利要求17所述的计算机程序产品,其中,所述计算机程序被处理器执行时还实现以下步骤:
    将所述附件信息中的所述用户渠道标识传入第二映射调试上下文;
    所述微服务链中具有渠道隔离需求的目标微服务,从所述第二映射调试上下文中获取所述用户渠道标识,隔离渠道信息,并对所述业务请求进行处理。
  20. 根据权利要求19所述的计算机程序产品,其中,所述计算机程序被处理器执行时还实现以下步骤:
    所述微服务链中具有渠道隔离需求的目标微服务,从所述第二映射调试上下文中获取所述用户渠道标识;
    从数据库中获取与所述用户渠道标识对应的业务数据;
    将所述业务数据发送至所述用户终端进行个性化展示。
PCT/CN2022/122102 2022-06-14 2022-09-28 基于微服务的多渠道信息隔离方法、装置和计算机设备 WO2023240840A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210669271.0 2022-06-14
CN202210669271.0A CN114884804B (zh) 2022-06-14 2022-06-14 基于微服务的多渠道信息隔离方法、装置和计算机设备

Publications (1)

Publication Number Publication Date
WO2023240840A1 true WO2023240840A1 (zh) 2023-12-21

Family

ID=82681743

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/122102 WO2023240840A1 (zh) 2022-06-14 2022-09-28 基于微服务的多渠道信息隔离方法、装置和计算机设备

Country Status (2)

Country Link
CN (1) CN114884804B (zh)
WO (1) WO2023240840A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884804B (zh) * 2022-06-14 2023-05-02 平安科技(深圳)有限公司 基于微服务的多渠道信息隔离方法、装置和计算机设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740217A (zh) * 2019-09-12 2020-01-31 平安科技(深圳)有限公司 一种多渠道数据整合交互方法和装置、设备及存储介质
CN111738757A (zh) * 2020-06-15 2020-10-02 中国建设银行股份有限公司 一种多渠道服务平台
CN113409156A (zh) * 2021-07-07 2021-09-17 北京京东拓先科技有限公司 一种数据处理的方法和装置
CN113781202A (zh) * 2021-08-24 2021-12-10 上海数禾信息科技有限公司 数据处理方法、装置、计算机设备和存储介质
CN113946425A (zh) * 2021-10-28 2022-01-18 中国建设银行股份有限公司 业务处理方法及装置、电子设备和计算机可读存储介质
CN114884804A (zh) * 2022-06-14 2022-08-09 平安科技(深圳)有限公司 基于微服务的多渠道信息隔离方法、装置和计算机设备

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8161100B1 (en) * 2008-12-22 2012-04-17 Amazon Technologies, Inc. Self-service provisioning for multi-channel applications
CN104125558B (zh) * 2013-04-26 2017-11-03 中国移动通信集团上海有限公司 一种基于客户端的业务处理方法、设备及系统
CN109636460B (zh) * 2018-12-07 2024-04-02 北京奇虎科技有限公司 一种业务处理方法、装置、设备及存储介质
CN111478967B (zh) * 2020-04-08 2022-11-22 北京字节跳动网络技术有限公司 一种请求处理方法及装置
CN111984356B (zh) * 2020-08-24 2023-08-15 腾讯科技(上海)有限公司 页面跳转方法、装置、计算机设备和存储介质
CN112104715A (zh) * 2020-08-31 2020-12-18 银盛支付服务股份有限公司 一种基于微服务日志链路跟踪方法及系统
CN112394916A (zh) * 2020-11-17 2021-02-23 平安信托有限责任公司 数据交互方法、装置、设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740217A (zh) * 2019-09-12 2020-01-31 平安科技(深圳)有限公司 一种多渠道数据整合交互方法和装置、设备及存储介质
CN111738757A (zh) * 2020-06-15 2020-10-02 中国建设银行股份有限公司 一种多渠道服务平台
CN113409156A (zh) * 2021-07-07 2021-09-17 北京京东拓先科技有限公司 一种数据处理的方法和装置
CN113781202A (zh) * 2021-08-24 2021-12-10 上海数禾信息科技有限公司 数据处理方法、装置、计算机设备和存储介质
CN113946425A (zh) * 2021-10-28 2022-01-18 中国建设银行股份有限公司 业务处理方法及装置、电子设备和计算机可读存储介质
CN114884804A (zh) * 2022-06-14 2022-08-09 平安科技(深圳)有限公司 基于微服务的多渠道信息隔离方法、装置和计算机设备

Also Published As

Publication number Publication date
CN114884804A (zh) 2022-08-09
CN114884804B (zh) 2023-05-02

Similar Documents

Publication Publication Date Title
US11126627B2 (en) System and method for dynamic transactional data streaming
US20140114822A1 (en) Method and system for creating tax configuration templates
US8434056B2 (en) Rule engine system controlling devices of disparate types and protocols
US11615066B2 (en) Systems and methods for providing custom objects for a multi-tenant platform with microservices architecture
US20220237363A1 (en) Systems and methods for providing error recovery in data transmissions
US20150161235A1 (en) Database content publisher
US11533538B2 (en) Streaming event content based filtering
US11886941B2 (en) Systems and methods for providing uniform access in a multi-tenant system
WO2023240840A1 (zh) 基于微服务的多渠道信息隔离方法、装置和计算机设备
US20070124275A1 (en) Considering transient data also in reports generated based on data eventually stored in a data-warehouse
US20090287845A1 (en) Mediator with interleaved static and dynamic routing
CN102132267B (zh) 动态元数据
US20200379973A1 (en) Systems and methods for providing tenant-defined event notifications in a multi-tenant database system
CN110008261B (zh) 外部变化检测
US11669547B2 (en) Parallel data synchronization of hierarchical data
CN116166514A (zh) 多渠道数据联动处理方法、装置、计算机设备和存储介质
WO2022241945A1 (zh) 一种数据处理方法、设备以及计算机可读存储介质
CN114925066A (zh) 数据处理方法、装置、电子设备和存储介质
CN112231377A (zh) 数据映射方法、系统、装置、服务器和存储介质
US8655910B1 (en) Methods and systems for coupling client-side and server-side persistence frameworks
US11468101B2 (en) Context-rich key framework implementations for global concept management
WO2023230797A1 (zh) 一种跨系统测试方法及装置
US20240037077A1 (en) Self-service data mesh
US20230297550A1 (en) Dynamic data views
US12034612B1 (en) Techniques for transformative and derivative metering

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22946512

Country of ref document: EP

Kind code of ref document: A1