Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BIBO (D) [1 BUG, 2 TODOs]
09-24-2020, 01:05 PM
Post: #1
BIBO (D) [1 BUG, 2 TODOs]
[bug] delete_case function does not return 200
TODO1: improve search function, 13 seconds is not fast
TODO2 : add concurrent query support.

This is disigners' info for cod://prada/procuratorate

目前BIBO的运行比较复杂,要启动simpleserv和Data Thinker,并联通端口。
另外,建议请把BIBO变成一个服务,用systemctl start bibo.service启动。
BIBO backend service为BIBO系统的后台服务。

BIBO work environment 用于设置BIBO系统的运行环境

simpleserv.sh
Code:
监听62818端口,执行$bibo_base/talk2thinker.sh

talk2thinker.sh
Code:
work() {
    read $newcasepfn till meet blank line

    triage()
}

triage() informs think about the request.
Code:
$tspfn: sage tasks

triage() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert_case()
        case "delete":
            delete_case()
        case "query":
            query_case()
        case "select":
            select_case()
    }

    set $sage_user as sage2
    use program auntie  to register $tspfn
}

insert_case()
bibo maintains $casecnt as the total number of cases in the corpus.
Code:
insert_case() {
    create a new directory $newdir, set its name as ++$casecnt
    copy $newcasepfn to be $newdir/content
    auntie up --here=$newdir $casecnt
    generate insert success response
}

delete_case()
Code:
delete_case() {
    clear file $tspfn
    $reqcaseid = requested case id
    for each case; do
        set option $tycano, $reqtype and $reqcaseid for procone.py
    done
    auntie register tasks
    generate delete success response
}

query_case()
Code:
query_case() {
    clear file $tspfn
    for each case; do
        set option $tycano for procone.py
    done
    auntie register tasks
    generate query result response
}

select_case()
Code:
select_case() {
    clear file $tspfn
    $reqcaseid = requested case id
    for each case; do
      register tasks:
        procone.py --tycano=$tycano --reqtype=$reqtype --reqcaseid=$reqcaseid
    done
    getresults()
}

getResults() collect returned results from think.
Code:
getresults() {
        scrutinize() {
                generate response for each case
        }
        generate response for all cases
        return response
}

scrutinize() examines intermediate result files and generates an overall result file.

---
20220718/zhihao: add 2 todos
20210813/lingu: detail insert
20210810/lingu: link query case
20201010/zhihao: add BIBO work environment
20200929/zhihao: add BIBO backend service
20200926/zhihao: add select_case()
20200926/lingu: run $bibo_base/talk2thinker.sh
20200925/zhihao: add delete_case bug
20200925/zhihao: move procone.py
20200924/zhihao: update title to BIBO (D)
20200924/zhihao: update tellThinker function
Quote this message in a reply
09-24-2020, 02:08 PM
Post: #2
RE: prada -- D
修改首文tellThinker函数及其内插入删除和查询函数的设计信息
(09-24-2020 01:05 PM)zhihao Wrote:  tellThinker() informs think about the request.
Code:
tellThinker() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert()
        case "delete":
            delete()
        case "query":
            query()
    }
}
修改为
tellThinker() informs think about the request.
Code:
$tspfn: sage tasks

tellThinker() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert_case()
        case "delete":
            delete_case()
        case "query":
            query_case()
    }

    change user to sage2
    use program auntie  to register $tspfn
}

(09-24-2020 01:05 PM)zhihao Wrote:  insert()
Code:
insert() {
    create a new directory $newdir, set its name as $casecnt + 1
    copy $newcasepfn to $newdir
    generate insert success response
}
修改为
insert_case()
Code:
insert_case() {
    create a new directory $newdir, set its name as $casecnt + 1
    copy $newcasepfn to $newdir
    generate insert success response
}

(09-24-2020 01:05 PM)zhihao Wrote:  delete()
Code:
delete() {
    for each case; do
        analyse cases with sage
    done
    generate delete success response
}
修改为
delete_case()
Code:
delete_case() {
    clear file $tspfn
    set $reqcaseid as request case id
    for each case; do
        set option $tycano, $reqtype and $reqcaseid for procone.py
    done
    generate delete success response
}

(09-24-2020 01:05 PM)zhihao Wrote:  query()
Code:
query() {
    for each case; do
        analyse cases with sage
    done
    generate query result response
}
修改为
query_case()
Code:
query_case() {
    clear file $tspfn
    for each case; do
        set option $tycano for procone.py
    done
    generate query result response
}

请审核上述tellThinker函数及插入、删除、查询函数设计信息
RR lingu
Quote this message in a reply
09-24-2020, 02:32 PM (This post was last modified: 09-24-2020 02:34 PM by lingu.)
Post: #3
RE: prada -- D
(09-24-2020 02:08 PM)zhihao Wrote:  修改首文tellThinker函数及其内插入删除和查询函数的设计信息
(09-24-2020 01:05 PM)zhihao Wrote:  tellThinker() informs think about the request.
Code:
tellThinker() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert()
        case "delete":
            delete()
        case "query":
            query()
    }
}
修改为
tellThinker() informs think about the request.
Code:
$tspfn: sage tasks

tellThinker() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert_case()
        case "delete":
            delete_case()
        case "query":
            query_case()
    }

    change user to sage2
    use program auntie  to register $tspfn
}

(09-24-2020 01:05 PM)zhihao Wrote:  insert()
Code:
insert() {
    create a new directory $newdir, set its name as $casecnt + 1
    copy $newcasepfn to $newdir
    generate insert success response
}
修改为
insert_case()
Code:
insert_case() {
    create a new directory $newdir, set its name as $casecnt + 1
    copy $newcasepfn to $newdir
    generate insert success response
}

(09-24-2020 01:05 PM)zhihao Wrote:  delete()
Code:
delete() {
    for each case; do
        analyse cases with sage
    done
    generate delete success response
}
修改为
delete_case()
Code:
delete_case() {
    clear file $tspfn
    set $reqcaseid as request case id
    for each case; do
        set option $tycano, $reqtype and $reqcaseid for procone.py
    done
    generate delete success response
}

(09-24-2020 01:05 PM)zhihao Wrote:  query()
Code:
query() {
    for each case; do
        analyse cases with sage
    done
    generate query result response
}
修改为
query_case()
Code:
query_case() {
    clear file $tspfn
    for each case; do
        set option $tycano for procone.py
    done
    generate query result response
}

请审核上述tellThinker函数及插入、删除、查询函数设计信息
RR lingu

That's too much to review. You should have proposed the changes one by one -- one for insert, one for delete, etc.

I think it is fine as the first version. Pls update to the headpost then we improve further.

Pls name this thread BIBO (D). Prada is different.

Pls mv this to the Prada board -- http://rar.shufangkeji.com:60380/forumdi...hp?fid=406
Find all posts by this user
Quote this message in a reply
09-24-2020, 03:48 PM
Post: #4
RE: prada -- D
(09-24-2020 02:32 PM)lingu Wrote:  That's too much to review. You should have proposed the changes one by one -- one for insert, one for delete, etc.

I think it is fine as the first version. Pls update to the headpost then we improve further.

Pls name this thread BIBO (D). Prada is different.

Pls mv this to the Prada board -- http://rar.shufangkeji.com:60380/forumdi...hp?fid=406

moved
Quote this message in a reply
09-24-2020, 06:01 PM
Post: #5
RE: BIBO (D)
在cod://prada内添加了Makefile逻辑,添加maketst.sh。目前make test可测试插入删除。

如下为在screen zh-scr内执行的结果
Code:
[zhihao@g1b-2 prada]$ make test
casecnt before insert: 52
inserting /data/20200906.1/processed/zengxingliang.json
{
"code": 200,
"msg": "ok",
"children": []
}
insert finished

inserted file :/thinker/globe/udata/lingu/testy/procuratorate/tests/typical/53/insert.json
{"type":"insert","query":"","caseid":"","insert":{"keys":[{"key1":"破坏计算机信息系统","key2":"智能手机终端","key3":"计算机信息系统","detailid":"087b2085e4a911ea987a005056c00001"},{"key1":"破坏计算机信息系统","key2":"智能手机终端","key3":"破坏计算机信息系统","detailid":"087b5ca4e4a911ea987a005056c00001"},{"key1":"破坏计算机信息系统","key2":"智能手机终端","key3":"牵连犯","detailid":"087b61a1e4a911ea987a005056c00001"}],"caseid":"67be261c9e6311eabceb005056c00001","casetitle":"曾兴亮、王玉生破坏计算机信息系统案","caserate":"5.00","casetype":"最高人民检察院指导性案例","caseaction":"破坏计算机信息系统罪","caseyear":2017,"content":"第九批指导性案例(曾兴亮、王玉生破坏计算机信息系统案) (检例第35号) 【关键词】 破坏计算机信息系统 智能手机终端 远程锁定 【基本案情】 被告人曾兴亮,男,1997年8月生,农民。 被告人王玉生,男,1992年2月生,农民。 2016年10月至11月,被告人曾兴亮与王玉生结伙或者单独使用聊天社交软件,冒充年轻女性与被害人聊天,谎称自己的苹果手机因故障无法登录“iCloud”(云存储)​,请被害人代为登录,诱骗被害人先注销其苹果手机上原有的ID,再使用被告人提供的ID及密码登录。随后,曾、王二人立即在电脑上使用新的ID及密码登录苹果官方网站,利​用苹果手机相关功能将被害人的手机设置修改,并使用“密码保护问题”修改该ID的密码,从而远程锁定被害人的苹果手机。曾、王二人再在其个人电脑上,用网络聊天软件与被害​人联系,以解锁为条件索要钱财。采用这种方式,曾兴亮单独或合伙作案共21起,涉及苹果手机22部,锁定苹果手机21部,索得人民币合计7290元;王玉生参与作案12起​,涉及苹果手机12部,锁定苹果手机11部,索得人民币合计4750元。2016年11月24日,二人被公安机关抓获。 【诉讼过程和结果】 本案由江苏省海安县人民检察院于2016年12月23日以被告人曾兴亮、王玉生犯破坏计算机信息系统罪向海安县人民法院提起公诉。2017年1月20日,海安县人民法院作​出判决,认定被告人曾兴亮、王玉生的行为构成破坏计算机信息系统罪,分别判处有期徒刑一年三个月、有期徒刑六个月。一审宣判后,二被告人未上诉,判决已生效。 【要 旨】 智能手机终端,应当认定为刑法保护的计算机信息系统。锁定智能手机导致不能使用的行为,可认定为破坏计算机信息系统。 【指导意义】 计算机信息系统包括计算机、网络设备、通信设备、自动化控制设备等。智能手机和计算机一样,使用独立的操作系统、独立的运行空间,可以由用户自行安装软件等程序,并可以通​过移动通讯网络实现无线网络接入,应当认定为刑法上的“计算机信息系统”。 行为人通过修改被害人手机的登录密码,远程锁定被害人的智能手机设备,使之成为无法开机的“僵尸机”,属于对计算机信息系统功能进行修改、干扰的行为。造成10台以上智能​手机系统不能正常运行,符合刑法第二百八十六条破坏计算机信息系统罪构成要件中“对计算机信息系统功能进行修改、干扰”“后果严重”的情形,构成破坏计算机信息系统罪。 行为人采用非法手段锁定手机后以解锁为条件,索要钱财,在数额较大或多次敲诈的情况下,其目的行为又构成敲诈勒索罪。在这类犯罪案件中,手段行为构成的破坏计算机信息系统​罪与目的行为构成的敲诈勒索罪之间成立牵连犯。牵连犯应当从一重罪处断。破坏计算机信息系统罪后果严重的情况下,法定刑为五年以下有期徒刑或者拘役;敲诈勒索罪在数额较大​的情况下,法定刑为三年以下有期徒刑、拘役或者管制,并处或者单处罚金。本案应以重罪即破坏计算机信息系统罪论处。 【相关法律规定】 《中华人民共和国刑法》 第二百八十六条 违反国家规定,对计算机信息系统功能进行删除、修改、增加、干扰,造成计算机信息系统不能正常运行,后果严重的,处五年以下有期徒刑或者拘役;后果特别严重的,处五年以上​有期徒刑。 第二百七十四条 敲诈勒索公私财物,数额较大或者多次敲诈勒索的,处三年以下有期徒刑、拘役或者管制,并处或者单处罚金;数额巨大或者有其他严重情节的,处三年以上十年以下有期徒刑,并处​罚金;数额特别巨大或者有其他特别严重情节的,处十年以上有期徒刑,并处罚金。 《最高人民法院、最高人民检察院关于办理危害计算机信息系统安全刑事案件应用法律若干问题的解释》 第十一条 本解释所称“计算机信息系统”和“计算机系统”,是指具备自动处理数据功能的系统,包括计算机、网络设备、通信设备、自动化控制设备等。 …… 《最高人民法院、最高人民检察院关于办理敲诈勒索刑事案件适用法律若干问题的解释》 第一条 敲诈勒索公私财物价值二千元至五千元以上、三万元至十万元以上、三十万元至五十万元以上的,应当分别认定为刑法第二百七十四条规定的“数额较大”、“数额巨大”、“数额特​别巨大”。 各省、自治区、直辖市高级人民法院、人民检察院可以根据本地区经济发展状况和社会治安状况,在前款规定的数额幅度 内,共同研究确定本地区执行的具体数额标准,报最高人民法院、最高人民检察院批准。 《江苏省高级人民法院、江苏省人民检察院、江苏省公安厅关于我省执行敲诈勒索公私财物“数额较大”、“数额巨大”、“数额特别巨大”标准的意见》 根据《最高人民法院、最高人民检察院关于办理敲诈勒索刑事案件适用法律若干问题的解释》的规定,结合我省经济发展和社会治安实际状况,确定我省执行刑法第二百七十四条规定​的敲诈勒索公私财物“数额较大”、“数额巨大”、“数额特别巨大”标准如下: 一、敲诈勒索公私财物价值人民币四千元以上的,为“数额较大”; 二、敲诈勒索公私财物价值人民币六万元以上的,为“数额巨大”; ……"}}


casecnt after insert: 53

deleting /data/20200906.1/processed/del_zengxingliang.json
{
"code": 200,
"msg": "ok",
"children": []
}
delete finished

file content after deleted
{"type": "","query": "","caseid": "","insert": {"keys": [] }}

[zhihao@g1b-2 prada]$
Quote this message in a reply
09-24-2020, 07:22 PM
Post: #6
RE: BIBO (D)
(09-24-2020 06:01 PM)zhihao Wrote:  在cod://prada内添加了Makefile逻辑,添加maketst.sh。目前make test可测试插入删除。

should move it to dir procuratorate. bibo is not prada.

where is the info about the tests?


Quote:如下为在screen zh-scr内执行的结果
Code:
[zhihao@g1b-2 prada]$ make test
...
file content after deleted
{"type": "","query": "","caseid": "","insert": {"keys": [] }}

[zhihao@g1b-2 prada]$

It asks me for your password.
Code:
18:20:32 lingu@g1b-2:/home/lingu/forest/prada/prada> make test
casecnt before insert: 58
inserting /data/20200906.1/processed/zengxingliang.json
zhihao@10.6.64.21's password:
Find all posts by this user
Quote this message in a reply
09-24-2020, 07:57 PM
Post: #7
RE: BIBO (D)
(09-24-2020 07:22 PM)lingu Wrote:  
(09-24-2020 06:01 PM)zhihao Wrote:  在cod://prada内添加了Makefile逻辑,添加maketst.sh。目前make test可测试插入删除。

should move it to dir procuratorate. bibo is not prada.

where is the info about the tests?
在cod://prada/procuratorate/ 内创建Makefile和maketest.sh。
maketest.sh D info:
Code:
show case count before insert
send insert request to trajan.d-thinker.org 20050

output inserted case file
show case count after insert

send delete request to trajan.d-thinker.org 20050

RR lingu

(09-24-2020 07:22 PM)lingu Wrote:  
Quote:如下为在screen zh-scr内执行的结果
Code:
[zhihao@g1b-2 prada]$ make test
...
file content after deleted
{"type": "","query": "","caseid": "","insert": {"keys": [] }}

[zhihao@g1b-2 prada]$

It asks me for your password.
Code:
18:20:32 lingu@g1b-2:/home/lingu/forest/prada/prada> make test
casecnt before insert: 58
inserting /data/20200906.1/processed/zengxingliang.json
zhihao@10.6.64.21's password:

之前获取插入和删除测试案例时是登陆limbo30-1获取的,所以需要密码,目前已将测试案例存放在$bibo_base/processed
screen zh-scr现在可以执行make test测试
Quote this message in a reply
09-24-2020, 08:19 PM (This post was last modified: 09-24-2020 10:35 PM by lingu.)
Post: #8
RE: BIBO (D)
(09-24-2020 01:05 PM)zhihao Wrote:  talk2thinker.sh
Code:
work() {
    read $newcasepfn till meet blank line

    tellThinker()
    getresults()
}

getresults() may have trouble for insert and delete because they do not generate "results".

Quote:tellThinker() informs think about the request.
Code:
$tspfn: sage tasks

tellThinker() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert_case()
        case "delete":
            delete_case()
        case "query":
            query_case()
    }

    change user to sage2

It does not "change user". The program just specify sage_user=sage2, right?

Quote: use program auntie to register $tspfn
}

We should not register tasks for insert. So I think we need move this 'auntie register' to the functions for query and delete.
--- 20200924/lingu moved the auntie register to functions delete_case() and query_case()
Find all posts by this user
Quote this message in a reply
09-24-2020, 08:22 PM (This post was last modified: 09-24-2020 10:48 PM by lingu.)
Post: #9
RE: BIBO (D)
(09-24-2020 07:57 PM)zhihao Wrote:  
(09-24-2020 07:22 PM)lingu Wrote:  
(09-24-2020 06:01 PM)zhihao Wrote:  在cod://prada内添加了Makefile逻辑,添加maketst.sh。目前make test可测试插入删除。

should move it to dir procuratorate. bibo is not prada.

where is the info about the tests?
在cod://prada/procuratorate/ 内创建Makefile和maketest.sh。
Dont make a big test of all tests. Make small tests and combine them.

I think you can rename maketest.sh to be test_crds.sh -- it creates, reads, deletes and selects a case. The create, read, delete and select ops can be individual tests in their own scripts. The crds test invokes them in sequence.

Quote:maketest.sh D info:
Code:
show case count before insert
send insert request to trajan.d-thinker.org 20050

output inserted case file
show case count after insert

send delete request to trajan.d-thinker.org 20050

RR lingu

OK as the first version. Make sure to ALWAYS RECORD INFO when designing.

No need to specify D info for tests. Just write OMUD together. Create a thread for that.

Quote:
(09-24-2020 07:22 PM)lingu Wrote:  It asks me for your password.
Code:
18:20:32 lingu@g1b-2:/home/lingu/forest/prada/prada> make test
casecnt before insert: 58
inserting /data/20200906.1/processed/zengxingliang.json
zhihao@10.6.64.21's password:

之前获取插入和删除测试案例时是登陆limbo30-1获取的,所以需要密码,目前已将测试案例存放在$bibo_base/processed
screen zh-scr现在可以执行make test测试

测试应该用各自用户进行,或规定用户。screen是用来协同调试用的。注意分清各种情况。
Find all posts by this user
Quote this message in a reply
09-24-2020, 08:26 PM (This post was last modified: 09-24-2020 10:39 PM by lingu.)
Post: #10
RE: prada -- D
(09-24-2020 02:08 PM)zhihao Wrote:  tellThinker() informs think about the request.
Code:
tellThinker() {
    set $casecnt as the number of cases

    switch $casetype {
        case "insert":
            insert()
        case "delete":
            delete()
        case "query":
            query()
    }
}

There is a 'select' function.

Pls design the 'select' function. You can ask collaborators if you are not sure what 'select' is expected to do.

Pls also add a query test and a select test.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: