Fast communication protocol and financial service control method based on fast communication protocol
Through the fast communication protocol and service registration discovery mechanism, the problems of communication complexity and management difficulty between bank systems are solved, low-cost, efficient and secure inter-system interaction is achieved, and diversified financial services are adapted to the diverse needs of financial services and reduced third-party components rely.
Patent Information
- Application Number
- CN202411100018.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing banking system has shortcomings in communication complexity and management difficulty. The ESB integration architecture is limited in performance and scalability. API gateways bring performance overhead and maintenance complexity. RPC is mainly used for internal interaction of single-business applications, which is difficult to meet the bank. Efficient, secure and flexible communication requirements between systems.
Provide a fast communication protocol, including data headers and data bodies, supports service registration and discovery mechanisms, realizes direct communication between services through the registration center, and supports synchronous and asynchronous modes, reduces dependence on third-party components, and provides comprehensive system interaction capabilities. and non-functional capabilities, including monitoring, fuse, current limit, logging, etc., to ensure security and performance.
Achieved a fast and low-cost development client server framework, interface registration mechanism and distributed balanced access, reducing the complexity of interaction between systems, enhancing security and performance, adapting to the diversified needs of financial services, and reducing third-party components. entry.
Smart Images

Figure CN119011698A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication protocols, and more specifically, to a fast communication protocol and a control method for financial services based on the fast communication protocol. Background Art
[0002] The banking system contains multiple applications, such as core business systems, credit systems, payment systems, risk management systems, etc. These systems need to frequently exchange data and collaborate with each other to ensure the smooth operation of various banking businesses. However, due to historical reasons, technical differences, business development and other factors, these systems often use different communication protocols and interface standards, making communication interactions complicated and inefficient.
[0003] To improve business continuity and reliability, the banking system has implemented dual-active in the same city and in different locations to ensure that business can be quickly restored and services can be provided to the outside world under force majeure factors such as single point failures or natural disasters. However, this inevitably increases the complexity of communication between systems.
[0004] As business continues to expand, banking systems need to interact frequently with external systems to meet customers' diverse financial needs. This interaction will also increase the complexity of system communications.
[0005] In the prior art, in order to reduce the complexity of communication and improve the reliability and performance of the system, the banking system usually:
[0006] 1. Standardized interfaces: Banks will standardize the interface specifications and protocols of various application systems to reduce the diversity of technologies, strictly control the network access relationship between systems, and standardize the communication between systems through management means;
[0007] 2. Use middleware technology. Banks usually introduce ESB (Enterprise Service Bus) communication technology to cope with increasingly complex businesses and improve system integration, flexibility and manageability;
[0008] 3. API Gateway: Banks may also choose to build a unified API gateway, which serves as the unified entrance and exit of the system, simplifies the system interaction process, and can also provide many key functions to ensure the security and stability of data transmission;
[0009] 4. Introduce communication technologies such as RPC (Remote Procedure Call) in distributed systems to achieve efficient communication between different computers and meet the real-time, security and flexibility requirements of banking services.
[0010] Banks use management and technical means to strengthen the management of system communications, but the existing solutions have shortcomings:
[0011] First, management methods will not bring about technical improvements in application systems. As the number of application systems increases, the difficulty of management increases.
[0012] Second, although ESB, as an integrated architecture, can help banks achieve seamless integration between different systems, it has limitations. For example, communication between application systems is not directly accessible; it cannot provide sufficient performance and scalability; it requires a lot of resources and energy to deploy and maintain, which is a considerable burden for small and medium-sized banks;
[0013] Third, as the middle layer for interaction between systems, the API gateway provides convenience in cross-data center and cross-institutional communication, but it also brings performance overhead, complexity and maintenance costs;
[0014] Fourth, RPC provides many conveniences in the microservice architecture, but is usually used for interactions between functional modules within a single business application system. Summary of the invention
[0015] The object of the present invention is to provide a fast communication protocol and a control method for financial services based on the fast communication protocol.
[0016] The present invention aims to solve the problems existing in the prior art.
[0017] Compared with the prior art, the technical solution of the present invention and its beneficial effects are as follows:
[0018] The first aspect disclosed by the present invention provides a fast communication protocol, including: a data header, wherein the data header includes a packet header length, a protocol version number, a packet type, a flag bit, an application code length, an application code, a service name length, a service name, a method name length, a method name, a system tracking number length, a system tracking number, an application system Token length, an application system Token, a request serial number length, a request serial number, an encryption algorithm name length, an encryption algorithm name, a compression algorithm name length, a compression algorithm name, a file name length, a file name, a message encoding length, and a message encoding; a data body, wherein the data body includes a data length, a field, and a MAC check; a file attachment, wherein the file attachment includes a file length, a file content, a total number of fragments, and a fragment sequence number.
[0019] As a further improvement, the fields include: a common field, which consists of a field name and a field value, the field name includes the length of the field name and the value of the field name, and the field value includes the length of the field value and the value of the field value; a structure field, which consists of a flag bit, a structure name length, a structure name, a structure length, and a structure, and the content of the structure is the same as the data body; a loop field, which consists of a flag bit, a loop name length, a loop name, a loop number, the i-th loop length, and the i-th loop body, and the content of the loop body is the same as the data body.
[0020] As a further improvement, the maximum length of the field name of a common field is 250 bytes; if the field name length is greater than 250 bytes, it is converted into a flag bit, and the flag bit uses 0xFE and 0xFF, 0xFE corresponds to the structure field, and 0xFF corresponds to the loop field; when the field name length of a common field is less than or equal to 250 bytes, it includes the field value length and the field value; when the field name length is greater than 250 bytes, fragmentation processing is required, in which the length field flag is 0xFF, and the fragmentation length is 250 bytes.
[0021] As a further improvement, the packet types include: data transmission, file transmission, data and file transmission.
[0022] The second aspect disclosed by the present invention provides a method for controlling financial services based on a fast communication protocol, applying the fast communication protocol, including: a service registers its access address and provided service information with a registration center when it is started; the registration center stores the service information so that other services can query and discover it; when other services need to interact with a specific service, they can query the registration center for the location information of the corresponding service; the registration center will return the address and other relevant information of the target service, so that the two services can communicate directly.
[0023] As a further improvement, it also includes: service registration and discovery involve a registration center, a service consumer, and a service provider; the service provider registers its own address and service information with the registration center when the service is started, and the service provider and the registration center communicate through TCP socket; the service consumer queries the registration center for the address and other basic information of the service, and the service consumer and the registration center communicate through TCP socket; the service consumer calls the service interface of the service provider, and the service consumer and the service provider communicate through TCP socket.
[0024] As a further improvement, the service consumer calls the service interface of the service provider, supporting synchronous mode and asynchronous mode; if the service interface is in synchronous mode, it is necessary to wait for the service provider to return the call result before executing subsequent operations; if the service interface is in asynchronous mode, subsequent operations can be executed after receiving the response from the service provider.
[0025] The beneficial effects of the present invention are:
[0026] The present invention provides a client-server framework that can be inherited to different technical platforms to ensure low-cost and rapid development; an interface registration mechanism to achieve distributed and balanced access to interfaces; interface self-description, with interface description and interface implementation updated simultaneously; full-range capabilities for interaction between systems, including message and file interaction capabilities, as well as non-functional capabilities such as monitoring, fusing, current limiting, and logging, to reduce the entry of third-party components; in terms of security, all messages are encrypted for transmission, supporting national encryption and adapting to security development requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a structural diagram of a fast communication protocol provided by an embodiment of the present invention.
[0028] Figure 2 It is a schematic diagram of the structure of a banking system using a fast communication protocol of an application system provided by an embodiment of the present invention.
[0029] Figure 3 It is a flow chart of service registration and discovery provided by an embodiment of the present invention.
[0030] Figure 4 It is a schematic diagram of the asynchronous communication interaction process provided by an embodiment of the present invention.
[0031] Figure 5 It is a schematic diagram of the communication interaction process in a synchronous manner provided by an embodiment of the present invention.
[0032] Figure 6 It is a schematic diagram of the file segment sending process provided by an embodiment of the present invention.
[0033] Figure 7 It is a schematic diagram of the traffic routing structure provided by an embodiment of the present invention.
[0034] Figure 8 It is a schematic diagram of a current limiting fuse provided by an embodiment of the present invention.
[0035] Fig. 9 It is a schematic diagram of a monitoring design provided by an embodiment of the present invention.
[0036] Fig.10 It is a schematic diagram of a method for controlling financial services based on a fast communication protocol provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0038] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0039] Reference Figures 1 to 9 As shown, a fast communication protocol includes: a data header, the data header includes a packet header length, a protocol version number, a packet type, a flag, an application code length, an application code, a service name length, a service name, a method name length, a method name, a system tracking number length, a system tracking number, an application system Token length, an application system Token, a request serial number length, a request serial number, an encryption algorithm name length, an encryption algorithm name, a compression algorithm name length, a compression algorithm name, a file name length, a file name, a message encoding length, and a message encoding; a data body, the data body includes a data length, a field, and a MAC check; a file attachment, the file attachment includes a file length, a file content, a total number of fragments, and a fragment sequence number.
[0040] The fields include: common fields, which consist of a field name and a field value, where the field name includes the length of the field name and the value of the field name, and the field value includes the length of the field value and the value of the field value; structure fields, which consist of a flag bit, a structure name length, a structure name, a structure length, and a structure, and the content of the structure is the same as the data body; and loop fields, which consist of a flag bit, a loop name length, a loop name, a loop number, an i-th loop length, and an i-th loop body, and the content of the loop body is the same as the data body.
[0041] The maximum length of the field name of a common field is 250 bytes; if the field name length is greater than 250 bytes, it is converted into a flag bit, and the flag bit uses 0xFE and 0xFF, 0xFE corresponds to the structure field, and 0xFF corresponds to the loop field; when the field name length of a common field is less than or equal to 250 bytes, it includes the field value length and the field value; when the field name length is greater than 250 bytes, it needs to be fragmented, in which the length field flag is 0xFF, and the fragment length is 250 bytes.
[0042] The packet types include: data transfer, file transfer, data and file transfer.
[0043] This communication protocol is mainly used for TCP-based socket communication. The main usage scenario is fast communication between multiple application systems in the same data center. It also supports communication between application systems in different data centers. However, attention should be paid to the delay of service registration information. It can only be used in application scenarios that allow delayed update of service registration information.
[0044] This communication protocol includes data header, data body, and file attachments.
[0045] Data Header:
[0046] 1) Packet header length. The packet header length field is a 2-byte integer. The packet header length includes the protocol version number, packet type, and flag bit. It may include application code length, application code, transaction code length, transaction code, business serial number length, business serial number, user ID length, user ID, signature length, and signature. However, this length does not include the packet header length field itself. The length of the fields contained in the packet header is not greater than 256.
[0047] 2) Version number: The version number field is of byte type, 4 bits in length, and the current value is 0x01.
[0048] 3) Packet type: the packet type field is byte type and has a length of 4 bits. Currently, two types are supported: data transfer, file transfer, and data and file transfer.
[0049] 0x01 Data Transfer 0x02 File attachments 0x03 Data and file transfer
[0050] 4) Flag bit, the flag bit is byte type, the length is 1 byte. There are 8 flag bits in total, the specific meanings are as follows:
[0051]
[0052] 5) Application code length and application code. The application code length field is an integer, 1 byte, and the application code refers to the application system identifier, character type.
[0053] 6) Service name code length and service name. The service name length field is an integer, 1 byte. The service name refers to the name of the application system service, character type.
[0054] 7) Method name length and method name. The method name length field is an integer, 1 byte. The method name refers to the name of the method that calls the application system service, character type.
[0055] 8) System tracking number length and system tracking number. The system tracking number length field is an integer, 1 byte. The system tracking number refers to the uniqueness of the request in the business sense, and is of character type.
[0056] 9) Application system Token length and application system Token. The application system Token length field is an integer, 1 byte. The application system Token is used to authenticate the application system.
[0057] 10) Request serial number length and request serial number. The request serial number length field is an integer, 1 byte. The request serial number is a unique identifier for each request. Encryption algorithm length and encryption algorithm. The encryption algorithm length field is an integer, 1 byte. The encryption algorithm refers to the data encryption algorithm used for the data body or file attachment, such as DSE, RSA, etc.
[0058] 12) Compression algorithm length and compression algorithm. The compression algorithm length field is an integer, 1 byte. The compression algorithm refers to the data compression algorithm used for the data body or file attachment, such as Snappy, Gzip, etc.
[0059] 13) File name length and file name. The file name length field is an integer, 1 byte. The file name refers to the name of the transferred file.
[0060] 14) Message coding length and message coding, the message coding length field is an integer, 1 byte.
[0061] Data body:
[0062] 1) Data length: The data length field is an integer, 4 bytes, and the data length refers to the length of the data body.
[0063] 2) Fields: Field types are divided into normal fields, result fields, and loop fields.
[0064] (1) Ordinary fields: Ordinary fields consist of a field name and a field value. The field name includes the length of the field name and the value of the field name, and the field value includes the length of the field value and the value of the field value.
[0065]
[0066] The maximum length of the field name of a common field (byte type, 1 byte) is 250 bytes. Any length exceeding 250 is illegal. If the field name length is greater than 250, it is converted into a flag bit. Currently, 0xFE and 0xFF are used. 0xFE corresponds to the structure field, and 0xFF corresponds to the loop field.
[0067] When the field value length is less than or equal to 250, it includes the field value length and the field value. When the field value length is greater than 250, it needs to be fragmented, where the length field flag is 0xFF, indicating that there are subsequent fragments, and the fragment length is 250, and the subsequent fragments are spliced into a complete value.
[0068] 0xFF Value(shard) 1 byte, the value is 0xFF, indicating that there are subsequent fragments, otherwise it ends Value(shard i)
[0069] (2) Structure field: The structure field consists of a flag, structure name length, structure name, structure length, and structure. The content of the structure is the same as the data body.
[0070]
[0071] (3) Loop field: The loop field consists of a flag bit, loop name length, loop name, number of loops, length of the i-th loop, and the i-th loop body. The content of the loop body is the same as the data body.
[0072]
[0073] 3) MAC checksum, byte type, length 4 bytes, algorithm to be determined. When the value is 0, it means there is no checksum.
[0074] File attachments:
[0075] When the packet type is 0x02, it means that the message only contains file attachments. When the packet type is 0x03, the message includes data and file attachments. The file attachment format is as follows:
[0076]
[0077] When the message includes data and files, the data packet is sent first, and then the file packet. The file length refers to the length of the sent file content, the total number of fragments is the total number of file fragments, byte type, length 1 byte, and the fragment sequence number refers to the sequence number of the current fragment, byte type, length 1 byte.
[0078] Note: 1) The current version does not support the breakpoint resume function.
[0079] 2) During file sending, it is recommended to perform fragmentation processing, and the single data sent should not exceed 8k.
[0080] Reference Fig.10As shown, a control method for financial services based on a fast communication protocol applies the fast communication protocol, including: a service registers its access address and provided service information with a registration center when it is started; the registration center stores the service information so that other services can query and discover it; when other services need to interact with a specific service, they can query the registration center for the location information of the corresponding service; the registration center will return the address and other relevant information of the target service, so that the two services can communicate directly.
[0081] Service registration and discovery involve a registration center, service consumers, and service providers; the service provider registers its address and service information with the registration center when the service is started, and the service provider and the registration center communicate via TCP socket; the service consumer queries the registration center for the address and other basic information of the service, and the service consumer and the registration center communicate via TCP socket; the service consumer calls the service provider's service interface, and the service consumer and the service provider communicate via TCP socket.
[0082] The service consumer calls the service interface of the service provider, which supports synchronous mode and asynchronous mode; if the service interface is in synchronous mode, it is necessary to wait for the service provider to return the call result before executing subsequent operations; if the service interface is in asynchronous mode, subsequent operations can be executed after receiving the response from the service provider.
[0083] Implementation of supporting functions
[0084] Service Registration Discovery
[0085] 1) Introduction to service registration and discovery
[0086] Service registration and discovery refers to how services register their location information in a distributed environment, and how other services discover and communicate with them. Specifically, service registration and discovery refers to:
[0087] Service registration: When a service starts, it registers its access address and the service information it provides with the registration center. The registration center stores this information so that other services can query and discover it.
[0088] Service discovery: When other services need to interact with a specific service, they can query the registry for the location information of the service. The registry will return the address and other relevant information of the target service, allowing the services to communicate directly.
[0089] 2) Architecture and Process
[0090] Service registration discovery involves the registration center, service consumers, and service providers. The architecture diagram is as follows Figure 3 As shown:
[0091] The process is as follows:
[0092] (1) When the service is started, the provider registers its address and service information with the registration center. The provider and the registration center communicate via TCP socket. The fields are described in the following table:
[0093]
[0094] The following are examples of messages sent during registration:
[0095] {"appCode":"app1","operate":"register","serviceName":"com.example.service.UserService","address":"10.0.0 .1:20880","methods":["methodA":{"args":[100,"test"],"return":"Sting","mode":"synchronize"}]"weight":"50"}
[0096] The "operate" field refers to the specific operation type, and the "register" value is used during registration.
[0097] The registration center responds with the following message:
[0098] {"result":"success","appCode":"app1","operate":"register","serviceName":"com.example.service.UserService","address":"10.0.0.1:20880"}
[0099] (2) The consumer queries the registration center for the service address and other basic information. The consumer and the registration center communicate via TCP socket.
[0100]
[0101]
[0102] The conditional message sent by the consumer is as follows:
[0103] {"appCode":"app1""operate":"query","serviceName":"com.example.service.UserService"}
[0104] The value of the "method" field is "query", which means querying the address and other basic information of the specified service.
[0105] The registration center responds with the following message:
[0106] {"appCode":"app1","result":"success","operate":"query",
[0107] "serviceName": "com.example.service.UserService",
[0108] "address":["10.0.0.1:20880","10.0.0.2:20880"], "weights":[50,50],"methods":["methodA":{"args":[100,"test"],"return":"Sting","mode":"synchronize"}]}
[0109] When the instance information of the registry service changes, the consumer needs to be notified through the socket. The notification content is as follows:
[0110] {"appCode":"app1","operate":"change","serviceName":"com.example.service.UserService","address":["10.0.0.1:20880:50","1 0.0.0.2:20880:50"],"weights":[50,50],"methods":["methodA":{"args":[100,"test"],"return":"Sting","mode":"synchronize"}]}
[0111] The consumer's response message is as follows:
[0112] {"result": "success", "appCode": "app1", "operate": "change", "serviceName": "com.example.service.UserService"]}
[0113] (3) The consumer service calls the provider's service interface, and they communicate through TCP socket. The detailed description of the communication protocol is described above. The consumer calls the provider's service interface, which supports synchronous and asynchronous modes. The method mode is set to asynchronous or synchronous when registering the service. When the consumer calls a specific method, if it is a synchronous method, it needs to wait for the provider to return the call result before performing subsequent operations. If it is an asynchronous method, after receiving the provider's response (receiving the request), it does not need to wait for the specific call result to perform subsequent operations. The fields of the communication message are described as follows. The fixed fields of the data header are omitted here, and only the data body fields are described:
[0114] Datagram
[0115]
[0116] The following uses a simplified datagram as an example to describe the communication process:
[0117] 1>Asynchronous mode, the consumer calls the provider message:
[0118] {"method":"methodA","args":[100,"test"],"address":"10.0.0.1:20880"}
[0119] Service Provider Response:
[0120] {"result":"recieve sucess","method":"methodA","args":[100,"test"]}
[0121] Asynchronous notification of service providers:
[0122] {"result":"handle sucess","method":"methodA","param":[100,"test"],"data":"100"}
[0123] The data field is the result data of the response. The interaction process is shown as follows: Figure 4 shown.
[0124] 2>Synchronous mode
[0125] The consumer calls the provider message:
[0126] {"method":"methodA","args":[100,"test"]}
[0127] Service Provider Response:
[0128] {"result":"handle sucess","method":"methodA","args":[100,"test"],"data":"100"}
[0129] The interaction process is shown as follows: Figure 5 shown.
[0130] File message
[0131] Field Name meaning Must lose illustrate fileName File name yes fileCode File Encoding yes fileLength File Length yes content File Contents yes shareCount Total number of fragments yes Total number of file fragments shareIndex Fragment sequence number yes The fragment sequence number, that is, the fragment number.
[0132] An example of a file message sent by a consumer is as follows:
[0133] Message data header:
[0134] {"fileName":"fname1","fileCode":"fcode1"}
[0135] Data body:
[0136] {"fileLenth":1000,"content":da12vhju...,"shareCount":0x05,"shareIndex":0x01}
[0137] The schematic diagram of file fragment sending is as follows Figure 6 shown.
[0138] 3) Registration center data structure
[0139] The registration center can use ZooKeeper. The data structure stored in ZooKeeper is as follows:
[0140] Root node: In ZooKeeper, create a root node named / nRPC under the root node.
[0141] Application node: Under the / nRPC root node, each application system creates a node. The node name is the application code, for example: / nRPC / app1
[0142] Service interface node: Under the application node, each service interface will have a corresponding node. The name of the node is the fully qualified name of the service interface, such as / nRPC / app1 / com.example.service.UserService. Each service interface node will contain all provider nodes and consumer nodes of the service.
[0143] Provider node: For a provider node, a providers subnode is created under the service interface node to store information about all providers that provide the service. The name of each provider node is a unique identifier, usually a combination of the provider's IP address and port number, such as 10.0.0.1:20880. The data content of each provider node usually includes information such as the provider's address, weight, and status.
[0144] Consumer node: For consumer nodes, a consumers subnode is created under the service interface node to store information about all consumers who consume the service. The structure of each consumer node is similar to that of the provider node. The node name is a combination of the IP address and port, and the node data contains information such as the consumer's address and status.
[0145] Method node: For a method node, a methods child node is created under the service interface node to store all methods and their properties. The node name is a combination of the method name, parameter type, and return value type, and the node data is the mode value of the method, that is, synchronous or asynchronous.
[0146] Dynamic node changes: When a new service provider or consumer registers, the corresponding node will be dynamically created and the relevant information will be written into the node. When the service provider or consumer goes offline, the corresponding node will be dynamically deleted. Changes in the content of the service interface, such as the addition or reduction of methods, parameter changes, etc., also require updating the registration information.
[0147] In general, when using ZooKeeper as the registration center, the corresponding application system node and service interface node will be created under the / nRPC root node, and provider and consumer nodes will be created under each service interface node to store information about service providers and consumers. This structure enables the registration center to realize dynamic registration and discovery of services and ensure the reliability and stability of service calls.
[0148] 4) Service center information synchronization
[0149] The synchronization of service information in the registration center is a key process. The registration center is designed to be application-internal, application-level, and enterprise-level. The application-level registration center ensures cross-system service calls and cross-data center calls, and the enterprise-level registration center supports system service communications between different organizations.
[0150] Reference Figure 7As shown in the figure, the specific implementation of traffic routing is to first divide the resources (application services) with certain attribute characteristics into a set, label this set, and then route the traffic with specific characteristics to the application service set marked with the label, and route other traffic to other application services that do not mark the label. The characteristic data can be an application system or user, etc.
[0151] 1) Communication security
[0152] Communication security mainly includes the security of communication links and the encryption of communication content. Link security refers to link encryption based on security protocols such as SSL / TLS to ensure that the communication content is not stolen or tampered with. The encryption and decryption of communication data content can be summarized as follows: the sender inputs plain text, encrypts, generates ciphertext, transmits the ciphertext, and the receiver decrypts to obtain plain text.
[0153] 2) Authentication and authorization
[0154] Authentication refers to confirming the identity of the person making the claim. Common authentication methods include: ID card, username and password, mobile phone text message, QR code scanning, gesture password, email, user's biological characteristics: fingerprint, iris, etc.
[0155] Authorization refers to obtaining the delegated authority of the user. In the field of information security, authorization means that the resource owner delegates the executor and grants the executor the resource operation authority within a specified scope.
[0156] The application system can be authenticated through the application system code and application system Token in the data message protocol mentioned above, the user and user Token fields can be used to authenticate the user, and the legitimacy of the operation can be checked based on the permission list of the application system and the user.
[0157] Current limiting and circuit breaking are flow control components for distributed service architectures. They mainly use flow as the entry point to help developers ensure the stability of microservices from multiple dimensions, such as current limiting, traffic shaping, circuit breaking and degradation, system load protection, and hotspot protection, to prevent the avalanche effect of external services caused by various software and hardware failures, traffic surges, exhaustion of synchronization resources, cache failure, and other problems.
[0158] A reference implementation of current limiting fuse is as follows:
[0159] The configuration center sends the request to the client in real time. The client intercepts the request and decides whether to let it go based on the governance policy. The client asynchronously collects traffic monitoring data and sends it to the flow control center for aggregation calculation, providing a basis for operation and maintenance personnel to evaluate governance effects and formulate governance policies. Figure 8 shown.
[0160] Policy release: Relying on the configuration center, the real-time release of governance policies is achieved.
[0161] Request interception: intercept requests based on traffic flow, and downgrade requests that do not meet the policy.
[0162] Traffic monitoring: Collect traffic-related operating indicators, conduct real-time aggregation analysis, and display them visually.
[0163] Reference Fig. 9 As shown in the figure, the monitoring center is responsible for counting service call times, call time, call success rate and other indicators. The caller and the callee first aggregate the data for a period of time (for example, one minute) in memory and then send it to the monitoring center server. The monitoring center itself also needs to cache the received monitoring data and then persist it in batches. Finally, the monitoring statistics are displayed in the form of reports.
[0164] Monitoring indicators such as the number of calls, call time, call success rate, etc. can be statistically analyzed according to multiple dimensions, including application systems, consumers, providers, etc.
[0165] The above embodiments are only used to explain the technical solutions of the present invention rather than to limit them. Those skilled in the art should understand that any modification and equivalent substitution that does not depart from the spirit and scope of the present invention should fall within the protection scope of the claims of the present invention.
Claims
1. A fast communication protocol, characterized in that: include: Data header, the data header includes packet header length, protocol version number, packet type, flag bit, application code length, application code, service name length, service name, method name length, method name, system tracking number length, system tracking number, application system token length, application system token, request serial number length, request serial number, encryption algorithm name length, encryption algorithm name, compression algorithm name length, compression algorithm name, file name length, file name, message encoding length, message encoding; Data body, the data body including data length, field and MAC check; The file attachment includes the file length, file content, total number of fragments and fragment sequence number.
2. A fast communication protocol according to claim 1, characterized in that: The fields include: A common field, wherein the common field is composed of a field name and a field value, wherein the field name includes the length of the field name and the value of the field name, and the field value includes the length of the field value and the value of the field value; The structure field is composed of a flag bit, a structure name length, a structure name, a structure length, and a structure. The content of the structure is the same as the data body. The loop field is composed of a flag bit, a loop name length, a loop name, a loop number, an i-th loop length, and an i-th loop body. The content of the loop body is the same as the data body.
3. A fast communication protocol according to claim 2, characterized in that: The maximum length of the field name of a common field is 250 bytes. If the field name length is greater than 250 bytes, it is converted into a flag bit. The flag bit uses 0xFE and 0xFF. 0xFE corresponds to the structure field, and 0xFF corresponds to the loop field. When the field name length of a common field is less than or equal to 250 bytes, it includes the field value length and the field value; when the field name length is greater than 250 bytes, fragmentation is required, in which the length field flag is 0xFF and the fragmentation length is 250 bytes.
4. A fast communication protocol according to claim 1, characterized in that: The packet types include: data transfer, file transfer, data and file transfer.
5. A method for controlling financial services based on a fast communication protocol, using a fast communication protocol as claimed in any one of claims 1 to 4, characterized in that: include: When a service is started, it registers its access address and service information with the registration center; The registry stores the service information so that other services can query and discover it; When other services need to interact with a specific service, they can query the registration center for the location information of the corresponding service; the registration center will return the address and other relevant information of the target service, so that the two services can communicate directly.
6. A method for controlling financial services based on a fast communication protocol according to claim 5, characterized in that: Also includes: Service registration and discovery involve registration centers, service consumers, and service providers; The service provider registers its address and service information with the registration center when the service is started, and the service provider and the registration center communicate via TCP socket; The service consumer queries the registration center for the service address and other basic information. The service consumer and the registration center communicate via TCP socket. The service consumer calls the service interface of the service provider, and the service consumer and the service provider communicate through TCP socket.
7. A method for controlling financial services based on a fast communication protocol according to claim 6, characterized in that: The service consumer calls the service interface of the service provider, supporting synchronous mode and asynchronous mode; If the service interface is in synchronous mode, you need to wait for the service provider to return the call result before performing subsequent operations; If the service interface is in asynchronous mode, subsequent operations can be performed after receiving the response from the service provider.
Citation Information
Patent Citations
Communication method and device based on message data
CN103957241A
Micro service infrastructure unit
CN107911430A
Field semantic analysis method for non-public industrial communication protocol
CN113194010A
API interface calling method and system based on data collection
CN117278640A
