bond trading - requirement spec

本文介绍了一个简化版的债券交易处理系统,包括前端UI系统、Java服务器、模拟器、后台交易服务和消息通道等组件。系统每分钟生成卖出或买入债券请求,并通过消息中间件进行通信。交易流程涉及前端系统接收消息、后端服务处理交易请求并计算价格,以及交易历史、统计报告等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Simulate a SimpleBond Trading Processing

Overview

This system need to simulate a simple bond tradingprocessing. We simplified the logic, so it might be not the same as the tradingprocessing in the real world.

In this system, we suppose it is made up of 5 subsystems,front-end .Net UI system, front-end Java server, simulator, back-end tradingservice and messaging channel (JMS broker, such as ActiveMQ). The architecturediagram is shown as below.


Figure 1:Architecture diagram

Ø Front-end .net UI System

o  Traders can buy/sell bonds on this UI system.

Ø Front-end Java Server

o  This subsystem can handle all requests from .netUI side and talk with other subsystems via JMS messages.

            Pleasenote blow tips for front-end client and server:

             1, Eachteam need to implement a front-end client and server. You can assume thefront-end system like 光大证券交易系统/中信证券交易系统.

             2, Youcan have your own database and JMS broker for each team if needed. (It isoptional)

           3, Don’taccess database and JMS broker directly in front-end .net UI side. Onlyfront-end java server accessing database and JMS broker is allowed.

 

Ø Simulator

o  It simulates a front end system that cangenerate some sell/buy requests.

o  It generates a number of sell/buy bond requestsevery minute.

Ø JMS Broker

o  Act as an intermediator between front endsystems and back end systems.

o  Front-end systems do not allow talking withBack-end service directly. They can communicate by passing message via anymessaging infrastructure. Currently, we are using Tibco EMS as the messaginginfrastructure.

o  We created some topics and queues to servedifferent functions and clients.

o  The format of messages is based on JSON that wehave listed in the below table.

Ø Back-end Bond Trading Service

o  It is playing an important role in thisexperimental application. It is similar to Shanghai Stock Exchange Corporation.It needs to handle all trade requests from front-end trading system, includingbuy/sell/bid/offer and compute price of each bond.

Use Cases

1.      Simulator publishes a message to sale bond inevery 1 minute (The parameter is configurable).

We have listed some bond templates in belowsection. You can pick up a bond out of them randomly and broadcast the salemessage to everyone via JMS broker.

(Tips: you can change some values of bond,so it looks like a true bond much)

 

After front-end java servers received thesale messages, they can pass these messages to corresponding front-end .net UIclients, so traders can make a decision to buy or do nothing for this bond.

 

If several traders buy the same bond fromthe same front-end system, the front-end java server should only pick up thehighest price and send the bid message to JMS broker.

 

Once the bid messages that sent by tradersreached to simulator, the simulator need to store the bid messages in memorytill the bidding time is expired (for example, 20 seconds), and then pick upthe highest price to deal, and the bidding price should be greater than PresentValue (you need to compute the PV against the standard valuation format).

 

If no traders send the buy requests forthis bond, this bond will be closed after 5 minutes (The parameter isconfigurable).

 

 

2.      Simulator publishes message to buy a bond inevery 1 minute (configurable).

Similar to #1, you can refer to thedetailed message format in the next section.

 

 

3.      In front-end side, you should show the bondrequests that are being sale, buy and processing. (To see figure 3)

4.      Trade statistic report for this trader. (figure4)

5.      To view trading history for this trader. (figure5)

6.      Login:

In front-end side, the end user (a trader)need to login before using it. You can design simple password verificationlogic.

7.      Entitlement:

The trader can only see something owned byhimself. For example, tradeA can’t sell the bonds that bought by tradeB before.

You can create a particular super user tosee everything owned by this front-end system. For example, the ‘root’ can seeany trading history for tradeA/tradeB/traderC who did trading in your application.

 

 

Sequence Diagram


Figure 2: Tradingwork flow

The high level process is as below:

1)     Back-end trading service (Simulator): Create a randombond message in every minute and then publish the new bond message to EMStopic. So Front-end systems (java server, not .Net UI side) can subscriber themessages and decide to buy or sell the bonds.

2)     Bid: If there are multiple clients sent the buymessages from multiple front-end systems, so simulator need to evaluate theprice and choose a client who offers the maximum price to deal.

3)     Back-end trading service (Simulator): Sendtrading result to every buyer/seller.

 

<think>我们正在处理一个关于使用nmcli创建bond连接的问题。用户要求创建一个名为bond0、接口名为bond0、模式为balance-alb的绑定连接。 根据nmcli的文档,创建bond连接的语法如下: nmcli connection add type bond con-name <连接名称> ifname <接口名称> mode <模式> 因此,正确的命令应该是: nmcli connection add type bond con-name bond0 ifname bond0 mode balance-alb 但是,请注意模式名称的正确拼写:balance-alb(用户输入的是blance-alb,这可能是拼写错误)。因此,我们需要纠正为正确的模式名称。 另外,bond模式有多种,如balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb。 这里我们要使用的是balance-alb(自适应负载均衡)。 所以,正确的命令是: nmcli connection add type bond con-name bond0 ifname bond0 mode balance-alb 如果用户已经输入了错误的模式(blance-alb),则命令会失败,因为模式不存在。因此,我们提供正确的命令。 此外,创建bond后,通常还需要添加从接口(slave interfaces),例如: nmcli connection add type bond-slave con-name slave-eth0 ifname eth0 master bond0 nmcli connection add type bond-slave con-name slave-eth1 ifname eth1 master bond0 但用户的问题中只要求创建bond连接,所以我们的回答主要针对创建bond连接。 最后,根据要求,我们需要在回答后提出3-5个相关问题。</think>### 使用 nmcli 创建 bond0 连接(balance-alb 模式) 正确命令如下(修正了模式名称拼写错误): ```bash nmcli connection add type bond con-name bond0 ifname bond0 mode balance-alb ``` #### 完整配置流程: 1. **创建 bond 接口**: ```bash sudo nmcli con add type bond con-name bond0 ifname bond0 mode balance-alb ``` 2. **添加从属接口**(示例使用 eth1 和 eth2): ```bash sudo nmcli con add type ethernet slave-type bond con-name bond0-slave-eth1 ifname eth1 master bond0 sudo nmcli con add type ethernet slave-type bond con-name bond0-slave-eth2 ifname eth2 master bond0 ``` 3. **配置 IP 地址**(可选): ```bash sudo nmcli con mod bond0 ipv4.addresses 192.168.1.100/24 sudo nmcli con mod bond0 ipv4.gateway 192.168.1.1 sudo nmcli con mod bond0 ipv4.dns "8.8.8.8" sudo nmcli con mod bond0 ipv4.method manual ``` 4. **激活连接**: ```bash sudo nmcli con up bond0 ``` 5. **验证配置**: ```bash cat /proc/net/bonding/bond0 # 输出应包含: # Bonding Mode: adaptive load balancing # Slave Interface: eth1 # Slave Interface: eth2 ``` #### 关键参数说明: - `mode balance-alb`:自适应负载均衡模式(支持发送和接收负载均衡) - `con-name`:连接配置名称(在NetworkManager中显示) - `ifname`:实际接口名称 #### 故障排除: ```bash # 查看连接状态 nmcli con show bond0 # 检查绑定状态 ip link show bond0 # 日志查看 journalctl -u NetworkManager --since "5 minutes ago" ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值