天佐.乾坤袋 基于抽屉式文件存储的NoSql数据库

天佐.乾坤袋

天佐.乾坤袋

简介

天佐.乾坤袋 基于抽屉式文件存储的NoSql数据库,可用于文件打包,数据整合,加密存放等多种用途。可以方便快捷的搭建和部署存储应用的系统。

传说:
弥勒所有,专做储物之用。拥有不可思议之力,内部有著奇异之空间,空间之大似能将天地收纳于内。袋中另有乾坤,应有尽有,取之不尽。

目标

构建一种使用简单接口调用就可以完成数据管理的NoSql数据库。

功能

  • 🧩 集成简单
  • 📦 存放文件可自由选择压缩
  • 🪢 数据经过256位AES算法加密
  • 📒 支持数据批量增加/删除/修改/查询
  • 📃 支持直接获取原始数据流

截图

天佐.乾坤袋测试程序:

例子

cpp
#include <iostream>
#include <memory>
#include "tianzuo.QiankunInterface.h" // 接口头文件 interface heaher fileint main() {// 准备数据 prepare dataQiankun_db_verify_struct db_verify("qiankunDataBase.Ztz", "password");int integer = 12345678;Qiankun_data_type_struct data_type(Qiankun_data_type_integer, -1, "integer");Qiankun_user_data_struct user_data(&integer, 0);int data_size = 0;Qiankun_get_user_data_struct get_user_data(reinterpret_cast<void*&>(integer), &data_size);// 初始化接口 initialize the interfacestd::unique_ptr<tianzuo_QiankunInterface> qiankun_interface(new tianzuo_QiankunInterface());// 创建实例 create an instancetianzuo_QiankunInt* qiankun = qiankun_interface->initialize();// 初始化实例 initialize the instanceint error_code = qiankun->initialize();if (error_code != Qiankun_errorcode_success) {std::cout << "initialize error: " << error_code;goto return_error;return -1;}// 创建数据库 create databaseerror_code = qiankun->db_create_database(&db_verify, "qiankunDataBase", true);if (error_code != Qiankun_errorcode_success) {std::cout << "db_create_database error: " << error_code;goto return_error;return -1;}// 打开数据库 open databaseerror_code = qiankun->db_open_database(&db_verify);if (error_code != Qiankun_errorcode_success) {std::cout << "db_open_database error: " << error_code;goto return_error;return -1;}// 向数据库写入一个整型数据 writes an integer to the databaseerror_code = qiankun->data_combine(&db_verify, &data_type, nullptr, &user_data, false, -1);if (error_code != Qiankun_errorcode_success) {std::cout << "data_combine error: " << error_code;goto return_error;return -1;}// 读取刚写入的数据 read the data just writteninteger = -1;error_code = qiankun->data_extract(&db_verify, &data_type, nullptr, &get_user_data);if (error_code != Qiankun_errorcode_success) {std::cout << "data_extract error: " << error_code;goto return_error;return -1;}std::cout << "get integer data: " << integer;// 关闭数据库 close databaseerror_code = qiankun->db_close_database(&db_verify);if (error_code != Qiankun_errorcode_success) {std::cout << "db_close_database error: " << error_code;goto return_error;return -1;}return_error:// 释放接口 terminate the interfaceif (qiankun_interface != nullptr && qiankun != nullptr) {qiankun_interface->terminate(&qiankun);}std::cout << "test done -------------------";return 0;
}
python
from ctypes import *
from enum import Enum
import ctypestianzuo_QiankunLib = cdll.LoadLibrary('./tianzuo.Qiankun.dll')class Qiankun_error_code(Enum):Qiankun_errorcode_success           = 1 # 正确的值Qiankun_errorcode_normal            = 2 # 错误的值Qiankun_errorcode_differ            = 3 # 数据库文件数效验未通过 (The number of database files fails to be verified)Qiankun_errorcode_no_rights         = 4 # 数据库密码效验未通过 (The database password verification failed)Qiankun_errorcode_db_not_exist      = 5 # 数据库文件不存在 (The database file does not exist)Qiankun_errorcode_exist             = 6 # 数据已存在 (Data already exists)Qiankun_errorcode_not_exist         = 7 # 数据不存在 (Data does not exist)Qiankun_errorcode_out_of_range      = 8 # 超出范围 (out of range)Qiankun_errorcode_type              = 9 # 类型不符 (wrong type)Qiankun_errorcode_param             = 10 # 参数错误 (parameter error)Qiankun_errorcode_compress          = 11 # 压缩错误 (compression error)Qiankun_errorcode_get_array         = 12 # 数组错误 (arrary error)Qiankun_errorcode_out_of_memory     = 13 # 内存溢出 (memory overflow)Qiankun_errorcode_handle            = 14 # 句柄错误 (error handle)Qiankun_errorcode_io                = 15 # IO错误 (io error)class tianzuo_QiankunInt:def __init__(self):tianzuo_QiankunLib.tianzuo_QiankunInterface_initialize.restype = c_void_pself.obj = tianzuo_QiankunLib.tianzuo_QiankunInterface_initialize()def __del__(self):tianzuo_QiankunLib.tianzuo_QiankunInterface_terminate.argtypes = [c_void_p]tianzuo_QiankunLib.tianzuo_QiankunInterface_terminate(self.obj)def initialize(self):tianzuo_QiankunLib.tianzuo_QiankunInterface_initialize.restype = c_inttianzuo_QiankunLib.tianzuo_QiankunInt_initialize.argtypes = [c_void_p]return tianzuo_QiankunLib.tianzuo_QiankunInt_initialize(self.obj)def db_create_database(self, db_file_name, db_password, db_name, over_write):tianzuo_QiankunLib.tianzuo_QiankunInt_db_create_database.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, c_int]return tianzuo_QiankunLib.tianzuo_QiankunInt_db_create_database(self.obj, db_file_name, db_password, db_name, over_write)def db_open_database(self, db_file_name, db_password):tianzuo_QiankunLib.tianzuo_QiankunInt_db_open_database.argtypes = [c_void_p, c_char_p, c_char_p]return tianzuo_QiankunLib.tianzuo_QiankunInt_db_open_database(self.obj, db_file_name, db_password)def db_close_database(self, db_file_name, db_password):tianzuo_QiankunLib.tianzuo_QiankunInt_db_close_database.argtypes = [c_void_p, c_char_p, c_char_p]return tianzuo_QiankunLib.tianzuo_QiankunInt_db_close_database(self.obj, db_file_name, db_password)def data_int_combine(self, db_file_name, db_password, data_name, remark, data):tianzuo_QiankunLib.tianzuo_QiankunInt_data_int_combine.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, c_char_p, c_int]return tianzuo_QiankunLib.tianzuo_QiankunInt_data_int_combine(self.obj, db_file_name, db_password, data_name, remark, data)def data_int_extract(self, db_file_name, db_password, data_name, data):tianzuo_QiankunLib.tianzuo_QiankunInt_data_int_extract.argtypes = [c_void_p, c_char_p, c_char_p, c_char_p, ctypes.POINTER(ctypes.c_int)]return tianzuo_QiankunLib.tianzuo_QiankunInt_data_int_extract(self.obj, db_file_name, db_password, data_name, data)def main():# 初始化接口 initialize the interfaceprint("initialize the interface")# 创建实例 create an instanceqiankun = tianzuo_QiankunInt()error_code = qiankun.initialize()if error_code != Qiankun_error_code.Qiankun_errorcode_success.value:print("initialize error:", error_code)return# 创建数据库 create databasedb_file_name = b"qiankunDataBase.Ztz"db_password = b"password"error_code = qiankun.db_create_database(db_file_name, db_password, b"qiankunDataBase", True)if error_code != Qiankun_error_code.Qiankun_errorcode_success.value:print("db_create_database error:", error_code)return# 打开数据库 open databaseerror_code = qiankun.db_open_database(db_file_name, db_password)if error_code != Qiankun_error_code.Qiankun_errorcode_success.value:print("db_open_database error:", error_code)return# 向数据库写入一个整型数据 writes an integer to the databaseintInt = 12345678error_code = qiankun.data_int_combine(db_file_name, db_password, b"integer", None, intInt)if error_code != Qiankun_error_code.Qiankun_errorcode_success.value:print("data_combine error:", error_code)return# 读取刚写入的数据 read the data just writtenreturn_data = ctypes.c_int()error_code = qiankun.data_int_extract(db_file_name, db_password, b"integer", ctypes.byref(return_data))if error_code != Qiankun_error_code.Qiankun_errorcode_success.value:print("data_extract error:", error_code)returninteger = return_data.valueprint("get integer data: {}".format(integer))# 关闭数据库 close databaseerror_code = qiankun.db_close_database(db_file_name, db_password)if error_code != Qiankun_error_code.Qiankun_errorcode_success.value:print("db_close_database error:", error_code)returnprint("test done -------------------")if __name__ == '__main__':main()
java
package cn.camelsoft;import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;enum Qiankun_error_code {Qiankun_errorcode_success           (0x00000001),   ///<  正确的值Qiankun_errorcode_normal            (0x00000002),   ///<  错误的值Qiankun_errorcode_differ            (0x00000003),   ///<  数据库文件数效验未通过 (The number of database files fails to be verified)Qiankun_errorcode_no_rights         (0x00000004),   ///<  数据库密码效验未通过 (The database password verification failed)Qiankun_errorcode_db_not_exist      (0x00000005),   ///<  数据库文件不存在 (The database file does not exist)Qiankun_errorcode_exist             (0x00000006),   ///<  数据已存在 (Data already exists)Qiankun_errorcode_not_exist         (0x00000007),   ///<  数据不存在 (Data does not exist)Qiankun_errorcode_out_of_range      (0x00000008),   ///<  超出范围 (out of range)Qiankun_errorcode_type              (0x00000009),   ///<  类型不符 (wrong type)Qiankun_errorcode_param             (0x0000000A),   ///<  参数错误 (parameter error)Qiankun_errorcode_compress          (0x0000000B),   ///<  压缩错误 (compression error)Qiankun_errorcode_get_array         (0x0000000C),   ///<  数组错误 (arrary error)Qiankun_errorcode_out_of_memory     (0x0000000D),   ///<  内存溢出 (memory overflow)Qiankun_errorcode_handle            (0x0000000E),   ///<  句柄错误 (error handle)Qiankun_errorcode_io                (0x0000000F);   ///<  IO错误 (io error)private int value;Qiankun_error_code(int value) {this.value = value;}public int getValue() {return value;}
}public class Main {public interface tianzuo_QiankunLib extends Library {tianzuo_QiankunLib instance = (tianzuo_QiankunLib) Native.load("./tianzuo.Qiankun.dll", tianzuo_QiankunLib.class);Pointer tianzuo_QiankunInterface_initialize();void tianzuo_QiankunInterface_terminate(Pointer qiankun);int tianzuo_QiankunInt_initialize(Pointer qiankun);int tianzuo_QiankunInt_db_create_database(Pointer qiankun, String db_file_name, String db_password, String db_name, Boolean over_write);int tianzuo_QiankunInt_db_open_database(Pointer qiankun, String db_file_name, String db_password);int tianzuo_QiankunInt_db_close_database(Pointer qiankun, String db_file_name, String db_password);int tianzuo_QiankunInt_data_int_combine(Pointer qiankun, String db_file_name, String db_password, String data_name, String remark, int data);int tianzuo_QiankunInt_data_int_extract(Pointer qiankun, String db_file_name, String db_password, String data_name, int[] data);}public static void main(String[] args) {System.setProperty("jna.encoding","UTF-8");// 初始化接口 initialize the interfaceSystem.out.printf("initialize the interface\n");// 创建实例 create an instancePointer qiankun = tianzuo_QiankunLib.instance.tianzuo_QiankunInterface_initialize();int error_code = tianzuo_QiankunLib.instance.tianzuo_QiankunInt_initialize(qiankun);if (error_code != Qiankun_error_code.Qiankun_errorcode_success.getValue()) {System.out.printf("tianzuo_QiankunInt_initialize error: %d\n", error_code);return;}// 创建数据库 create databaseString db_file_name = "qiankunDataBase.Ztz";String db_password = "password";error_code = tianzuo_QiankunLib.instance.tianzuo_QiankunInt_db_create_database(qiankun, db_file_name, db_password, "qiankunDataBase", true);if (error_code != Qiankun_error_code.Qiankun_errorcode_success.getValue()) {System.out.printf("tianzuo_QiankunInt_db_create_database error: %d\n", error_code);return;}// 打开数据库 open databaseerror_code = tianzuo_QiankunLib.instance.tianzuo_QiankunInt_db_open_database(qiankun, db_file_name, db_password);if (error_code != Qiankun_error_code.Qiankun_errorcode_success.getValue()) {System.out.printf("tianzuo_QiankunInt_db_open_database error: %d\n", error_code);return;}// 向数据库写入一个整型数据 writes an integer to the databaseint intInt = 12345678;error_code = tianzuo_QiankunLib.instance.tianzuo_QiankunInt_data_int_combine(qiankun, db_file_name, db_password, "integer", "", intInt);if (error_code != Qiankun_error_code.Qiankun_errorcode_success.getValue()) {System.out.printf("tianzuo_QiankunInt_data_int_combine error: %d\n", error_code);return;}// 读取刚写入的数据 read the data just writtenint[] return_data = {0};error_code = tianzuo_QiankunLib.instance.tianzuo_QiankunInt_data_int_extract(qiankun, db_file_name, db_password, "integer", return_data);if (error_code != Qiankun_error_code.Qiankun_errorcode_success.getValue()) {System.out.printf("tianzuo_QiankunInt_data_int_extract error: %d\n", error_code);return;}System.out.printf("get int: %d\n", return_data[0]);// 关闭数据库 close databaseerror_code = tianzuo_QiankunLib.instance.tianzuo_QiankunInt_db_close_database(qiankun, db_file_name, db_password);if (error_code != Qiankun_error_code.Qiankun_errorcode_success.getValue()) {System.out.printf("tianzuo_QiankunInt_db_close_database error: %d\n", error_code);return;}System.out.printf("test done -------------------\n");tianzuo_QiankunLib.instance.tianzuo_QiankunInterface_terminate(qiankun);}
}
csharp
using System.Runtime.InteropServices;public enum Qiankun_error_code
{Qiankun_errorcode_success       = 0x00000001,              ///<  正确的值Qiankun_errorcode_normal        = 0x00000002,              ///<  错误的值Qiankun_errorcode_differ        = 0x00000003,              ///<  数据库文件数效验未通过 (The number of database files fails to be verified)Qiankun_errorcode_no_rights     = 0x00000004,              ///<  数据库密码效验未通过 (The database password verification failed)Qiankun_errorcode_db_not_exist  = 0x00000005,              ///<  数据库文件不存在 (The database file does not exist)Qiankun_errorcode_exist         = 0x00000006,              ///<  数据已存在 (Data already exists)Qiankun_errorcode_not_exist     = 0x00000007,              ///<  数据不存在 (Data does not exist)Qiankun_errorcode_out_of_range  = 0x00000008,              ///<  超出范围 (out of range)Qiankun_errorcode_type          = 0x00000009,              ///<  类型不符 (wrong type)Qiankun_errorcode_param         = 0x0000000A,              ///<  参数错误 (parameter error)Qiankun_errorcode_compress      = 0x0000000B,              ///<  压缩错误 (compression error)Qiankun_errorcode_get_array     = 0x0000000C,              ///<  数组错误 (arrary error)Qiankun_errorcode_out_of_memory = 0x0000000D,              ///<  内存溢出 (memory overflow)Qiankun_errorcode_handle        = 0x0000000E,              ///<  句柄错误 (error handle)Qiankun_errorcode_io            = 0x0000000F,              ///<  IO错误 (io error)
}class Program {[DllImport("tianzuo.Qiankun.dll")]public static extern IntPtr tianzuo_QiankunInterface_initialize();[DllImport("tianzuo.Qiankun.dll")]public static extern void tianzuo_QiankunInterface_terminate(IntPtr qiankun);[DllImport("tianzuo.Qiankun.dll")]public static extern int tianzuo_QiankunInt_initialize(IntPtr qiankun);[DllImport("tianzuo.Qiankun.dll")]public static extern int tianzuo_QiankunInt_db_create_database(IntPtr qiankun, string db_file_name, string db_password, string db_name, bool over_write);[DllImport("tianzuo.Qiankun.dll")]public static extern int tianzuo_QiankunInt_db_open_database(IntPtr qiankun, string db_file_name, string db_password);[DllImport("tianzuo.Qiankun.dll")]public static extern int tianzuo_QiankunInt_db_close_database(IntPtr qiankun, string db_file_name, string db_password);[DllImport("tianzuo.Qiankun.dll")]public static extern int tianzuo_QiankunInt_data_int_combine(IntPtr qiankun, string db_file_name, string db_password, string data_name, string remark, int data);[DllImport("tianzuo.Qiankun.dll")]public static extern int tianzuo_QiankunInt_data_int_extract(IntPtr qiankun, string db_file_name, string db_password, string data_name, ref int data);static void Main(string[] args) {// 初始化接口 initialize the interfaceConsole.WriteLine("initialize the interface\n");// 创建实例 create an instanceIntPtr qiankun = tianzuo_QiankunInterface_initialize();int error_code = tianzuo_QiankunInt_initialize(qiankun);if (error_code != ((int)Qiankun_error_code.Qiankun_errorcode_success)){Console.WriteLine("tianzuo_QiankunInt_initialize error:" + error_code);return;}// 创建数据库 create databasestring db_file_name = "qiankunDataBase.Ztz";string db_password = "password";error_code = tianzuo_QiankunInt_db_create_database(qiankun, db_file_name, db_password, "qiankunDataBase", true);if (error_code != ((int)Qiankun_error_code.Qiankun_errorcode_success)){Console.WriteLine("tianzuo_QiankunInt_db_create_database error:" + error_code);return;}// 打开数据库 open databaseerror_code = tianzuo_QiankunInt_db_open_database(qiankun, db_file_name, db_password);if (error_code != ((int)Qiankun_error_code.Qiankun_errorcode_success)) {Console.WriteLine("tianzuo_QiankunInt_db_open_database error:" + error_code);return;}// 向数据库写入一个整型数据 writes an integer to the databaseint intInt = 12345678;error_code = tianzuo_QiankunInt_data_int_combine(qiankun, db_file_name, db_password, "integer", "", intInt);if (error_code != ((int)Qiankun_error_code.Qiankun_errorcode_success)){Console.WriteLine("tianzuo_QiankunInt_data_int_combine error:" + error_code);return;}// 读取刚写入的数据 read the data just writtenint return_data = 0;error_code = tianzuo_QiankunInt_data_int_extract(qiankun, db_file_name, db_password, "integer", ref return_data);if (error_code != ((int)Qiankun_error_code.Qiankun_errorcode_success)){Console.WriteLine("tianzuo_QiankunInt_data_int_extract error:" + error_code);return;}Console.WriteLine("get int: " + return_data);// 关闭数据库 close databaseerror_code = tianzuo_QiankunInt_db_close_database(qiankun, db_file_name, db_password);if (error_code != ((int)Qiankun_error_code.Qiankun_errorcode_success)){Console.WriteLine("tianzuo_QiankunInt_db_close_database error:" + error_code);return;}Console.WriteLine("test done -------------------\n");tianzuo_QiankunInterface_terminate(qiankun);}}
javascript

Qiankun_errorcode_success           = 0x00000001;   ///<  正确的值
Qiankun_errorcode_normal            = 0x00000002;   ///<  错误的值
Qiankun_errorcode_differ            = 0x00000003;   ///<  数据库文件数效验未通过 (The number of database files fails to be verified)
Qiankun_errorcode_no_rights         = 0x00000004;   ///<  数据库密码效验未通过 (The database password verification failed)
Qiankun_errorcode_db_not_exist      = 0x00000005;   ///<  数据库文件不存在 (The database file does not exist)
Qiankun_errorcode_exist             = 0x00000006;   ///<  数据已存在 (Data already exists)
Qiankun_errorcode_not_exist         = 0x00000007;   ///<  数据不存在 (Data does not exist)
Qiankun_errorcode_out_of_range      = 0x00000008;   ///<  超出范围 (out of range)
Qiankun_errorcode_type              = 0x00000009;   ///<  类型不符 (wrong type)
Qiankun_errorcode_param             = 0x0000000A;   ///<  参数错误 (parameter error)
Qiankun_errorcode_compress          = 0x0000000B;   ///<  压缩错误 (compression error)
Qiankun_errorcode_get_array         = 0x0000000C;   ///<  数组错误 (arrary error)
Qiankun_errorcode_out_of_memory     = 0x0000000D;   ///<  内存溢出 (memory overflow)
Qiankun_errorcode_handle            = 0x0000000E;   ///<  句柄错误 (error handle)
Qiankun_errorcode_io                = 0x0000000F;   ///<  IO错误 (io error)let ffi = require('ffi-napi')
const ref = require('ref-napi');let tianzuo_QiankunLib = ffi.Library("tianzuo.Qiankun.dll", {'tianzuo_QiankunInterface_initialize': ['pointer', []],'tianzuo_QiankunInterface_terminate':['void',['pointer']],'tianzuo_QiankunInt_initialize':['int',['pointer']],'tianzuo_QiankunInt_db_create_database':['int',['pointer','string','string','string', 'bool']],'tianzuo_QiankunInt_db_open_database':['int',['pointer', 'string', 'string']],'tianzuo_QiankunInt_db_close_database':['int',['pointer', 'string', 'string']],'tianzuo_QiankunInt_data_int_combine':['int',['pointer','string','string','string', 'string', 'int']],'tianzuo_QiankunInt_data_int_extract':['int',['pointer','string','string','string', 'pointer']],
})// 初始化接口 initialize the interface
console.log("initialize the interface\n");// 创建实例 create an instance
let qiankun = tianzuo_QiankunLib.tianzuo_QiankunInterface_initialize();
let error_code = tianzuo_QiankunLib.tianzuo_QiankunInt_initialize(qiankun);
if (error_code !== Qiankun_errorcode_success) {console.log("tianzuo_QiankunInt_initialize error: %d\n", error_code);return;
}// 创建数据库 create database
let db_file_name = "qiankunDataBase.Ztz";
let db_password = "password";
error_code = tianzuo_QiankunLib.tianzuo_QiankunInt_db_create_database(qiankun, db_file_name, db_password, "qiankunDataBase", true);
if (error_code !== Qiankun_errorcode_success) {console.log("tianzuo_QiankunInt_db_create_database error: %d\n", error_code);return;
}// 打开数据库 open database
error_code = tianzuo_QiankunLib.tianzuo_QiankunInt_db_open_database(qiankun, db_file_name, db_password);
if (error_code !== Qiankun_errorcode_success) {console.log("tianzuo_QiankunInt_db_open_database error: %d\n", error_code);return;
}// 向数据库写入一个整型数据 writes an integer to the database
let intInt = 12345678;
error_code = tianzuo_QiankunLib.tianzuo_QiankunInt_data_int_combine(qiankun, db_file_name, db_password, "integer", "", intInt);
if (error_code !== Qiankun_errorcode_success) {console.log("tianzuo_QiankunInt_data_int_combine error: %d\n", error_code);return;
}// 读取刚写入的数据 read the data just written
return_buf = Buffer.alloc(1 * ref.sizeof.int);
error_code = tianzuo_QiankunLib.tianzuo_QiankunInt_data_int_extract(qiankun, db_file_name, db_password, "integer", return_buf);
if (error_code !== Qiankun_errorcode_success) {console.log("tianzuo_QiankunInt_data_int_extract error: %d\n", error_code);return;
}return_data = ref.get(return_buf, 0, ref.types.int);
console.log("get int: %d\n", return_data);// 关闭数据库 close database
error_code = tianzuo_QiankunLib.tianzuo_QiankunInt_db_close_database(qiankun, db_file_name, db_password);
if (error_code !== Qiankun_errorcode_success) {console.log("tianzuo_QiankunInt_db_close_database error: %d\n", error_code);return;
}console.log("test done -------------------\n");tianzuo_QiankunLib.tianzuo_QiankunInterface_terminate(qiankun);
php
<?php// 检查是否加载了 FFI 扩展
if (extension_loaded('ffi')) {echo("已启用 FFI 扩展\n");
} else {die("未启动 FFI 扩展\n");
}enum Qiankun_error_code
{
const Qiankun_errorcode_success       = 0x00000001;            ///<  正确的值
const Qiankun_errorcode_normal        = 0x00000002;            ///<  错误的值
const Qiankun_errorcode_differ        = 0x00000003;            ///<  数据库文件数效验未通过 (The number of database files fails to be verified)
const Qiankun_errorcode_no_rights     = 0x00000004;            ///<  数据库密码效验未通过 (The database password verification failed)
const Qiankun_errorcode_db_not_exist  = 0x00000005;            ///<  数据库文件不存在 (The database file does not exist)
const Qiankun_errorcode_exist         = 0x00000006;            ///<  数据已存在 (Data already exists)
const Qiankun_errorcode_not_exist     = 0x00000007;            ///<  数据不存在 (Data does not exist)
const Qiankun_errorcode_out_of_range  = 0x00000008;            ///<  超出范围 (out of range)
const Qiankun_errorcode_type          = 0x00000009;            ///<  类型不符 (wrong type)
const Qiankun_errorcode_param         = 0x0000000A;            ///<  参数错误 (parameter error)
const Qiankun_errorcode_compress      = 0x0000000B;            ///<  压缩错误 (compression error)
const Qiankun_errorcode_get_array     = 0x0000000C;            ///<  数组错误 (arrary error)
const Qiankun_errorcode_out_of_memory = 0x0000000D;            ///<  内存溢出 (memory overflow)
const Qiankun_errorcode_handle        = 0x0000000E;            ///<  句柄错误 (error handle)
const Qiankun_errorcode_io            = 0x0000000F;            ///<  IO错误 (io error)
}$ffi = FFI::cdef("void* tianzuo_QiankunInterface_initialize();void tianzuo_QiankunInterface_terminate(void* *QiankunInt_pointer);int tianzuo_QiankunInt_initialize(void* QiankunInt_pointer);int tianzuo_QiankunInt_db_create_database(void* QiankunInt_pointer, const char* db_file_name, const char* db_password, const char* db_name, bool const over_write);int tianzuo_QiankunInt_db_open_database(void* QiankunInt_pointer, const char* db_file_name, const char* db_password);int tianzuo_QiankunInt_db_close_database(void* QiankunInt_pointer, const char* db_file_name, const char* db_password);int tianzuo_QiankunInt_data_int_combine(void* QiankunInt_pointer, const char* db_file_name, const char* db_password, const char* data_name, const char* remark, int data);int tianzuo_QiankunInt_data_int_extract(void* QiankunInt_pointer, const char* db_file_name, const char* db_password, const char* data_name, int* data);
", "tianzuo.Qiankun.dll");# 初始化接口 initialize the interface
echo "initialize the interface" . "\n";# 创建实例 create an instance
$qiankun = $ffi->tianzuo_QiankunInterface_initialize();$error_code = $ffi->tianzuo_QiankunInt_initialize($qiankun);
if ($error_code != Qiankun_error_code::Qiankun_errorcode_success) {echo "initialize error: " . $error_code . "\n";return;
}# 创建数据库 create database
$db_file_name = "qiankunDataBase.Ztz";
$db_password = "password";
$error_code = $ffi->tianzuo_QiankunInt_db_create_database($qiankun, $db_file_name, $db_password, "qiankunDataBase", true);
if ($error_code != Qiankun_error_code::Qiankun_errorcode_success) {echo "tianzuo_QiankunInt_db_create_database error: " . $error_code . "\n";return;
}# 打开数据库 open database
$error_code = $ffi->tianzuo_QiankunInt_db_open_database($qiankun, $db_file_name, $db_password);
if ($error_code != Qiankun_error_code::Qiankun_errorcode_success) {echo "tianzuo_QiankunInt_db_open_database error: " . $error_code . "\n";return;
}# 向数据库写入一个整型数据 writes an integer to the database
$intInt = 12345678;
$error_code = $ffi->tianzuo_QiankunInt_data_int_combine($qiankun, $db_file_name, $db_password, "integer", "", $intInt);
if ($error_code != Qiankun_error_code::Qiankun_errorcode_success) {echo "tianzuo_QiankunInt_data_int_combine error: " . $error_code . "\n";return;
}# 读取刚写入的数据 read the data just written
$return_data = FFI::new("int");
$error_code = $ffi->tianzuo_QiankunInt_data_int_extract($qiankun, $db_file_name, $db_password, "integer", FFI::addr($return_data));
if ($error_code != Qiankun_error_code::Qiankun_errorcode_success) {echo "tianzuo_QiankunInt_data_int_extract error: " . $error_code . "\n";return;
}echo "get integer data: " . $return_data->cdata . "\n";# 关闭数据库 close database
$error_code = $ffi->tianzuo_QiankunInt_db_close_database($qiankun, $db_file_name, $db_password);
if ($error_code != Qiankun_error_code::Qiankun_errorcode_success) {echo "tianzuo_QiankunInt_db_close_database error: " . $error_code . "\n";return;
}echo "test done -------------------" . "\n";?>
vb

Imports System.Runtime.InteropServicesEnum Qiankun_error_codeQiankun_errorcode_success = 1                     '  正确的值Qiankun_errorcode_normal = 2                      '  错误的值Qiankun_errorcode_differ = 3                      '  数据库文件数效验未通过 (The number Of database files fails To be verified)Qiankun_errorcode_no_rights = 4                   '  数据库密码效验未通过 (The database password verification failed)Qiankun_errorcode_db_not_exist = 5                '  数据库文件不存在 (The database file does Not exist)Qiankun_errorcode_exist = 6                       '  数据已存在 (Data already exists)Qiankun_errorcode_not_exist = 7                   '  数据不存在 (Data does Not exist)Qiankun_errorcode_out_of_range = 8                '  超出范围 (out Of range)Qiankun_errorcode_type = 9                        '  类型不符 (wrong type)Qiankun_errorcode_param = 10                      '  参数错误 (parameter Error)Qiankun_errorcode_compress = 11                   '  压缩错误 (compression Error)Qiankun_errorcode_get_array = 12                  '  数组错误 (arrary Error)Qiankun_errorcode_out_of_memory = 13              '  内存溢出 (memory overflow)Qiankun_errorcode_handle = 14                     '  句柄错误 (Error handle)Qiankun_errorcode_io = 15                         '  IO错误 (io Error)
End EnumModule Program<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInterface_initialize() As IntPtrEnd Function<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInterface_terminate(ByRef QiankunInt_pointer As IntPtr)End Function<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInt_initialize(QiankunInt_pointer As IntPtr) As IntegerEnd Function<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInt_db_create_database(QiankunInt_pointer As IntPtr, db_file_name As String, db_password As String, db_name As String, over_write As Boolean) As IntegerEnd Function<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInt_db_open_database(QiankunInt_pointer As IntPtr, db_file_name As String, db_password As String) As IntegerEnd Function<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInt_db_close_database(QiankunInt_pointer As IntPtr, db_file_name As String, db_password As String) As IntegerEnd Function<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInt_data_int_combine(QiankunInt_pointer As IntPtr, db_file_name As String, db_password As String, data_name As String, remark As String, data As Integer) As IntegerEnd Function<DllImport("tianzuo.Qiankun.dll")>Public Function tianzuo_QiankunInt_data_int_extract(QiankunInt_pointer As IntPtr, db_file_name As String, db_password As String, data_name As String, ByRef data As Integer) As IntegerEnd FunctionSub Main(args As String())' 初始化接口 initialize the interfaceConsole.WriteLine("initialize the interface")' 创建实例 create an instanceDim qiankun As IntPtr = tianzuo_QiankunInterface_initialize()Dim error_code As Integer = tianzuo_QiankunInt_initialize(qiankun)If (error_code <> Qiankun_error_code.Qiankun_errorcode_success) ThenConsole.WriteLine("tianzuo_QiankunInt_initialize error:" + error_code.ToString)ReturnEnd If' 创建数据库 create databaseDim db_file_name As String = "qiankunDataBase.Ztz"Dim db_password As String = "password"error_code = tianzuo_QiankunInt_db_create_database(qiankun, db_file_name, db_password, "qiankunDataBase", True)If (error_code <> Qiankun_error_code.Qiankun_errorcode_success) ThenConsole.WriteLine("tianzuo_QiankunInt_db_create_database error:" + error_code.ToString)ReturnEnd If' 打开数据库 open databaseerror_code = tianzuo_QiankunInt_db_open_database(qiankun, db_file_name, db_password)If (error_code <> Qiankun_error_code.Qiankun_errorcode_success) ThenConsole.WriteLine("tianzuo_QiankunInt_db_open_database error:" + error_code.ToString)ReturnEnd If' 向数据库写入一个整型数据 writes an integer to the databaseDim intInt As Integer = 12345678error_code = tianzuo_QiankunInt_data_int_combine(qiankun, db_file_name, db_password, "integer", "", intInt)If (error_code <> Qiankun_error_code.Qiankun_errorcode_success) ThenConsole.WriteLine("tianzuo_QiankunInt_data_int_combine error:" + error_code.ToString)ReturnEnd If' 读取刚写入的数据 read the data just writtenDim return_data As Integer = 0error_code = tianzuo_QiankunInt_data_int_extract(qiankun, db_file_name, db_password, "integer", return_data)If (error_code <> Qiankun_error_code.Qiankun_errorcode_success) ThenConsole.WriteLine("tianzuo_QiankunInt_data_int_extract error:" + error_code.ToString)ReturnEnd IfConsole.WriteLine("get int: " + return_data.ToString)' 关闭数据库 close databaseerror_code = tianzuo_QiankunInt_db_close_database(qiankun, db_file_name, db_password)If (error_code <> Qiankun_error_code.Qiankun_errorcode_success) ThenConsole.WriteLine("tianzuo_QiankunInt_db_close_database error:" + error_code.ToString)ReturnEnd IfConsole.WriteLine("test done -------------------")End Sub
End Module
go
package main/*
#include "tianzuo.QiankunInterface.h"
*/
import "C"
import ("fmt""syscall""unsafe"
)const (Qiankun_errorcode_success       = 1  //  正确的值Qiankun_errorcode_normal        = 2  //  错误的值Qiankun_errorcode_differ        = 3  //  数据库文件数效验未通过 (The number Of database files fails To be verified)Qiankun_errorcode_no_rights     = 4  //  数据库密码效验未通过 (The database password verification failed)Qiankun_errorcode_db_not_exist  = 5  //  数据库文件不存在 (The database file does Not exist)Qiankun_errorcode_exist         = 6  //  数据已存在 (Data already exists)Qiankun_errorcode_not_exist     = 7  //  数据不存在 (Data does Not exist)Qiankun_errorcode_out_of_range  = 8  //  超出范围 (out Of range)Qiankun_errorcode_type          = 9  //  类型不符 (wrong type)Qiankun_errorcode_param         = 10 //  参数错误 (parameter Error)Qiankun_errorcode_compress      = 11 //  压缩错误 (compression Error)Qiankun_errorcode_get_array     = 12 //  数组错误 (arrary Error)Qiankun_errorcode_out_of_memory = 13 //  内存溢出 (memory overflow)Qiankun_errorcode_handle        = 14 //  句柄错误 (Error handle)Qiankun_errorcode_io            = 15 //  IO错误 (io Error)
)func main() {// 初始化接口 initialize the interfacedll := syscall.MustLoadDLL("tianzuo.Qiankun.dll")// 创建实例 create an instancetianzuo_QiankunInterface_initialize := dll.MustFindProc("tianzuo_QiankunInterface_initialize")qiankun, _, _ := tianzuo_QiankunInterface_initialize.Call()tianzuo_QiankunInt_initialize := dll.MustFindProc("tianzuo_QiankunInt_initialize")error_code, _, _ := tianzuo_QiankunInt_initialize.Call(qiankun)if error_code != Qiankun_errorcode_success {fmt.Println("tianzuo_QiankunInt_initialize error: ", error_code)}// 创建数据库 create databasedb_file_name := C.CString("qiankunDataBase.Ztz")db_password := C.CString("password")tianzuo_QiankunInt_db_create_database := dll.MustFindProc("tianzuo_QiankunInt_db_create_database")error_code, _, _ = tianzuo_QiankunInt_db_create_database.Call(qiankun, uintptr(unsafe.Pointer(db_file_name)), uintptr(unsafe.Pointer(db_password)), uintptr(unsafe.Pointer(C.CString("qiankunDataBase"))), 1)if error_code != Qiankun_errorcode_success {fmt.Println("tianzuo_QiankunInt_db_create_database error: ", error_code)}// 打开数据库 open databasetianzuo_QiankunInt_db_open_database := dll.MustFindProc("tianzuo_QiankunInt_db_open_database")error_code, _, _ = tianzuo_QiankunInt_db_open_database.Call(qiankun, uintptr(unsafe.Pointer(db_file_name)), uintptr(unsafe.Pointer(db_password)))if error_code != Qiankun_errorcode_success {fmt.Println("tianzuo_QiankunInt_db_open_database error: ", error_code)}// 向数据库写入一个整型数据 writes an integer to the databaseintInt := C.int(12345678)tianzuo_QiankunInt_data_int_combine := dll.MustFindProc("tianzuo_QiankunInt_data_int_combine")error_code, _, _ = tianzuo_QiankunInt_data_int_combine.Call(qiankun, uintptr(unsafe.Pointer(db_file_name)), uintptr(unsafe.Pointer(db_password)), uintptr(unsafe.Pointer(C.CString("integer"))), uintptr(unsafe.Pointer(C.CString(""))), uintptr(intInt))if error_code != Qiankun_errorcode_success {fmt.Println("tianzuo_QiankunInt_data_int_combine error: ", error_code)}// 读取刚写入的数据 read the data just writtenreturn_int := C.int(0)tianzuo_QiankunInt_data_int_extract := dll.MustFindProc("tianzuo_QiankunInt_data_int_extract")error_code, _, _ = tianzuo_QiankunInt_data_int_extract.Call(qiankun, uintptr(unsafe.Pointer(db_file_name)), uintptr(unsafe.Pointer(db_password)), uintptr(unsafe.Pointer(C.CString("integer"))), uintptr(unsafe.Pointer(&return_int)))if error_code != Qiankun_errorcode_success {fmt.Println("tianzuo_QiankunInt_data_int_extract error: ", error_code)}fmt.Println("get integer data: ", return_int)// 关闭数据库 close databasetianzuo_QiankunInt_db_close_database := dll.MustFindProc("tianzuo_QiankunInt_db_close_database")error_code, _, _ = tianzuo_QiankunInt_db_close_database.Call(qiankun, uintptr(unsafe.Pointer(db_file_name)), uintptr(unsafe.Pointer(db_password)))if error_code != Qiankun_errorcode_success {fmt.Println("tianzuo_QiankunInt_db_close_database error: ", error_code)}fmt.Println("test done -------------------")
}
rust

use std::os::raw::c_char;
use std::ffi::{c_int};
use std::ffi::CString;
use std::ptr::null;#[link(name = "tianzuo.Qiankun")]
extern {fn tianzuo_QiankunInterface_initialize() -> *mut std::ffi::c_void;fn tianzuo_QiankunInterface_terminate(obj: *mut std::ffi::c_void);fn tianzuo_QiankunInt_initialize(obj: *mut std::ffi::c_void) -> c_int;fn tianzuo_QiankunInt_db_create_database(obj: *mut std::ffi::c_void, db_file_name: *const c_char, db_password: *const c_char, db_name: *const c_char, over_write: c_int) -> c_int;fn tianzuo_QiankunInt_db_open_database(obj: *mut std::ffi::c_void, db_file_name: *const c_char, db_password: *const c_char) -> c_int;fn tianzuo_QiankunInt_db_close_database(obj: *mut std::ffi::c_void, db_file_name: *const c_char, db_password: *const c_char) -> c_int;fn tianzuo_QiankunInt_data_int_combine(obj: *mut std::ffi::c_void, db_file_name: *const c_char, db_password: *const c_char, data_name: *const c_char, remark: *const c_char, data: c_int) -> c_int;fn tianzuo_QiankunInt_data_int_extract(obj: *mut std::ffi::c_void, db_file_name: *const c_char, db_password: *const c_char, data_name: *const c_char, data: *const c_int) -> c_int;
}fn main() {unsafe {// 初始化接口 initialize the interfaceprintln!("initialize the interface");// 创建实例 create an instancelet qiankun = tianzuo_QiankunInterface_initialize();let error_code = tianzuo_QiankunInt_initialize(qiankun);if 1 != error_code {println!("initialize error: {:?}", error_code);}// 创建数据库 create databaselet db_file_name = CString::new(String::from("qiankunDataBase.Ztz")).expect("Failed to create CString");let db_password = CString::new(String::from("password")).expect("Failed to create CString");let db_name = CString::new(String::from("qiankunDataBase")).expect("Failed to create CString");let error_code = tianzuo_QiankunInt_db_create_database(qiankun, db_file_name.as_ptr(), db_password.as_ptr(), db_name.as_ptr(), 1);if 1 != error_code {println!("db_create_database error: {:?}", error_code);}// 打开数据库 open databaselet error_code = tianzuo_QiankunInt_db_open_database(qiankun, db_file_name.as_ptr(), db_password.as_ptr());if 1 != error_code {println!("db_open_database error: {:?}", error_code);}// 向数据库写入一个整型数据 writes an integer to the databaselet int = 12345678;let data_name = CString::new(String::from("integer")).expect("Failed to create CString");let error_code = tianzuo_QiankunInt_data_int_combine(qiankun, db_file_name.as_ptr(), db_password.as_ptr(), data_name.as_ptr(), null(), int);if 1 != error_code {println!("data_combine error: {:?}", error_code);}// 读取刚写入的数据 read the data just writtenlet mut return_data: c_int = 0;let error_code = tianzuo_QiankunInt_data_int_extract(qiankun, db_file_name.as_ptr(), db_password.as_ptr(), data_name.as_ptr(), &mut return_data);if 1 != error_code {println!("data_extract error: {:?}", error_code);}println!("get integer data: {:?}", return_data);// 关闭数据库 close databaselet error_code = tianzuo_QiankunInt_db_close_database(qiankun, db_file_name.as_ptr(), db_password.as_ptr());if 1 != error_code {println!("db_close_database error: {:?}", error_code);}println!("test done -------------------")}
}
ruby
require 'fiddle'lib = Fiddle::dlopen('C:/Users/zhengtianzuo/RubymineProjects/tianzuo.QiankunTest/tianzuo.Qiankun.dll')
tianzuo_QiankunInterface_initialize = Fiddle::Function.new(lib['tianzuo_QiankunInterface_initialize'], [], Fiddle::TYPE_VOIDP)
tianzuo_QiankunInterface_terminate = Fiddle::Function.new(lib['tianzuo_QiankunInterface_terminate'], [Fiddle::TYPE_VOIDP], Fiddle::TYPE_VOID)
tianzuo_QiankunInt_initialize = Fiddle::Function.new(lib['tianzuo_QiankunInt_initialize'], [Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT)
tianzuo_QiankunInt_db_create_database = Fiddle::Function.new(lib['tianzuo_QiankunInt_db_create_database'], [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_INT], Fiddle::TYPE_INT)
tianzuo_QiankunInt_db_open_database = Fiddle::Function.new(lib['tianzuo_QiankunInt_db_open_database'], [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT)
tianzuo_QiankunInt_data_int_combine = Fiddle::Function.new(lib['tianzuo_QiankunInt_data_int_combine'], [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_INT], Fiddle::TYPE_INT)
tianzuo_QiankunInt_data_int_extract = Fiddle::Function.new(lib['tianzuo_QiankunInt_data_int_extract'], [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT)
tianzuo_QiankunInt_db_close_database = Fiddle::Function.new(lib['tianzuo_QiankunInt_db_close_database'], [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP], Fiddle::TYPE_INT)# 初始化接口 initialize the interface
print("initialize the interface\n")# 创建实例 create an instance
qiankun = tianzuo_QiankunInterface_initialize.call()
error_code = tianzuo_QiankunInt_initialize.call(qiankun)
if error_code != 1print("initialize error:", error_code, "\n")return
end# 创建数据库 create database
db_file_name = "qiankunDataBase.Ztz"
db_password = "password"
error_code = tianzuo_QiankunInt_db_create_database.call(qiankun, db_file_name, db_password, "qiankunDataBase", 1)
if error_code != 1print("db_create_database error:", error_code, "\n")return
end# 打开数据库 open database
error_code = tianzuo_QiankunInt_db_open_database.call(qiankun, db_file_name, db_password)
if error_code != 1print("db_open_database error:", error_code, "\n")
return
end# 向数据库写入一个整型数据 writes an integer to the database
intInt = 12345678
error_code = tianzuo_QiankunInt_data_int_combine.call(qiankun, db_file_name, db_password, "integer", "", intInt)
if error_code != 1print("data_combine error:", error_code, "\n")
return
end# 读取刚写入的数据 read the data just written
return_data = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INT)
error_code = tianzuo_QiankunInt_data_int_extract.call(qiankun, db_file_name, db_password, "integer", return_data)
if error_code != 1print("data_extract error:", error_code, "\n")
return
endinteger = return_data[0, Fiddle::SIZEOF_INT].unpack('I')[0]
print("get integer data: ", integer, "\n")# 关闭数据库 close database
error_code = tianzuo_QiankunInt_db_close_database.call(qiankun, db_file_name, db_password)
if error_code != 1print("db_close_database error:", error_code)
return
endprint("test done -------------------")

下载

https://github.com/zhengtianzuo/tianzuo.Qiankun/releaseshttps://gitee.com/zhengtianzuo/tianzuo.Qiankun/releaseshttps://pan.baidu.com/s/1ecnWXCHtFUT0edNqCLwFbQ?pwd=1234https://share.weiyun.com/TVxOYtJr
作者郑天佐
邮箱zhengtianzuo06@163.com
主页http://www.zhengtianzuo.com
githubhttps://github.com/zhengtianzuo

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/25869.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【前端基础】Day 5 CSS浮动

目录 1. 浮动 1.1 标准流&#xff08;普通流/文档流&#xff09; 1.2 浮动 1.2.1 浮动的特性 1.2.2 浮动元素常和标准流父级搭配使用 1.2.3 案例 2. 常见网页布局 2.1 常见网页布局 2.2 浮动布局注意点 3. 清除浮动 3.1 原因 3.2 清除浮动的本质 3.3 清除浮动的方…

硬编码(三)经典变长指令一

我们在前两节的硬编码中学习了定长指令&#xff0c;接下来学习变长指令 对于定长指令&#xff0c;我们通过opcode便可知该指令的长度&#xff0c;但是对于变长指令却是不可知的。变长指令长度由opcode&#xff0c;ModR/M&#xff0c;SIB共同决定。变长指令通常在需要操作内存的…

【免费】YOLO[笑容]目标检测全过程(yolo环境配置+labelimg数据集标注+目标检测训练测试)

一、yolo环境配置 这篇帖子是我试过的&#xff0c;非常全&#xff0c;很详细【cudaanacondapytorchyolo(ultralytics)】 yolo环境配置 二、labelimg数据集标注 可以参考下面的帖子&#xff0c;不过可能会出现闪退的问题&#xff0c;安装我的流程来吧 2.1 labelimg安装 label…

Cursor配置MCP Server

一、什么是MCP MCP&#xff08;Model Context Protocol&#xff09;是由 Anthropic&#xff08; Claude 的那个公司&#xff09; 推出的开放标准协议&#xff0c;它为开发者提供了一个强大的工具&#xff0c;能够在数据源和 AI 驱动工具之间建立安全的双向连接。 举个好理解…

【开源免费】基于SpringBoot+Vue.JS新闻资讯系统(JAVA毕业设计)

本文项目编号 T 220 &#xff0c;文末自助获取源码 \color{red}{T220&#xff0c;文末自助获取源码} T220&#xff0c;文末自助获取源码 目录 一、系统介绍二、数据库设计三、配套教程3.1 启动教程3.2 讲解视频3.3 二次开发教程 四、功能截图五、文案资料5.1 选题背景5.2 国内…

CSDN年度评选揭晓,永洪科技AI技术与智能应用双星闪耀

近日&#xff0c;永洪科技在CSDN&#xff08;中国专业开发者社区&#xff09;的年度评选中&#xff0c;凭借在人工智能技术创新与vividime在行业应用中的卓越表现&#xff0c;一举斩获“人工智能企业”及“智能应用”双料大奖。这一荣誉不仅彰显了永洪科技在AI领域的领先地位&a…

利用three.js在Vue项目中展示重构的stl模型文件

一、目的 为了在前端页面展示3d打印机打印过程 二、前期准备 完整模型的stl文件和模型切割成的n个stl文件 models文件夹下的文件就是切割后的stl文件 三、代码 <template><div ref"threeContainer" class"three-container"></div><…

自动驾驶两个传感器之间的坐标系转换

有两种方式可以实现两个坐标系的转换。 车身坐标系下一个点p_car&#xff0c;需要转换到相机坐标系下&#xff0c;旋转矩阵R_car2Cam&#xff0c;平移矩阵T_car2Cam。点p_car在相机坐标系下记p_cam. 方法1&#xff1a;先旋转再平移 p_cam T_car2Cam * p_car T_car2Cam 需要注…

【卡牌——二分】

题目 分析 发现答案具有二分性&#xff0c;果断二分答案 代码 #include <bits/stdc.h> using namespace std; using ll long long;const int N 2e510;int n, a[N], li[N]; ll m;bool check(int x) {ll t m;for(int i 1; i < n; i){if(a[i] > x) continue; //…

< 自用文儿 > Gobuster 暴力扫描工具与 SecLists 安全测试词表集合

Ethice 道德问题 GFW 的保护下&#xff0c;很多的设备操作系统是停留在更老的版本&#xff0c;应用软件也是&#xff0c;因此很多的漏洞没有被修复。通讯没有使用加密&#xff0c;例如网页没有使用 HTTPS 网站很多。几乎是半裸的在网络上等着被食。 不做恶是下限。 环境&…

java后端开发day23--面向对象进阶(四)--抽象类、接口、内部类

&#xff08;以下内容全部来自上述课程&#xff09; 1.抽象类 父类定义抽象方法后&#xff0c;子类的方法就必须重写&#xff0c;抽象方法在的类就是抽象类。 1.定义 抽象方法 将共性的行为&#xff08;方法&#xff09;抽取到父类之后。由于每一个子类执行的内容是不一样…

AI数据分析:用DeepSeek做数据清洗

在当今数据驱动的时代&#xff0c;数据分析已成为企业和个人决策的重要工具。随着人工智能技术的快速发展&#xff0c;AI 驱动的数据分析工具正在改变我们处理和分析数据的方式。本文将着重介绍如何使用 DeepSeek 进行数据清洗。 数据清洗是数据分析的基础&#xff0c;其目的是…

第2_3章_入门管理资源服务器

入门 对于某些应用程序&#xff0c;你可以参考以下资源&#xff0c;快速开始使用 Keycloak 授权服务&#xff1a; 在 Wildfly 中保护 JakartaEE 应用程序&#xff08;https://github.com/keycloak/keycloak-quickstarts/tree/latest/jakarta/servlet-authz-client&#xff09…

2025年如何实现安卓、iOS、鸿蒙跨平台开发

2025年如何实现安卓、iOS、鸿蒙跨平台开发 文章目录 2025年如何实现安卓、iOS、鸿蒙跨平台开发1. 使用统一开发框架2. 华为官方工具链支持3. 代码适配策略4. 生态兼容性处理5. 性能与体验优化总结&#xff1a;方案选择建议 本文首发地址 https://h89.cn/archives/324.html 最新…

Azure Speech

1、文字转语音(Text-To-Speech, TTS) 2、语音转文字(Speech-To-Text): Azure Speech to Text 1- 环境配置&#xff1a;Microsoft Azure 注册使用免费服务&#xff1a; 需要信用卡&#xff0c;本人没有&#xff0c;所以没有完成注册

Cursor AI编程-详细教程

一点准备工作 Cursor方法论&#xff1a;简单到没有方法 Cursor能做什么 Cursor官网&#xff1a;https://www.cursor.com/ja Cursor文档&#xff1a;Cursor – Welcome to Cursor Cursor论坛&#xff1a;Weekly - Cursor - Community Forum 写程序代码 举例&#xff1a; 设…

Linux共享内存

共享内存原理 简而言之&#xff0c;就是两个进程指向了同一块物理空间。&#xff08;它们都能看到同一块内存&#xff09; 共享内存在内核中同时可以存在很多个&#xff0c;OS要管理所有的共享内存。 如何保证两个不同进程看到的是同一个共享内存呢&#xff1f;&#xff1f;&…

搭建gn环境踩坑存档

流程 1. 项目根目录下新增.gclient和.gclient_entries //.gclient solutions [{"name": "src","url": "","managed": False,"custom_deps": {},"custom_vars": {},}, ]// .gclient_entries entries …

CMU15445(2023fall) Project #3 - Query Execution(上)详细分析

晚日寒鸦一片愁 柳塘新绿却温柔 若教眼底无离恨 不信人间有白头 ——鹧鸪天 完整代码见&#xff1a; SnowLegend-star/CMU15445-2023fall: Having Conquered the Loftiest Peak, We Stand But a Step Away from Victory in This Stage. With unwavering determination, we pre…

【网络安全 | 漏洞挖掘】利用文件上传功能的 IDOR 和 XSS 劫持会话

未经许可,不得转载。 本文涉及漏洞均已修复。 文章目录 前言正文前言 想象这样一个场景:一个专门处理敏感文档的平台,如保险理赔或身份验证系统,却因一个设计疏漏而成为攻击者的“金矿”。在对某个保险门户的文件上传功能进行测试时,我意外发现了一个可导致大规模账户接管…