大数据开发中的元数据:从基础到高级应用的全面指南
在大数据开发中,元数据(Metadata)是指描述数据的数据。元数据可以提供有关数据结构、数据类型、数据约束和数据关系的重要信息。合理利用元数据可以显著提高数据建模和管理的效率。本文将详细介绍如何根据元数据建表,并提供一些代码示例来说明具体操作。
目录
- 什么是元数据?
- 1. 根据元数据建表的步骤
- 1.1 收集元数据
- 1.2 生成建表语句
- 1.3 执行建表语句
- 示例
- 2. 元数据驱动的数据管理
- 数据迁移
- 数据同步
- 数据校验
- 3. 元数据驱动的数据治理
- 数据质量管理
- 数据安全与合规
- 数据生命周期管理
- 4. 元数据的自动化与工具集成
- 元数据管理工具
- Apache Atlas
- Apache Hive Metastore
- Apache Airflow
- 集成元数据管理与数据管道
- 示例元数据文件(metadata.json)
- 5. 元数据的高级应用
- 数据血缘分析
- 影响分析
- 数据编目
- 总结:
什么是元数据?
元数据是关于数据的信息,描述了数据的结构、含义、属性及其相互关系。在大数据系统中,元数据可以帮助我们理解数据来源、数据类型、数据的约束条件等。常见的元数据包括:
- 数据库名
- 表名
- 字段名
- 数据类型
- 字段长度
- 是否为空
- 主键和外键约束
1. 根据元数据建表的步骤
1.1 收集元数据
首先,我们需要收集关于数据的元数据。元数据可以来自于多种来源,例如手动编写的文档、数据字典、数据治理工具等。下面是一个简单的元数据示例:
{
"database": "example_db",
"table": "users",
"columns": [
{"name": "id", "type": "INT", "length": 11, "nullable": false, "primary_key": true},
{"name": "name", "type": "VARCHAR", "length": 255, "nullable": false},
{"name": "email", "type": "VARCHAR", "length": 255, "nullable": false, "unique": true},
{"name": "created_at", "type": "TIMESTAMP", "nullable": false}
]
}
1.2 生成建表语句
根据收集到的元数据,我们可以生成 SQL 建表语句。下面是一个 Python 代码示例,用于根据元数据生成建表语句:
def generate_create_table_sql(metadata):
table_name = metadata["table"]
columns = metadata["columns"]
column_definitions = []
primary_keys = []
for column in columns:
column_def = f'{column["name"]} {column["type"]}'
if "length" in column:
column_def += f'({column["length"]})'
if not column.get("nullable", True):
column_def += " NOT NULL"
if column.get("primary_key", False):
primary_keys.append(column["name"])
if column.get("unique", False):
column_def += " UNIQUE"
column_definitions.append(column_def)
primary_key_def = ""
if primary_keys:
primary_key_def = f', PRIMARY KEY ({", ".join(primary_keys)})'
create_table_sql = f'CREATE TABLE {table_name} (\n ' + ',\n '.join(column_definitions) + primary_key_def + '\n);'
return create_table_sql
metadata = {
"database": "example_db",
"table": "users",
"columns": [
{"name": "id", "type": "INT", "length": 11, "nullable": false, "primary_key": true},
{"name": "name", "type": "VARCHAR", "length": 255, "nullable": false},
{"name": "email", "type": "VARCHAR", "length": 255, "nullable": false, "unique": true},
{"name": "created_at", "type": "TIMESTAMP", "nullable": false}
]
}
create_table_sql = generate_create_table_sql(metadata)
print(create_table_sql)
1.3 执行建表语句
生成建表语句后,我们需要在数据库中执行这些语句以创建相应的表。可以使用数据库连接库(例如 pymysql
、psycopg2
等)来执行 SQL 语句:
import pymysql
def execute_create_table(sql, database):
connection = pymysql.connect(
host='localhost',
user='root',
password='password',
database=database
)
try:
with connection.cursor() as cursor:
cursor.execute(sql)
connection.commit()
finally:
connection.close()
execute_create_table(create_table_sql, metadata["database"])
示例
假设我们有以下元数据描述:
{
"database": "example_db",
"table": "orders",
"columns": [
{"name": "order_id", "type": "INT", "length": 11, "nullable": false, "primary_key": true},
{"name": "user_id", "type": "INT", "length": 11, "nullable": false},
{"name": "product_id", "type": "INT", "length": 11, "nullable": false},
{"name": "quantity", "type": "INT", "length": 11, "nullable": false},
{"name": "order_date", "type": "TIMESTAMP", "nullable": false}
]
}
通过上面的代码,我们可以生成并执行以下 SQL 语句来创建 orders
表:
CREATE TABLE orders (
order_id INT(11) NOT NULL,
user_id INT(11) NOT NULL,
product_id INT(11) NOT NULL,
quantity INT(11) NOT NULL,
order_date TIMESTAMP NOT NULL,
PRIMARY KEY (order_id)
);
2. 元数据驱动的数据管理
除了建表,元数据还可以用于其他数据管理任务,如数据迁移、数据同步、数据校验等。通过统一管理和使用元数据,可以显著简化这些任务的实现过程。
数据迁移
数据迁移是指将数据从一个系统或存储位置移动到另一个系统或存储位置的过程。通过元数据,我们可以自动生成迁移脚本,从而简化迁移过程。以下是一个示例:
假设我们需要将 example_db
数据库中的所有表和数据迁移到另一个数据库 new_db
,可以使用以下 Python 代码生成迁移脚本:
def generate_migration_script(metadata):
old_database = metadata["old_database"]
new_database = metadata["new_database"]
tables = metadata["tables"]
script = f'-- Migration script from {old_database} to {new_database}\n'
for table in tables:
script += f'\n-- Migrate table {table["table"]}\n'
script += f'CREATE TABLE {new_database}.{table["table"]} LIKE {old_database}.{table["table"]};\n'
script += f'INSERT INTO {new_database}.{table["table"]} SELECT * FROM {old_database}.{table["table"]};\n'
return script
migration_metadata = {
"old_database": "example_db",
"new_database": "new_db",
"tables": [
{"table": "users"},
{"table": "orders"}
]
}
migration_script = generate_migration_script(migration_metadata)
print(migration_script)
输出的脚本如下:
-- Migration script from example_db to new_db
-- Migrate table users
CREATE TABLE new_db.users LIKE example_db.users;
INSERT INTO new_db.users SELECT * FROM example_db.users;
-- Migrate table orders
CREATE TABLE new_db.orders LIKE example_db.orders;
INSERT INTO new_db.orders SELECT * FROM example_db.orders;
数据同步
数据同步是确保不同系统或存储位置中的数据保持一致的过程。元数据可以帮助我们确定哪些表和字段需要同步,以及如何处理冲突。以下是一个简单的示例,使用元数据生成数据同步脚本:
def generate_sync_script(metadata):
source_database = metadata["source_database"]
target_database = metadata["target_database"]
tables = metadata["tables"]
script = f'-- Sync script from {source_database} to {target_database}\n'
for table in tables:
script += f'\n-- Sync table {table["table"]}\n'
script += f'REPLACE INTO {target_database}.{table["table"]} SELECT * FROM {source_database}.{table["table"]};\n'
return script
sync_metadata = {
"source_database": "example_db",
"target_database": "sync_db",
"tables": [
{"table": "users"},
{"table": "orders"}
]
}
sync_script = generate_sync_script(sync_metadata)
print(sync_script)
输出的脚本如下:
-- Sync script from example_db to sync_db
-- Sync table users
REPLACE INTO sync_db.users SELECT * FROM example_db.users;
-- Sync table orders
REPLACE INTO sync_db.orders SELECT * FROM example_db.orders;
数据校验
数据校验是指验证数据是否符合预期的过程。通过元数据,我们可以自动生成校验规则,并据此进行数据校验。以下是一个示例,使用元数据生成数据校验脚本:
def generate_validation_script(metadata):
database = metadata["database"]
table = metadata["table"]
columns = metadata["columns"]
script = f'-- Validation script for table {table} in database {database}\n'
for column in columns:
if not column.get("nullable", True):
script += f'SELECT * FROM {database}.{table} WHERE {column["name"]} IS NULL;\n'
if column.get("unique", False):
script += f'SELECT {column["name"]}, COUNT(*) FROM {database}.{table} GROUP BY {column["name"]} HAVING COUNT(*) > 1;\n'
return script
validation_metadata = {
"database": "example_db",
"table": "users",
"columns": [
{"name": "id", "type": "INT", "length": 11, "nullable": false, "primary_key": true},
{"name": "name", "type": "VARCHAR", "length": 255, "nullable": false},
{"name": "email", "type": "VARCHAR", "length": 255, "nullable": false, "unique": true},
{"name": "created_at", "type": "TIMESTAMP", "nullable": false}
]
}
validation_script = generate_validation_script(validation_metadata)
print(validation_script)
输出的脚本如下:
-- Validation script for table users in database example_db
SELECT * FROM example_db.users WHERE id IS NULL;
SELECT * FROM example_db.users WHERE name IS NULL;
SELECT * FROM example_db.users WHERE email IS NULL;
SELECT email, COUNT(*) FROM example_db.users GROUP BY email HAVING COUNT(*) > 1;
SELECT * FROM example_db.users WHERE created_at IS NULL;
3. 元数据驱动的数据治理
数据治理涉及数据的管理、控制和保护,以确保数据的质量、合规性和安全性。利用元数据可以显著提升数据治理的效果和效率。下面将介绍几种利用元数据进行数据治理的方式。
数据质量管理
数据质量管理是确保数据准确、完整、一致和及时的过程。元数据可以帮助我们定义和执行数据质量规则。例如,我们可以根据元数据自动生成数据质量检查脚本。
def generate_data_quality_checks(metadata):
database = metadata["database"]
table = metadata["table"]
columns = metadata["columns"]
checks = []
for column in columns:
if not column.get("nullable", True):
checks.append(f'SELECT COUNT(*) FROM {database}.{table} WHERE {column["name"]} IS NULL;')
if column.get("unique", False):
checks.append(f'SELECT {column["name"]}, COUNT(*) FROM {database}.{table} GROUP BY {column["name"]} HAVING COUNT(*) > 1;')
if column.get("type") in ["INT", "FLOAT"] and "min_value" in column:
checks.append(f'SELECT COUNT(*) FROM {database}.{table} WHERE {column["name"]} < {column["min_value"]};')
if column.get("type") in ["INT", "FLOAT"] and "max_value" in column:
checks.append(f'SELECT COUNT(*) FROM {database}.{table} WHERE {column["name"]} > {column["max_value"]};')
return checks
quality_metadata = {
"database": "example_db",
"table": "users",
"columns": [
{"name": "id", "type": "INT", "length": 11, "nullable": false, "primary_key": true},
{"name": "name", "type": "VARCHAR", "length": 255, "nullable": false},
{"name": "email", "type": "VARCHAR", "length": 255, "nullable": false, "unique": true},
{"name": "age", "type": "INT", "nullable": true, "min_value": 0, "max_value": 120},
{"name": "created_at", "type": "TIMESTAMP", "nullable": false}
]
}
quality_checks = generate_data_quality_checks(quality_metadata)
for check in quality_checks:
print(check)
输出的检查脚本如下:
SELECT COUNT(*) FROM example_db.users WHERE id IS NULL;
SELECT
上一篇:
VScode常用快捷键
下一篇:
【Linux】Linux权限
推荐阅读
-
【摩尔线程+Colossal-AI强强联手】MusaBert登上CLUE榜单TOP10:技术细节揭秘
- 技术实力:摩尔线程凭借"软硬兼备"的技术底蕴,让MusaBert得以从底层优化到顶层。其内置多功能GPU配备AI加速和并行计算模块,提供了全面的AI与科学计算支持,为AI推理和低资源条件下的大模型训练等场景带来了高效、经济且环保的算力。
- 算法层面亮点:依托Colossal-AI AI大模型开发系统,MusaBert在训练过程中展现出了卓越的并行性能与易用性,特别在预处理阶段对DataLoader进行了优化,适应低资源环境高效处理海量数据。同时,通过精细的建模优化、领域内数据增强以及Adan优化器等手段,挖掘和展示了预训练语言模型出色的语义理解潜力。基于MusaBert,摩尔线程自主研发的MusaSim通过对比学习方法微调,结合百万对标注数据,MusaSim在多个任务如语义相似度、意图识别和情绪分析中均表现出色。
- 数据资源丰富:MusaBert除了自家高质量语义相似数据外,还融合了悟道开源200GB数据、CLUE社区80GB数据,以及浪潮公司提供的1TB高质量数据,保证模型即便在较小规模下仍具备良好性能。
当前,MusaBert已成功应用于摩尔线程的智能客服与数字人项目,并广泛服务于语义相似度、情绪识别、阅读理解与声韵识别等领域。为了降低大模型开发和应用难度,MusaBert及其相关高质量模型代码已在Colossal-AI仓库开源,可快速训练优质中文BERT模型。同时,通过摩尔线程与潞晨科技的深度合作,仅需一张多功能GPU单卡便能高效训练MusaBert或更大规模的GPT2模型,显著降低预训练成本,进一步推动双方在低资源大模型训练领域的共享目标。
MusaBert荣登CLUE榜单TOP10,象征着摩尔线程与潞晨科技联合研发团队在中文预训练研究领域的领先地位。展望未来,双方将携手探索更大规模的自然语言模型研究,充分运用上游数据资源,产出更为强大的模型并开源。持续强化在摩尔线程多功能GPU上的大模型训练能力,特别是在消费级显卡等低资源环境下,致力于降低使用大模型训练的门槛与成本,推动人工智能更加普惠。而潞晨科技作为重要合作伙伴,将继续发挥关键作用。
-
【2022新手指南】Java编程进阶之路 - 六、技术架构篇
### MySQL索引底层解析与优化实战
- 你会讲解MySQL索引的数据结构吗?性能调优技巧知多少?
- Redis深度揭秘:你知道多少?从基础到哨兵、主从复制全梳理
- Redis持久化及哨兵模式详解,还有集群搭建和Leader选举黑箱打开
- Zookeeper是个啥?特性和应用场景大公开
- ZooKeeper集群搭建攻略及 Leader选举、读写一致性、共享锁实现细节
- 探究ZooKeeper中的Leader选举机制及其在分布式环境中的作用
- Zab协议深入剖析:原理、功能与在Zookeeper中的核心地位
- RabbitMQ全方位解读:工作模式、消费限流、可靠投递与配置策略
- 设计者视角:RabbitMQ过期时间、死信队列与延时队列实践指南
- RocketMQ特性和应用场景揭示:理解其精髓与差异化优势
- Kafka详细介绍:特性及广泛应用于实时数据处理的场景解析
- ElasticSearch实力揭秘:特性概述与作为搜索引擎的广泛应用
- MongoDB认知升级:非关系型数据库的优势阐述,安装与使用实战教学
- BIO/NIO/AIO网络模型对比:掌握它们的区别与在网络编程中的实际应用
- Netty带你飞:理解其超快速度背后的秘密,包括线程模型分析
- 网络通信黑科技:Netty编解码原理与常用编解码器的应用,Protostuff实战演示
- 解密Netty粘包与拆包现象,怎样有效应对这一常见问题
- 自定义Netty心跳检测机制,轻松调整检测间隔时间的艺术
- Dubbo轻骑兵介绍:核心特性概览,服务降级实战与其实现益处
- Dubbo三大神器解读:本地存根与本地伪装的实战运用与优势呈现
-----------------------
七、结语与回顾
-
SSM三大框架基础面试题-一、Spring篇
什么是Spring框架?
Spring是一种轻量级框架,提高开发人员的开发效率以及系统的可维护性。
我们一般说的Spring框架就是Spring Framework,它是很多模块的集合,使用这些模块可以很方便地协助我们进行开发。这些模块是核心容器、数据访问/集成、Web、AOP(面向切面编程)、工具、消息和测试模块。比如Core Container中的Core组件是Spring所有组件的核心,Beans组件和Context组件是实现IOC和DI的基础,AOP组件用来实现面向切面编程。
Spring的6个特征:
核心技术:依赖注入(DI),AOP,事件(Events),资源,i18n,验证,数据绑定,类型转换,SpEL。
测试:模拟对象,TestContext框架,Spring MVC测试,WebTestClient。
数据访问:事务,DAO支持,JDBC,ORM,编组XML。
Web支持:Spring MVC和Spring WebFlux Web框架。
集成:远程处理,JMS,JCA,JMX,电子邮件,任务,调度,缓存。
语言:Kotlin,Groovy,动态语言。
列举一些重要的Spring模块?
Spring Core:核心,可以说Spring其他所有的功能都依赖于该类库。主要提供IOC和DI功能。
Spring Aspects:该模块为与AspectJ的集成提供支持。
Spring AOP:提供面向切面的编程实现。
Spring JDBC:Java数据库连接。
Spring JMS:Java消息服务。
Spring ORM:用于支持Hibernate等ORM工具。
Spring Web:为创建Web应用程序提供支持。
Spring Test:提供了对JUnit和TestNG测试的支持。
谈谈自己对于Spring IOC和AOP的理解
IOC(Inversion Of Controll,控制反转)是一种设计思想:
在程序中手动创建对象的控制权,交由给Spring框架来管理。IOC在其他语言中也有应用,并非Spring特有。IOC容器实际上就是一个Map(key, value),Map中存放的是各种对象。
将对象之间的相互依赖关系交给IOC容器来管理,并由IOC容器完成对象的注入。这样可以很大程度上简化应用的开发,把应用从复杂的依赖关系中解放出来。IOC容器就像是一个工厂一样,当我们需要创建一个对象的时候,只需要配置好配置文件/注解即可,完全不用考虑对象是如何被创建出来的。在实际项目中一个Service类可能由几百甚至上千个类作为它的底层,假如我们需要实例化这个Service,可能要每次都搞清楚这个Service所有底层类的构造函数,这可能会把人逼疯。如果利用IOC的话,你只需要配置好,然后在需要的地方引用就行了,大大增加了项目的可维护性且降低了开发难度。
Spring中的bean的作用域有哪些?
1.singleton:该bean实例为单例
2.prototype:每次请求都会创建一个新的bean实例(多例)。
3.request:每一次HTTP请求都会产生一个新的bean,该bean仅在当前HTTP request内有效。
4.session:每一次HTTP请求都会产生一个新的bean,该bean仅在当前HTTP session内有效。
5.global-session:全局session作用域,仅仅在基于Portlet的Web应用中才有意义,Spring5中已经没有了。Portlet是能够生成语义代码(例如HTML)片段的小型Java Web插件。它们基于Portlet容器,可以像Servlet一样处理HTTP请求。但是与Servlet不同,每个Portlet都有不同的会话。
Spring中的单例bean的线程安全问题了解吗?
概念用于理解:大部分时候我们并没有在系统中使用多线程,所以很少有人会关注这个问题。单例bean存在线程问题,主要是因为当多个线程操作同一个对象的时候,对这个对象的非静态成员变量的写操作会存在线程安全问题。
有两种常见的解决方案(用于回答的点):
1.在bean对象中尽量避免定义可变的成员变量(不太现实)。
2.在类中定义一个ThreadLocal成员变量,将需要的可变成员变量保存在ThreadLocal(线程本地化对象)中(推荐的一种方式)。
ThreadLocal解决多线程变量共享问题(参考博客):https://segmentfault.com/a/1190000009236777
Spring中Bean的生命周期:
1.Bean容器找到配置文件中Spring Bean的定义。
2.Bean容器利用Java Reflection API创建一个Bean的实例。
3.如果涉及到一些属性值,利用set方法设置一些属性值。
4.如果Bean实现了BeanNameAware接口,调用setBeanName方法,传入Bean的名字。
5.如果Bean实现了BeanClassLoaderAware接口,调用setBeanClassLoader方法,传入ClassLoader对象的实例。
6.如果Bean实现了BeanFactoryAware接口,调用setBeanClassFacotory方法,传入ClassLoader对象的实例。
7.与上面的类似,如果实现了其他*Aware接口,就调用相应的方法。
8.如果有和加载这个Bean的Spring容器相关的BeanPostProcessor对象,执postProcessBeforeInitialization方法。
9.如果Bean实现了InitializingBean接口,执行afeterPropertiesSet方法。
10.如果Bean在配置文件中的定义包含init-method属性,执行指定的方法。
11.如果有和加载这个Bean的Spring容器相关的BeanPostProcess对象,执行postProcessAfterInitialization方法。
12.当要销毁Bean的时候,如果Bean实现了DisposableBean接口,执行destroy方法。
13.当要销毁Bean的时候,如果Bean在配置文件中的定义包含destroy-method属性,执行指定的方法。
Spring框架中用到了哪些设计模式?
1.工厂设计模式:Spring使用工厂模式通过BeanFactory和ApplicationContext创建bean对象。
2.代理设计模式:Spring AOP功能的实现。
3.单例设计模式:Spring中的bean默认都是单例的。
4.模板方法模式:Spring中的jdbcTemplate、hibernateTemplate等以Template结尾的对数据库操作的类,它们就使用到了模板模式。
5.包装器设计模式:我们的项目需要连接多个数据库,而且不同的客户在每次访问中根据需要会去访问不同的数据库。这种模式让我们可以根据客户的需求能够动态切换不同的数据源。
6.观察者模式:Spring事件驱动模型就是观察者模式很经典的一个应用。
7.适配器模式:Spring AOP的增强或通知(Advice)使用到了适配器模式、Spring MVC中也是用到了适配器模式适配Controller。
还有很多。。。。。。。
@Component和@Bean的区别是什么
1.作用对象不同。@Component注解作用于类,而@Bean注解作用于方法。
2.@Component注解通常是通过类路径扫描来自动侦测以及自动装配到Spring容器中(我们可以使用@ComponentScan注解定义要扫描的路径)。@Bean注解通常是在标有该注解的方法中定义产生这个bean,告诉Spring这是某个类的实例,当我需要用它的时候还给我。
3.@Bean注解比@Component注解的自定义性更强,而且很多地方只能通过@Bean注解来注册bean。比如当引用第三方库的类需要装配到Spring容器的时候,就只能通过@Bean注解来实现。
@Configuration
public class AppConfig {
@Bean
public TransferService transferService {
return new TransferServiceImpl;
}
}
<beans>
<bean id="transferService" class="com.kk.TransferServiceImpl"/>
</beans>
@Bean
public OneService getService(status) {
case (status) {
when 1:
return new serviceImpl1;
when 2:
return new serviceImpl2;
when 3:
return new serviceImpl3;
}
}
将一个类声明为Spring的bean的注解有哪些?
声明bean的注解:
@Component 组件,没有明确的角色
@Service 在业务逻辑层使用(service层)
@Repository 在数据访问层使用(dao层)
@Controller 在展现层使用,控制器的声明
注入bean的注解:
@Autowired:由Spring提供
@Inject:由JSR-330提供
@Resource:由JSR-250提供
*扩:JSR 是 java 规范标准
Spring事务管理的方式有几种?
1.编程式事务:在代码中硬编码(不推荐使用)。
2.声明式事务:在配置文件中配置(推荐使用),分为基于XML的声明式事务和基于注解的声明式事务。
Spring事务中的隔离级别有哪几种?
在TransactionDefinition接口中定义了五个表示隔离级别的常量:ISOLATION_DEFAULT:使用后端数据库默认的隔离级别,Mysql默认采用的REPEATABLE_READ隔离级别;Oracle默认采用的READ_COMMITTED隔离级别。ISOLATION_READ_UNCOMMITTED:最低的隔离级别,允许读取尚未提交的数据变更,可能会导致脏读、幻读或不可重复读。ISOLATION_READ_COMMITTED:允许读取并发事务已经提交的数据,可以阻止脏读,但是幻读或不可重复读仍有可能发生ISOLATION_REPEATABLE_READ:对同一字段的多次读取结果都是一致的,除非数据是被本身事务自己所修改,可以阻止脏读和不可重复读,但幻读仍有可能发生。ISOLATION_SERIALIZABLE:最高的隔离级别,完全服从ACID的隔离级别。所有的事务依次逐个执行,这样事务之间就完全不可能产生干扰,也就是说,该级别可以防止脏读、不可重复读以及幻读。但是这将严重影响程序的性能。通常情况下也不会用到该级别。
Spring事务中有哪几种事务传播行为?
在TransactionDefinition接口中定义了八个表示事务传播行为的常量。
支持当前事务的情况:PROPAGATION_REQUIRED:如果当前存在事务,则加入该事务;如果当前没有事务,则创建一个新的事务。PROPAGATION_SUPPORTS: 如果当前存在事务,则加入该事务;如果当前没有事务,则以非事务的方式继续运行。PROPAGATION_MANDATORY: 如果当前存在事务,则加入该事务;如果当前没有事务,则抛出异常。(mandatory:强制性)。
不支持当前事务的情况:PROPAGATION_REQUIRES_NEW: 创建一个新的事务,如果当前存在事务,则把当前事务挂起。PROPAGATION_NOT_SUPPORTED: 以非事务方式运行,如果当前存在事务,则把当前事务挂起。PROPAGATION_NEVER: 以非事务方式运行,如果当前存在事务,则抛出异常。
其他情况:PROPAGATION_NESTED: 如果当前存在事务,则创建一个事务作为当前事务的嵌套事务来运行;如果当前没有事务,则该取值等价于PROPAGATION_REQUIRED。
二、SpringMVC篇
什么是Spring MVC ?简单介绍下你对springMVC的理解?
Spring MVC是一个基于Java的实现了MVC设计模式的请求驱动类型的轻量级Web框架,通过把Model,View,Controller分离,将web层进行职责解耦,把复杂的web应用分成逻辑清晰的几部分,简化开发,减少出错,方便组内开发人员之间的配合。
Spring MVC的工作原理了解嘛?
image.png
Springmvc的优点:
(1)可以支持各种视图技术,而不仅仅局限于JSP;
(2)与Spring框架集成(如IoC容器、AOP等);
(3)清晰的角色分配:前端控制器(dispatcherServlet) , 请求到处理器映射(handlerMapping), 处理器适配器(HandlerAdapter), 视图解析器(ViewResolver)。
(4) 支持各种请求资源的映射策略。
Spring MVC的主要组件?
(1)前端控制器 DispatcherServlet(不需要程序员开发)
作用:接收请求、响应结果,相当于转发器,有了DispatcherServlet 就减少了其它组件之间的耦合度。
(2)处理器映射器HandlerMapping(不需要程序员开发)
作用:根据请求的URL来查找Handler
(3)处理器适配器HandlerAdapter
注意:在编写Handler的时候要按照HandlerAdapter要求的规则去编写,这样适配器HandlerAdapter才可以正确的去执行Handler。
(4)处理器Handler(需要程序员开发)
(5)视图解析器 ViewResolver(不需要程序员开发)
作用:进行视图的解析,根据视图逻辑名解析成真正的视图(view)
(6)视图View(需要程序员开发jsp)
View是一个接口, 它的实现类支持不同的视图类型(jsp,freemarker,pdf等等)
springMVC和struts2的区别有哪些?
(1)springmvc的入口是一个servlet即前端控制器(DispatchServlet),而struts2入口是一个filter过虑器(StrutsPrepareAndExecuteFilter)。
(2)springmvc是基于方法开发(一个url对应一个方法),请求参数传递到方法的形参,可以设计为单例或多例(建议单例),struts2是基于类开发,传递参数是通过类的属性,只能设计为多例。
(3)Struts采用值栈存储请求和响应的数据,通过OGNL存取数据,springmvc通过参数解析器是将request请求内容解析,并给方法形参赋值,将数据和视图封装成ModelAndView对象,最后又将ModelAndView中的模型数据通过reques域传输到页面。Jsp视图解析器默认使用jstl。
SpringMVC怎么样设定重定向和转发的?
(1)转发:在返回值前面加"forward:",譬如"forward:user.do?name=method4"
(2)重定向:在返回值前面加"redirect:",譬如"redirect:http://www.baidu.com"
SpringMvc怎么和AJAX相互调用的?
通过Jackson框架就可以把Java里面的对象直接转化成Js可以识别的Json对象。具体步骤如下 :
(1)加入Jackson.jar
(2)在配置文件中配置json的映射
(3)在接受Ajax方法里面可以直接返回Object,List等,但方法前面要加上@ResponseBody注解。
如何解决POST请求中文乱码问题,GET的又如何处理呢?
(1)解决post请求乱码问题:
在web.xml中配置一个CharacterEncodingFilter过滤器,设置成utf-8;
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
(2)get请求中文参数出现乱码解决方法有两个:
①修改tomcat配置文件添加编码与工程编码一致,如下:
<ConnectorURIEncoding="utf-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
②另外一种方法对参数进行重新编码:
String userName = new String(request.getParamter("userName").getBytes("ISO8859-1"),"utf-8")
ISO8859-1是tomcat默认编码,需要将tomcat编码后的内容按utf-8编码。
Spring MVC的异常处理 ?
统一异常处理:
Spring MVC处理异常有3种方式:
(1)使用Spring MVC提供的简单异常处理器SimpleMappingExceptionResolver;
(2)实现Spring的异常处理接口HandlerExceptionResolver 自定义自己的异常处理器;
(3)使用@ExceptionHandler注解实现异常处理;
统一异常处理的博客:https://blog.csdn.net/ctwy291314/article/details/81983103
SpringMVC的控制器是不是单例模式,如果是,有什么问题,怎么解决?
是单例模式,所以在多线程访问的时候有线程安全问题,不要用同步,会影响性能的,解决方案是在控制器里面不能写成员变量。(此题目类似于上面Spring 中 第5题 有两种解决方案)
SpringMVC常用的注解有哪些?
@RequestMapping:用于处理请求 url 映射的注解,可用于类或方法上。用于类上,则表示类中的所有响应请求的方法都是以该地址作为父路径。
@RequestBody:注解实现接收http请求的json数据,将json转换为java对象。
@ResponseBody:注解实现将conreoller方法返回对象转化为json对象响应给客户。
SpingMvc中的控制器的注解一般用那个,有没有别的注解可以替代?
一般用@Controller注解,也可以使用@RestController,@RestController注解相当于@ResponseBody + @Controller,表示是表现层,除此之外,一般不用别的注解代替。
如果在拦截请求中,我想拦截get方式提交的方法,怎么配置?
可以在@RequestMapping注解里面加上method=RequestMethod.GET。
怎样在方法里面得到Request,或者Session?
直接在方法的形参中声明request,SpringMVC就自动把request对象传入。
如果想在拦截的方法里面得到从前台传入的参数,怎么得到?
直接在形参里面声明这个参数就可以,但必须名字和传过来的参数一样。
如果前台有很多个参数传入,并且这些参数都是一个对象的,那么怎么样快速得到这个对象?
直接在方法中声明这个对象,SpringMVC就自动会把属性赋值到这个对象里面。
SpringMVC中函数的返回值是什么?
返回值可以有很多类型,有String, ModelAndView。ModelAndView类把视图和数据都合并的一起的。
SpringMVC用什么对象从后台向前台传递数据的?
通过ModelMap对象,可以在这个对象里面调用put方法,把对象加到里面,前台就可以拿到数据。
怎么样把ModelMap里面的数据放入Session里面?
可以在类上面加上@SessionAttributes注解,里面包含的字符串就是要放入session里面的key。
SpringMvc里面拦截器是怎么写的:
有两种写法,一种是实现HandlerInterceptor接口,另外一种是继承适配器类,接着在接口方法当中,实现处理逻辑;然后在SpringMvc的配置文件中配置拦截器即可:
<!-- 配置SpringMvc的拦截器 -->
<mvc:interceptors>
<!-- 配置一个拦截器的Bean就可以了 默认是对所有请求都拦截 -->
<bean id="myInterceptor" class="com.zwp.action.MyHandlerInterceptor"></bean>
<!-- 只针对部分请求拦截 -->
<mvc:interceptor>
<mvc:mapping path="/modelMap.do" />
<bean class="com.zwp.action.MyHandlerInterceptorAdapter" />
</mvc:interceptor>
</mvc:interceptors>
注解原理:
注解本质是一个继承了Annotation的特殊接口,其具体实现类是Java运行时生成的动态代理类。我们通过反射获取注解时,返回的是Java运行时生成的动态代理对象。通过代理对象调用自定义注解的方法,会最终调用AnnotationInvocationHandler的invoke方法。该方法会从memberValues这个Map中索引出对应的值。而memberValues的来源是Java常量池
三、Mybatis篇
什么是MyBatis?
MyBatis是一个可以自定义SQL、存储过程和高级映射的持久层框架。
讲下MyBatis的缓存
MyBatis的缓存分为一级缓存和二级缓存,一级缓存放在session里面,默认就有,
二级缓存放在它的命名空间里,默认是不打开的,使用二级缓存属性类需要实现Serializable序列化接口,
可在它的映射文件中配置<cache/>
Mybatis是如何进行分页的?分页插件的原理是什么?
1)Mybatis使用RowBounds对象进行分页,也可以直接编写sql实现分页,也可以使用Mybatis的分页插件。
2)分页插件的原理:实现Mybatis提供的接口,实现自定义插件,在插件的拦截方法内拦截待执行的sql,然后重写sql。
举例:select * from student,拦截sql后重写为:select t.* from (select * from student)t limit 0,10
简述Mybatis的插件运行原理,以及如何编写一个插件?
1)Mybatis仅可以编写针对ParameterHandler、ResultSetHandler、StatementHandler、
Executor这4种接口的插件,Mybatis通过动态代理,
为需要拦截的接口生成代理对象以实现接口方法拦截功能,
每当执行这4种接口对象的方法时,就会进入拦截方法,
具体就是InvocationHandler的invoke方法,当然,
只会拦截那些你指定需要拦截的方法。
2)实现Mybatis的Interceptor接口并复写intercept方法,
然后在给插件编写注解,指定要拦截哪一个接口的哪些方法即可,
记住,别忘了在配置文件中配置你编写的插件。
Mybatis动态sql是做什么的?都有哪些动态sql?能简述一下动态sql的执行原理不?
1)Mybatis动态sql可以让我们在Xml映射文件内,
以标签的形式编写动态sql,完成逻辑判断和动态拼接sql的功能。
2)Mybatis提供了9种动态sql标签:trim|where|set|foreach|if|choose|when|otherwise|bind。
3)其执行原理为,使用OGNL从sql参数对象中计算表达式的值,
根据表达式的值动态拼接sql,以此来完成动态sql的功能。
#{}和${}的区别是什么?
1)#{}是预编译处理,${}是字符串替换。
2)Mybatis在处理#{}时,会将sql中的#{}替换为?号,调用PreparedStatement的set方法来赋值(有效的防止SQL注入);
3)Mybatis在处理${}时,就是把${}替换成变量的值。
为什么说Mybatis是半自动ORM映射工具?它与全自动的区别在哪里?
Hibernate属于全自动ORM映射工具,
使用Hibernate查询关联对象或者关联集合对象时,
可以根据对象关系模型直接获取,所以它是全自动的。
而Mybatis在查询关联对象或关联集合对象时,
需要手动编写sql来完成,所以,称之为半自动ORM映射工具。
Mybatis是否支持延迟加载?如果支持,它的实现原理是什么?
1)Mybatis仅支持association关联对象和collection关联集合对象的延迟加载,
association指的就是一对一,collection指的就是一对多查询。
在Mybatis配置文件中,
可以配置是否启用延迟加载lazyLoadingEnabled=true|false。
2)它的原理是,使用CGLIB创建目标对象的代理对象,
当调用目标方法时,进入拦截器方法,
比如调用a.getB.getName,
拦截器invoke方法发现a.getB是null值,
那么就会单独发送事先保存好的查询关联B对象的sql,
把B查询上来,然后调用a.setB(b),
于是a的对象b属性就有值了,
接着完成a.getB.getName方法的调用。
这就是延迟加载的基本原理。
MyBatis与Hibernate有哪些不同?
1)Mybatis和hibernate不同,它不完全是一个ORM框架,
因为MyBatis需要程序员自己编写Sql语句,
不过mybatis可以通过XML或注解方式灵活配置要运行的sql语句,
并将java对象和sql语句映射生成最终执行的sql,
最后将sql执行的结果再映射生成java对象。
2)Mybatis学习门槛低,简单易学,程序员直接编写原生态sql,
可严格控制sql执行性能,灵活度高,非常适合对关系数据模型要求不高的软件开发,
例如互联网软件、企业运营类软件等,因为这类软件需求变化频繁,
一但需求变化要求成果输出迅速。但是灵活的前提是mybatis无法做到数据库无关性,
如果需要实现支持多种数据库的软件则需要自定义多套sql映射文件,工作量大。
3)Hibernate对象/关系映射能力强,数据库无关性好,
对于关系模型要求高的软件(例如需求固定的定制化软件)
如果用hibernate开发可以节省很多代码,提高效率。
但是Hibernate的缺点是学习门槛高,要精通门槛更高,
而且怎么设计O/R映射,在性能和对象模型之间如何权衡,
以及怎样用好Hibernate需要具有很强的经验和能力才行。
总之,按照用户的需求在有限的资源环境下只要能做出维护性、
扩展性良好的软件架构都是好架构,所以框架只有适合才是最好。
MyBatis的好处是什么?
1)MyBatis把sql语句从Java源程序中独立出来,放在单独的XML文件中编写,
给程序的维护带来了很大便利。
2)MyBatis封装了底层JDBC API的调用细节,并能自动将结果集转换成Java Bean对象,
大大简化了Java数据库编程的重复工作。
3)因为MyBatis需要程序员自己去编写sql语句,
程序员可以结合数据库自身的特点灵活控制sql语句,
因此能够实现比Hibernate等全自动orm框架更高的查询效率,能够完成复杂查询。
简述Mybatis的Xml映射文件和Mybatis内部数据结构之间的映射关系?
Mybatis将所有Xml配置信息都封装到All-In-One重量级对象Configuration内部。
在Xml映射文件中,<parameterMap>标签会被解析为ParameterMap对象,
其每个子元素会被解析为ParameterMapping对象。
<resultMap>标签会被解析为ResultMap对象,
其每个子元素会被解析为ResultMapping对象。
每一个<select>、<insert>、<update>、<delete>
标签均会被解析为MappedStatement对象,
标签内的sql会被解析为BoundSql对象。
什么是MyBatis的接口绑定,有什么好处?
接口映射就是在MyBatis中任意定义接口,然后把接口里面的方法和SQL语句绑定,
我们直接调用接口方法就可以,这样比起原来了SqlSession提供的方法我们可以有更加灵活的选择和设置.
接口绑定有几种实现方式,分别是怎么实现的?
接口绑定有两种实现方式,一种是通过注解绑定,就是在接口的方法上面加
上@Select@Update等注解里面包含Sql语句来绑定,
另外一种就是通过xml里面写SQL来绑定,在这种情况下,
要指定xml映射文件里面的namespace必须为接口的全路径名.
什么情况下用注解绑定,什么情况下用xml绑定?
当Sql语句比较简单时候,用注解绑定;当SQL语句比较复杂时候,用xml绑定,一般用xml绑定的比较多
MyBatis实现一对一有几种方式?具体怎么操作的?
有联合查询和嵌套查询,联合查询是几个表联合查询,只查询一次,
通过在resultMap里面配置association节点配置一对一的类就可以完成;
嵌套查询是先查一个表,根据这个表里面的结果的外键id,
去再另外一个表里面查询数据,也是通过association配置,
但另外一个表的查询通过select属性配置。
Mybatis能执行一对一、一对多的关联查询吗?都有哪些实现方式,以及它们之间的区别?
能,Mybatis不仅可以执行一对一、一对多的关联查询,
还可以执行多对一,多对多的关联查询,多对一查询,
其实就是一对一查询,只需要把selectOne修改为selectList即可;
多对多查询,其实就是一对多查询,只需要把selectOne修改为selectList即可。
关联对象查询,有两种实现方式,一种是单独发送一个sql去查询关联对象,
赋给主对象,然后返回主对象。另一种是使用嵌套查询,嵌套查询的含义为使用join查询,
一部分列是A对象的属性值,另外一部分列是关联对象B的属性值,
好处是只发一个sql查询,就可以把主对象和其关联对象查出来。
MyBatis里面的动态Sql是怎么设定的?用什么语法?
MyBatis里面的动态Sql一般是通过if节点来实现,通过OGNL语法来实现,
但是如果要写的完整,必须配合where,trim节点,where节点是判断包含节点有
内容就插入where,否则不插入,trim节点是用来判断如果动态语句是以and 或or
开始,那么会自动把这个and或者or取掉。
Mybatis是如何将sql执行结果封装为目标对象并返回的?都有哪些映射形式?
第一种是使用<resultMap>标签,逐一定义列名和对象属性名之间的映射关系。
第二种是使用sql列的别名功能,将列别名书写为对象属性名,
比如T_NAME AS NAME,对象属性名一般是name,小写,
但是列名不区分大小写,Mybatis会忽略列名大小写,
-
大数据开发中的元数据:从基础到高级应用的全面指南
-
go语言Socket编程-Socket编程
什么是Socket
Socket,英文含义是插座、插孔,一般称之为套接字,用于描述IP地址和端口。可以实现不同程序间的数据通信。
Socket起源于Unix,而Unix基本哲学之一就是“一切皆文件”,都可以用“打开open –> 读写write/read –> 关闭close”模式来操作。Socket就是该模式的一个实现,网络的Socket数据传输是一种特殊的I/O,Socket也是一种文件描述符。Socket也具有一个类似于打开文件的函数调用:Socket,该函数返回一个整型的Socket描述符,随后的连接建立、数据传输等操作都是通过该Socket实现的。
套接字的内核实现较为复杂,不宜在学习初期深入学习,了解到如下结构足矣。
套接字通讯原理示意
在TCP/IP协议中,“IP地址+TCP或UDP端口号”唯一标识网络通讯中的一个进程。“IP地址+端口号”就对应一个socket。欲建立连接的两个进程各自有一个socket来标识,那么这两个socket组成的socket pair就唯一标识一个连接。因此可以用Socket来描述网络连接的一对一关系。
常用的Socket类型有两种:流式Socket(SOCK_STREAM)和数据报式Socket(SOCK_DGRAM)。流式是一种面向连接的Socket,针对于面向连接的TCP服务应用;数据报式Socket是一种无连接的Socket,对应于无连接的UDP服务应用。
网络应用程序设计模式
C/S模式
传统的网络应用设计模式,客户机(client)/服务器(server)模式。需要在通讯两端各自部署客户机和服务器来完成数据通信。
B/S模式
浏览器(Browser)/服务器(Server)模式。只需在一端部署服务器,而另外一端使用每台PC都默认配置的浏览器即可完成数据的传输。
优缺点
对于C/S模式来说,其优点明显。客户端位于目标主机上可以保证性能,将数据缓存至客户端本地,从而提高数据传输效率。且,一般来说客户端和服务器程序由一个开发团队创作,所以他们之间所采用的协议相对灵活。可以在标准协议的基础上根据需求裁剪及定制。例如,腾讯所采用的通信协议,即为ftp协议的修改剪裁版。
因此,传统的网络应用程序及较大型的网络应用程序都首选C/S模式进行开发。如,知名的网络游戏魔兽世界。3D画面,数据量庞大,使用C/S模式可以提前在本地进行大量数据的缓存处理,从而提高观感。
C/S模式的缺点也较突出。由于客户端和服务器都需要有一个开发团队来完成开发。工作量将成倍提升,开发周期较长。另外,从用户角度出发,需要将客户端安插至用户主机上,对用户主机的安全性构成威胁。这也是很多用户不愿使用C/S模式应用程序的重要原因。
B/S模式相比C/S模式而言,由于它没有独立的客户端,使用标准浏览器作为客户端,其工作开发量较小。只需开发服务器端即可。另外由于其采用浏览器显示数据,因此移植性非常好,不受平台限制。如早期的偷菜游戏,在各个平台上都可以完美运行。
B/S模式的缺点也较明显。由于使用第三方浏览器,因此网络应用支持受限。另外,没有客户端放到对方主机上,缓存数据不尽如人意,从而传输数据量受到限制。应用的观感大打折扣。第三,必须与浏览器一样,采用标准http协议进行通信,协议选择不灵活。
因此在开发过程中,模式的选择由上述各自的特点决定。根据实际需求选择应用程序设计模式。
简单的C/S模型通信
Server端:Listen函数
func Listen(network, address string) (Listener, error)
network:选用的协议:TCP、UDP, 如:“tcp”或 “udp”
address:IP地址+端口号, 如:“127.0.0.1:8000”或 “:8000”
Listener 接口:
type Listener interface {
Accept (Conn, error)
Close error
Addr Addr
}
Conn 接口:
type Conn interface {
Read(b byte) (n int, err error)
Write(b byte) (n int, err error)
Close error
LocalAddr Addr
RemoteAddr Addr
SetDeadline(t time.Time) error
SetReadDeadline(t time.Time) error
SetWriteDeadline(t time.Time) error
}
参看 [<u>https://studygolang.com/pkgdoc</u>](https://studygolang.com/pkgdoc) 中文帮助文档中的demo:
示例代码:TCP服务器.go
package main
import (
"net"
"fmt"
)
func main {
// 创建监听
listener, err:= net.Listen("tcp", ":8000")
if err != nil {
fmt.Println("listen err:", err)
return
}
defer listener.Close // 主协程结束时,关闭listener
fmt.Println("服务器等待客户端建立连接...")
// 等待客户端连接请求
conn, err := listener.Accept
if err != nil {
fmt.Println("accept err:", err)
return
}
defer conn.Close // 使用结束,断开与客户端链接
fmt.Println("客户端与服务器连接建立成功...")
// 接收客户端数据
buf := make(byte, 1024) // 创建1024大小的缓冲区,用于read
n, err := conn.Read(buf)
if err != nil {
fmt.Println("read err:", err)
return
}
fmt.Println("服务器读到:", string(buf[:n])) // 读多少,打印多少。
}
-
大聪明教你学Java|Mybatis的一级缓存和二级缓存--🍊作者简介:不愿过河东,一个来自二线城市的程序员,致力于用 "猥琐 "的方法解决琐碎的问题,让复杂的问题变得简单易懂。支持作者:喜欢👍,关注💖,留言💌~!
前言。
在计算机世界中,缓存无处不在;操作系统有操作系统缓存,数据库会有数据库缓存,我们还可以利用中间件(如 Redis)来充当缓存。MyBatis 作为一个优秀的 ORM 框架,也用于缓存,所以今天我们就来谈谈 Mybatis 的一级缓存和二级缓存。
Mybatis 一级缓存
首先,我们来看一张图片👇。
我们在开发项目的过程中,如果打开Mybatis的SQL语句打印,经常会看到这样一句话:创建一个新的 SqlSession,其实这就是我们常说的 Mybatis 一级缓存。
Mybatis 的一级缓存也就是在执行一次 SQL 查询或 SQL 更新后,这条 SQL 语句并不会消失,而是被 MyBatis 缓存起来,当再次执行同样的 SQL 语句时,就会直接从缓存中提取出来,而不用再次执行 SQL 命令。第一级缓存也称为 SqlSession 级缓存。对数据库进行操作时,需要构建一个 SqlSession 对象,其中有一个用于存储缓存数据的数据结构(HashMap)。对象中有一个用于存储缓存数据的数据结构(HashMap)。不同 SqlSession 之间的缓存数据区域(HashMap)互不影响。
在我们的应用系统运行过程中,我们可能会在一个数据库会话中,执行多条查询条件相同的 SQL 语句,那么对于这种情况,你来进行设计,那么你会如何考虑呢?没错,就是加入缓存,MyBatis也是这么来处理的,如果是同一条SQL语句,会优先打入一级缓存,避免直接查询数据库,给数据库造成压力,提高性能。具体实现过程如下图所示👇
SqlSession 是一个接口,提供了一些 CRUD 方法,SqlSession 的默认实现类是 DefaultSqlSession,DefaultSqlSession 类持有 Executor 接口对象,Executor 的默认实现是 BaseExecutor 对象,每个 BaseExecutor 对象都有一个 PerpetualCache 缓存,即上图中的本地缓存。当用户发起查询时,MyBatis 会根据当前执行的语句生成一个 MappedStatement,并在本地缓存中进行查询,如果缓存被命中,查询结果会直接返回给用户;如果缓存未被命中,查询结果会直接返回给用户。如果缓存未命中,则查询数据库,将结果写入本地缓存,最后将结果返回给用户。这时候可能有小伙伴要说了:我还在控制台中看到 "关闭非事务性 SqlSession "这句话,说明我每次创建一个 SqlSession 到 SqlSession 结束都是关闭的,那么我的缓存还是有毛线用!😥
事情肯定不是我们想的那样,让我们继续👇。
🍊 getSqlSession 源代码
-
中文顶刊上用准自然实验识别的实证文章有哪些?有的附程序和code, 不看至少需要收藏一下!-经济研究
[1]刘啟仁,赵灿.税收政策激励与企业人力资本升级[J].经济研究,2020,55(04):70-85.
[2]李广众,朱佳青,李杰,李新春.经理人相对绩效评价与企业并购行为:理论与实证[J].经济研究,2020,55(03):65-82.
[3]张克中,欧阳洁,李文健.缘何“减税难降负”:信息技术、征税能力与企业逃税[J].经济研究,2020,55(03):116-132.
[4]周波,赵国昌.中国间接税税负归宿研究:汽车市场准自然实验的证据[J].经济研究,2020,55(03):133-147.
[5]毛其淋.贸易政策不确定性是否影响了中国企业进口?[J].经济研究,2020,55(02):148-164.
[6]刘瑞明,毛宇,亢延锟.制度松绑、市场活力激发与旅游经济发展——来自中国文化*改革的证据[J].经济研究,2020,55(01):115-131.
[7]施新政,高文静,陆瑶,李蒙蒙.资本市场配置效率与劳动收入份额——来自股权分置改革的证据[J].经济研究,2019,54(12):21-37.
[8]王永钦,吴娴.中国创新型货币政策如何发挥作用:抵押品渠道[J].经济研究,2019,54(12):86-101.
[9]唐宜红,俞峰,林发勤,张梦婷.中国高铁、贸易成本与企业出口研究[J].经济研究,2019,54(07):158-173.
[10]张琦,郑瑶,孔东民.地区环境治理压力、高管经历与企业环保投资——一项基于《环境空气质量标准(2012)》的准自然实验[J].经济研究,2019,54(06):183-198.
[11]冯晨,陈舒,白彩全.长期人力资本积累的历史根源:制度差异、儒家文化传播与国家能力塑造[J].经济研究,2019,54(05):146-163.
[12]刘柏惠,寇恩惠,杨龙见.增值税多档税率、资源误置与全要素生产率损失[J].经济研究,2019,54(05):113-128.
[13]陈林,万攀兵.《京都议定书》及其清洁发展机制的减排效应——基于中国参与全球环境治理微观项目数据的分析[J].经济研究,2019,54(03):55-71.
[14]范子英,赵仁杰.法治强化能够促进污染治理吗?——来自环保法庭设立的证据[J].经济研究,2019,54(03):21-37.
[15]夏怡然,陆铭.跨越世纪的城市人力资本足迹——历史遗产、政策冲击和劳动力流动[J].经济研究,2019,54(01):132-149.
[16]毛其淋.人力资本推动中国加工贸易升级了吗?[J].经济研究,2019,54(01):52-67.
[17]齐绍洲,林屾,崔静波.环境权益交易市场能否诱发绿色创新?——基于我国上市公司绿色专利数据的证据[J].经济研究,2018,53(12):129-143.
[18]李明,李德刚,冯强.中国减税的经济效应评估——基于所得税分享改革“准自然试验”[J].经济研究,2018,53(07):121-135.
[19]陈德球,陈运森.政策不确定性与上市公司盈余管理[J].经济研究,2018,53(06):97-111.
[20]杜鹏程,徐舒,吴明琴.劳动保护与农民工福利改善——基于新《劳动合同法》的视角[J].经济研究,2018,53(03):64-78.
[21]许和连,王海成.简政放权改革会改善企业出口绩效吗?——基于出口退(免)税审批权下放的准自然试验[J].经济研究,2018,53(03):157-170.
[22]苏冬蔚,倪博.转融券制度、卖空约束与股价变动[J].经济研究,2018,53(03):110-125.
[23]毕青苗,陈希路,徐现祥,李书娟.行政审批改革与企业进入[J].经济研究,2018,53(02):140-155.
[24]李艳,杨汝岱.地方国企依赖、资源配置效率改善与供给侧改革[J].经济研究,2018,53(02):80-94.
[25]陈林.自然垄断与混合所有制改革——基于自然实验与成本函数的分析[J].经济研究,2018,53(01):81-96.
[26]赵西亮.教育、户籍转换与城乡教育收益率差异[J].经济研究,2017,52(12):164-178.
[27]陆蓉,何婧,崔晓蕾.资本市场错误定价与产业结构调整[J].经济研究,2017,52(11):104-118.
[28]*生,李好,马伟力,林秉旋.融资融券交易的信息治理效应[J].经济研究,2017,52(11):150-164.
[29]钱雪松,方胜.担保物权制度改革影响了民营企业负债融资吗?——来自中国《物权法》自然实验的经验证据[J].经济研究,2017,52(05):146-160.
[30]王朝阳,王振霞.涨跌停、融资融券与股价波动率——基于AH股的比较研究[J].经济研究,2017,52(04):151-165.
[31]范子英,彭飞.“营改增”的减税效应和分工效应:基于产业互联的视角[J].经济研究,2017,52(02):82-95.
[32]马述忠,张洪胜.集群商业信用与企业出口——对中国出口扩张奇迹的一种解释[J].经济研究,2017,52(01):13-27.
[33]余明桂,钟慧洁,范蕊.业绩考核制度可以促进央企创新吗?[J].经济研究,2016,51(12):104-117.
[34]林卉,许尤洋,刘峰.中国资本市场“框架效应”现象的实证研究——基于中组部18号文的自然实验[J].经济研究,2016,51(12):161-175.
[35]刘啟仁,黄建忠.人民币汇率、依市场定价与资源配置效率[J].经济研究,2016,51(12):18-31.
[36]叶青,赵良玉,刘思辰.独立董事“政商旋转门”之考察:一项基于自然实验的研究[J].经济研究,2016,51(06):98-113.
[37]范子英,彭飞,刘冲.政治关联与经济增长——基于卫星灯光数据的研究[J].经济研究,2016,51(01):114-126.
[38]毛其淋,许家云.中间品贸易*化与制造业就业变动——来自中国加入WTO的微观证据[J].经济研究,2016,51(01):69-83.
[39]赵绍阳,臧文斌,尹庆双.医疗保障水平的福利效果[J].经济研究,2015,50(08):130-145.
[40]*生,陈晨,林秉旋.卖空机制提高了中国股票市场的定价效率吗?——基于自然实验的证据[J].经济研究,2015,50(04):165-177.
[41]李科,徐龙炳,朱伟骅.卖空限制与股票错误定价——融资融券制度的证据[J].经济研究,2014,49(10):165-178.
[42]简泽,张涛,伏玉林.进口*化、竞争与本土企业的全要素生产率——基于中国加入WTO的一个自然实验[J].经济研究,2014,49(08):120-132.
[43]范子英,李欣.部长的政治关联效应与财政转移支付分配[J].经济研究,2014,49(06):129-141.
[44]陈刚,李树.司法独立与市场分割——以法官异地交流为实验的研究[J].经济研究,2013,48(09):30-42+70.
[45]范子英,田彬彬.税收竞争、税收执法与企业避税[J].经济研究,2013,48(09):99-111.
[46]简泽,干春晖,余典范.银行部门的市场化、信贷配置与工业重构[J].经济研究,2013,48(05):112-127.
[47]李树,陈刚.环境管制与生产率增长——以APPCL2000的修订为例[J].经济研究,2013,48(01):17-31.
[48]马双,张劼,朱喜.最低工资对中国就业和工资水平的影响[J].经济研究,2012,47(05):132-146.
[49]白重恩,李宏彬,吴斌珍.医疗保险与消费:来自新型农村合作医疗的证据[J].经济研究,2012,47(02):41-53.
[50]叶光亮,邓国营,黎志刚.个人住房贷款行为与房贷调控的有效性分析[J].经济研究,2011,46(S1):105-115.
经济学季刊
[1]王剑程,李丁,马双.宽带建设对农户创业的影响研究——基于“宽带乡村”建设的准自然实验[J].经济学(季刊),2020,19(01):209-232.
[2]李仲飞,于守金,曹夏平.产业信贷政策对于房地产企业债务的影响——基于银行业359号“限贷”文件的准自然实验分析[J].经济学(季刊),2019,18(04):1373-1396.
[3]吕铁,王海成.放松银行准入管制与企业创新——来自股份制商业银行在县域设立分支机构的准自然试验[J].经济学(季刊),2019,18(04):1443-1464.
[4]陈晓红,朱蕾,汪阳洁.驻地效应——来自国家土地督察的经验证据[J].经济学(季刊),2019,18(01):99-122.
[5]刘行,叶康涛,陆正飞.加速折旧政策与企业投资——基于“准自然实验”的经验证据[J].经济学(季刊),2019,18(01):213-234.
[6]毛其淋,许家云.外资进入如何影响了本土企业出口国内附加值?[J].经济学(季刊),2018,17(04):1453-1488.
[7]王智波,韩希.废止收容遣送制度的经济影响——基于检验最优城市理论的实证研究[J].经济学(季刊),2018,17(03):1013-1034.
[8]卢盛峰,吴一平,谢潇.历史名片的经济价值——来自中国城市更名的证据[J].经济学(季刊),2018,17(03):1055-1078.
[9]郭峰,熊瑞祥.地方金融机构与地区经济增长——来自城商行设立的准自然实验[J].经济学(季刊),2018,17(01):221-246.
[10]*,李培鑫,李丽霞.*合作、市场整合与城市群经济绩效——基于长三角城市经济协调会的实证检验[J].经济学(季刊),2017,16(04):1563-1582.
[11]边文龙,王向楠,李冉.保险费率市场化效果的解释和评估[J].经济学(季刊),2017,16(04):1477-1498.
[12]刘怡,耿纯,赵仲匡.出口退税*间分担对产品出口的影响[J].经济学(季刊),2017,16(03):1011-1030.
[13]倪骁然,朱玉杰.卖空压力影响企业的风险行为吗?——来自A股市场的经验证据[J].经济学(季刊),2017,16(03):1173-1198.
[14]毛其淋,许家云.中间品贸易*化提高了企业加成率吗?——来自中国的证据[J].经济学(季刊),2017,16(02):485-524.
[15]刘瑞明,赵仁杰.匿名审稿制度推动了中国的经济学进步吗?——基于双重差分方法的研究[J].经济学(季刊),2017,16(01):173-204.
[16]范子英,田彬彬.政企合谋与企业逃税:来自国税局长异地交流的证据[J].经济学(季刊),2016,15(04):1303-1328.
[17]丘心颖,郑小翠,邓可斌.分析师能有效发挥专业解读信息的作用吗?——基于汉字年报复杂性指标的研究[J].经济学(季刊),2016,15(04):1483-1506.
[18]马榕,石晓军.中国债券信用评级结果具有甄别能力吗?——基于盈余管理敏感性的视角[J].经济学(季刊),2016,15(01):197-216.
[19]李楠,林矗.太平天国战争对近代人口影响的再估计——基于历史自然实验的实证分析[J].经济学(季刊),2015,14(04):1325-1346.
[20]管汉晖,陈博凯.货币的非国家化:汉代中国的经历(前175—前144年)[J].经济学(季刊),2015,14(04):1497-1518.
[21]陈思霞,卢盛峰.分权增加了民生性财政支出吗?——来自中国“省直管县”的自然实验[J].经济学(季刊),2014,13(04):1261-1282.
[22]马双,孟宪芮,甘犁.养老保险企业缴费对员工工资、就业的影响分析[J].经济学(季刊),2014,13(03):969-1000.
[23]马双,甘犁.最低工资对企业在职培训的影响分析[J].经济学(季刊),2014,13(01):1-26.
[24]何浩然.公共政策的效果能否被准确预测?来自中国塑料袋使用限制政策的自然实验证据[J].经济学(季刊),2012,11(04):1305-1322.
[25]雷晓燕.管理医疗模式的影响差异——来自加州医疗救助的经验证据[J].经济学(季刊),2010,9(01):333-348.
管理世界
[1]李永友,王超.集权式财政改革能够缩小城乡差距吗?——基于“乡财县管”准自然实验的证据[J].管理世界,2020,36(04):113-130.
[2]肖静华,胡杨颂,吴瑶.成长品:数据驱动的企业与用户互动创新案例研究[J].管理世界,2020,36(03):183-205.
[3]贾建民,耿维,徐戈,郝辽钢,贾轼.大数据行为研究趋势:一个“时空关”的视角[J].管理世界,2020,36(02):106-116+211-212.
[4]黄俊威,龚光明.融资融券制度与公司资本结构动态调整——基于“准自然实验”的经验证据[J].管理世界,2019,35(10):64-81.
[5]陈林,万攀兵,许莹盈.混合所有制企业的股权结构与创新行为——基于自然实验与断点回归的实证检验[J].管理世界,2019,35(10):186-205.
[6]刘冲,刘晨冉,孙腾.交通基础设施、金融约束与县域产业发展——基于“国道主干线系统”自然实验的证据[J].管理世界,2019,35(07):78-88+203.
[7]周茂,李雨浓,姚星,陆毅.人力资本扩张与中国城市制造业出口升级:来自高校扩招的证据[J].管理世界,2019,35(05):64-77+198-199.
[8]陈胜蓝,马慧.贷款可获得性与公司商业信用——中国利率市场化改革的准自然实验证据[J].管理世界,2018,34(11):108-120+149.
[9]毛其淋,许家云.贸易政策不确定性与企业储蓄行为——基于中国加入WTO的准自然实验[J].管理世界,2018,34(05):10-27+62+179.
[10]赵静,*昌,刘峰.高铁开通与股价崩盘风险[J].管理世界,2018,34(01):157-168+192.
[11]钟覃琳,陆正飞.资本市场开放能提高股价信息含量吗?——基于“沪港通”效应的实证检验[J].管理世界,2018,34(01):169-179.
[12]叶菁菁,吴燕,陈方豪,王宇晴.个人所得税减免会增加劳动供给吗?——来自准自然实验的证据[J].管理世界,2017(12):20-32+187.
[13]谢贞发,严瑾,李培.中国式“压力型”财政激励的财源增长效应——基于取消农业税改革的实证研究[J].管理世界,2017(12):46-60+187-188.
[14]刘行,赵健宇,叶康涛.企业避税、债务融资与债务融资来源——基于所得税征管*改革的断点回归分析[J].管理世界,2017(10):113-129.
[15]李超,李涵.空气污染对企业库存的影响——基于我国制造业企业数据的实证研究[J].管理世界,2017(08):95-105.
[16]李文贵,余明桂,钟慧洁.央企董事会试点、国有上市公司代理成本与企业绩效[J].管理世界,2017(08):123-135+153.
[17]陈胜蓝,马慧.卖空压力与公司并购——来自卖空管制放松的准自然实验证据[J].管理世界,2017(07):142-156.
[18]申广军,邹静娴.企业规模、政企关系与实际税率——来自世界银行“投资环境调查”的证据[J].管理世界,2017(06):23-36.
[19]卢盛峰,陈思霞.*偏袒缓解了企业融资约束吗?——来自中国的准自然实验[J].管理世界,2017(05):51-65+187-188.
[20]顾乃康,周艳利.卖空的事前威慑、公司治理与企业融资行为——基于融资融券制度的准自然实验检验[J].管理世界,2017(02):120-134.
[21]权小锋,尹洪英.中国式卖空机制与公司创新——基于融资融券分步扩容的自然实验[J].管理世界,2017(01):128-144+187-188.
[22]倪骁然,朱玉杰.劳动保护、劳动密集度与企业创新——来自2008年《劳动合同法》实施的证据[J].管理世界,2016(07):154-167.
[23]许伟,陈斌开.税收激励和企业投资——基于2004~2009年增值税转型的自然实验[J].管理世界,2016(05):9-17.
[24]范子英,刘甲炎.为买房而储蓄——兼论房产税改革的收入分配效应[J].管理世界,2015(05):18-27+187.
[25]李涵,唐丽淼.交通基础设施投资、空间溢出效应与企业库存[J].管理世界,2015(04):126-136.
[26]贾俊雪,宁静.纵向财政治理结构与地方*职能优化——基于省直管县财政*改革的拟自然实验分析[J].管理世界,2015(01):7-17+187.
[27]余淼杰,梁中华.贸易*化与中国劳动收入份额——基于制造业贸易企业数据的实证分析[J].管理世界,2014(07):22-31.
[28]刘行,叶康涛.金融发展、产权与企业税负[J].管理世界,2014(03):41-52.
[29]李泽广,马泽昊.契约环境、代理成本与企业投资—债务期限关系[J].管理世界,2013(08):183-185.
[30]叶青,李增泉,李光青.富豪榜会影响企业会计信息质量吗?——基于政治成本视角的考察[J].管理世界,2012(01):104-120.
[31]郑新业,王晗,赵益卓.“省直管县”能促进经济增长吗?——双重差分方法[J].管理世界,2011(08):34-44+65.
[32]王贤彬,聂海峰.行政区划调整与经济增长[J].管理世界,2010(04):42-53.
[33]贾明,张喆.高管的政治关联影响公司慈善行为吗?[J].管理世界,2010(04):99-113+187.
[34]聂辉华,方明月,李涛.增值税转型对企业行为和绩效的影响——以东北地区为例[J].管理世界,2009(05):17-24+35.
[35]攀登,施东晖,宋铮.证券市场泡沫的生成机理分析——基于宝钢权证自然实验的实证研究[J].管理世界,2008(04):15-23+186.
世界经济
[1]吉赟,杨青.高铁开通能否促进企业创新:基于准自然实验的研究[J].世界经济,2020,43(02):147-166.
[2]毛其淋,方森辉.外资进入*化如何影响中国制造业生产率[J].世界经济,2020,43(01):143-169.
[3]刘灿雷,王永进.出口扩张与企业间工资差距:影响与机制[J].世界经济,2019,42(12):99-120.
[4]林志帆,龙晓旋.卖空威胁能否激励中国企业创新[J].世界经济,2019,42(09):126-150.
[5]李嘉楠,代谦,庄嘉霖.开放、市场整合与经济空间变迁:基于近代中国开埠的证据[J].世界经济,2019,42(09):27-51.
[6]李磊,王小霞,蒋殿春,方森辉.中国最低工资上升是否导致了外资撤离[J].世界经济,2019,42(08):97-120.
[7]郭俊杰,方颖,杨阳.排污费征收标准改革是否促进了中国工业二氧化硫减排[J].世界经济,2019,42(01):121-144.
[8]蒋灵多,陆毅,陈勇兵.市场机制是否有利于僵尸企业处置:以外资管制放松为例[J].世界经济,2018,41(09):121-145.
[9]施震凯,邵军,浦正宁.交通基础设施改善与生产率增长:来自铁路大提速的证据[J].世界经济,2018,41(06):127-151.
[10]李胜旗,毛其淋.关税政策不确定性如何影响就业与工资[J].世界经济,2018,41(06):28-52.
[11]曾建光,步丹璐,饶品贵.无偿划转、*补贴与社会福利[J].世界经济,2017,40(07):147-168.
[12]马双,邱光前.最低工资对中国劳动密集型出口产品价格的影响[J].世界经济,2016,39(11):80-103.
[13]周茂,陆毅,符大海.贸易*化与中国产业升级:事实与机制[J].世界经济,2016,39(10):78-102.
[14]彭飞,范子英.税收优惠、捐赠成本与企业捐赠[J].世界经济,2016,39(07):144-167.
[15]代谦,别朝霞.财政压力的经济后果:以宋朝的“靖康之变”为例[J].世界经济,2015,38(01):173-192.
[16]戴觅,茅锐.外需冲击、企业出口与内销:金融危机时期的经验证据[J].世界经济,2015,38(01):81-104.
[17]田巍,余淼杰.中间品贸易*化和企业研发:基于中国数据的经验分析[J].世界经济,2014,37(06):90-112.
[18]刘甲炎,范子英.中国房产税试点的效果评估:基于合成控制法的研究[J].世界经济,2013,36(11):117-135.
[19]王永进,盛丹.经济波动、劳动力市场摩擦与产业结构[J].世界经济,2013,36(04):22-46.
[20]何浩然,陈叶烽.禀赋获得方式影响被试行为是否存在性别差异:来自自然现场实验的证据[J].世界经济,2012,35(04):102-117.
[21]周浩,郑筱婷.交通基础设施质量与经济增长:来自中国铁路提速的证据[J].世界经济,2012,35(01):78-97.
[22]冯皓,陆铭.通过买房而择校:教育影响房价的经验证据与政策含义[J].世界经济,2010,33(12):89-104.
[23]曾海舰,苏冬蔚.信贷政策与公司资本结构[J].世界经济,2010,33(08):17-42.
金融研究
[1]吕朝凤,毛霞.地方金融发展能够影响FDI的区位选择吗?——一个基于城市商业银行设立的准自然实验[J].金融研究,2020(03):58-76.
[2]许红梅,李春涛.劳动保护、社保压力与企业违约风险——基于《社会保险法》实施的研究[J].金融研究,2020(03):115-133.
[3]胡珺,黄楠,沈洪涛.市场激励型环境规制可以推动企业技术创新吗?——基于中国碳排放权交易机制的自然实验[J].金融研究,2020(01):171-189.
[4]诸竹君,黄先海,王煌.交通基础设施改善促进了企业创新吗?——基于高铁开通的准自然实验[J].金融研究,2019(11):153-169.
[5]鲁元平,赵颖,石智雷.产假政策与子女长期人力资本积累[J].金融研究,2019(11):57-74.
[6]刘杰,陈佳,刘力.投资者关注与市场反应——来自中国证券交易所交易公开信息的自然实验[J].金融研究,2019(11):189-206.
[7]陈胜蓝,刘晓玲.中国城际高铁与商业信用供给——基于准自然实验的研究[J].金融研究,2019(10):117-134.
[8]张*,王永进,李坤望.贸易*化对制造业企业现金储蓄的影响——预防性动机还是投资挤压?[J].金融研究,2019(09):19-38.
[9]段白鸽,王永钦,夏梦嘉.金融创新如何缓解信任品市场失灵?——中国食品安全责任强制保险的自然实验[J].金融研究,2019(09):75-93.
[10]陈运森,黄健峤.股票市场开放与企业投资效率——基于“沪港通”的准自然实验[J].金融研究,2019(08):151-170.
[11]钱雪松,唐英伦,方胜.担保物权制度改革降低了企业债务融资成本吗?——来自中国《物权法》自然实验的经验证据[J].金融研究,2019(07):115-134.
[12]卞元超,吴利华,白俊红.高铁开通是否促进了区域创新?[J].金融研究,2019(06):132-149.
[13]杨筝,王红建,戴静,许传华.放松利率管制、利润率均等化与实体企业“脱实向虚”[J].金融研究,2019(06):20-38.
[14]张鹏杨,徐佳君,刘会政.产业政策促进全球价值链升级的有效性研究——基于出口加工区的准自然实验[J].金融研究,2019(05):76-95.
[15]杨青,吉赟,王亚男.高铁能提升分析师盈余预测的准确度吗?——来自上市公司的证据[J].金融研究,2019(03):168-188.
[16]李建军,韩珣.普惠金融、收入分配和贫困减缓——推进效率和公平的政策框架选择[J].金融研究,2019(03):129-148.
[17]李广众,贾凡胜.*财政激励、税收征管动机与企业盈余管理——以财政“省直管县”改革为自然实验的研究[J].金融研究,2019(02):78-97.
[18]王永钦,徐鸿恂.杠杆率如何影响资产价格?——来自中国债券市场自然实验的证据[J].金融研究,2019(02):20-39.
[19]毛其淋.外资进入*化如何影响了中国本土企业创新?[J].金融研究,2019(01):72-90.
[20]苏冬蔚,连莉莉.绿色信贷是否影响重污染企业的投融资行为?[J].金融研究,2018(12):123-137.
[21]郑志刚,刘思敏,黄继承.我国上市公司策略性股票更名:战略转型还是高位*?[J].金融研究,2018(10):158-173.
[22]陈康,刘琦.股价信息含量与投资-股价敏感性——基于融资融券的准自然实验[J].金融研究,2018(09):126-142.
[23]朱莹,王健.市场约束能够降低地方债风险溢价吗?——来自城投债市场的证据[J].金融研究,2018(06):56-72.
[24]王永钦,陈映辉,熊雅文.存款保险制度如何影响公众对不同银行的信心?——来自中国的证据[J].金融研究,2018(06):109-122.
[25]王芳,陈硕,王瑾.农业税减免、农业发展与地方*行为——县级证据[J].金融研究,2018(04):104-120.
[26]叶康涛,刘芳,李帆.股指成份股调整与股价崩盘风险:基于一项准自然实验的证据[J].金融研究,2018(03):172-189.
[27]王红建,杨筝,阮刚铭,曹瑜强.放松利率管制、过度负债与债务期限结构[J].金融研究,2018(02):100-117.
[28]姜军,申丹琳,江轩宇,伊志宏.债权人保护与企业创新[J].金融研究,2017(11):128-142.
[29]王攀娜,罗宏.放松卖空管制对分析师预测行为的影响——来自中国准自然实验的证据[J].金融研究,2017(11):191-206.
[30]李春涛,刘贝贝,周鹏.卖空与信息披露:融券准自然实验的证据[J].金融研究,2017(09):130-145.
[31]胡婷,惠凯,彭红枫.异常波动停牌对股价波动性和流动性的影响研究——来自我国取消异常波动停牌的自然实验[J].金融研究,2017(09):146-160.
[32]杨晓兰,金雪军.我国股票市场熔断机制的磁力效应:基于自然实验的证据[J].金融研究,2017(09):161-177.
[33]曹春方,陈露兰,张婷婷.“法律的名义”:司法独立性提升与公司违规[J].金融研究,2017(05):191-206.
[34]杨筝,刘放,李茫茫.利率市场化、非效率投资与资本配置——基于中国人民银行取消贷款利率上下限的自然实验[J].金融研究,2017(05):81-96.
[35]王兵,戴敏,武文杰.环保基地政策提高了企业环境绩效吗?——来自东莞市企业微观面板数据的证据[J].金融研究,2017(04):143-160.
[36]冯根福,刘虹,冯照桢,温军.股票流动性会促进我国企业技术创新吗?[J].金融研究,2017(03):192-206.
[37]侯青川,靳庆鲁,刘阳.放松卖空管制与公司现金价值——基于中国资本市场的准自然实验[J].金融研究,2016(11):112-127.
[38]张三峰,张伟.融资约束、金融发展与企业雇佣——来自中国企业调查数据的经验证据[J].金融研究,2016(10):111-126.
[39]王茂斌,孔东民.反腐败与中国公司治理优化:一个准自然实验[J].金融研究,2016(08):159-174.
[40]卢盛峰,陈思霞.政策偏袒的经济收益:来自中国工业企业出口的证据[J].金融研究,2016(07):33-47.
[41]张龙耀,杨骏,程恩江.融资杠杆监管与小额贷款公司“覆盖率-可持续性”权衡——基于分层监管的准自然实验[J].金融研究,2016(06):142-158.
[42]陈海强,韩乾,吴锴.融资约束抑制技术效率提升吗?——基于制造业微观数据的实证研究[J].金融研究,2015(10):148-162.
[43]*生,杜爽,林秉旋.卖空交易与股票价格稳定性——来自中国融资融券市场的自然实验[J].金融研究,2015(06):173-188.
[44]汪小圈,张红,刘冲.幼年饥荒经历对个人自雇选择的影响[J].金融研究,2015(05):18-33.
[45]曾建光,伍利娜,王立彦,諶家蘭.技术进步、信息透明度与开放式基金的资金流量——基于中国开放式基金强制采用XBRL的证据[J].金融研究,2014(08):131-145.
[46]马光荣,刘明,杨恩艳.银行授信、信贷紧缩与企业研发[J].金融研究,2014(07):76-93.
[47]梁中华,余淼杰.人民币升值与中国出口企业盈利能力——基于面板数据的实证分析[J].金融研究,2014(07):1-15.
[48]简泽.银行债权治理、管理者偏好与国有企业的绩效[J].金融研究,2013(01):135-148.
[49]余静文.信贷约束、股利分红与企业预防性储蓄动机——来自中国A股上市公司的证据[J].金融研究,2012(10):97-110.
统计研究
[1]王亚飞,廖甍,王亚菲.高铁开通促进了农业全要素生产率增长吗?——来自长三角地区准自然实验的经验证据[J].统计研究,2020,37(05):40-53.
[2]胡宗义,李毅.环境信息披露的污染减排效应评估[J].统计研究,2020,37(04):59-74.
[3]严文龙,陈宋生,田至立.审计定价管制与交易剩余——2010年审计定价管制失效的自然实验[J/OL].统计研究:1-11[2020-06-05].http://kns.cnki.net/kcms/detail/11.1302.C.20200325.1534.002.html.
[4]王立勇,许明.中国精准扶贫政策的减贫效应研究:来自准自然实验的经验证据[J].统计研究,2019,36(12):15-26.
[5]许家云.互联网如何影响工业结构升级?——基于互联网商用的自然实验[J].统计研究,2019,36(12):55-67.
[6]邹伟,梁平汉.腾飞的翅膀:机场属地化改革与企业库存[J].统计研究,2019,36(11):76-89.
[7]徐超,庞保庆,张充.降低实体税负能否遏制制造业企业“脱实向虚”[J].统计研究,2019,36(06):42-53.
[8]卢盛峰,陈思霞,张东杰.*推动型城市化促进了县域经济发展吗[J].统计研究,2017,34(05):59-68.
[9]许坤,苏扬.逆周期资本监管、监管压力与银行信贷研究[J].统计研究,2016,33(03):97-105.
中国工业经济
[1]谭小芬,钱佳琪.资本市场压力与企业策略性专利行为:卖空机制的视角[J].中国工业经济,2020(05):156-173.
[2]于新亮,上官熠文,于文广,李倩.养老保险缴费率、资本——技能互补与企业全要素生产率[J].中国工业经济,2019(12):96-114.
[3]饶品贵,王得力,李晓溪.高铁开通与供应商分布决策[J].中国工业经济,2019(10):137-154.
[4]王雄元,卜落凡.国际出口贸易与企业创新——基于“中欧班列”开通的准自然实验研究[J].中国工业经济,2019(10):80-98.
[5]黄溶冰,赵谦,王丽艳.自然资源资产离任审计与空气污染防治:“和谐锦标赛”还是“环保资格赛”[J].中国工业经济,2019(10):23-41.
[6]张国建,佟孟华,李慧,陈飞.扶贫改革试验区的经济增长效应及政策有效性评估[J].中国工业经济,2019(08):136-154.
[7]孟庆斌,李昕宇,张修平.卖空机制、资本市场压力与公司战略选择[J].中国工业经济,2019(08):155-173.
[8]徐思,何晓怡,钟凯.“一带一路”倡议与中国企业融资约束[J].中国工业经济,2019(07):155-173.
[9]任胜钢,郑晶晶,刘东华,陈晓红.排污权交易机制是否提高了企业全要素生产率——来自中国上市公司的证据[J].中国工业经济,2019(05):5-23.
[10]宋贺,段军山.财务顾问与企业并购绩效[J].中国工业经济,2019(05):155-173.
[11]史贝贝,冯晨,康蓉.环境信息披露与外商直接投资结构优化[J].中国工业经济,2019(04):98-116.
[12]王桂军,卢潇潇.“一带一路”倡议与中国企业升级[J].中国工业经济,2019(03):43-61.
[13]魏悦羚,张洪胜.进口*化会提升中国出口国内增加值率吗——基于总出口核算框架的重新估计[J].中国工业经济,2019(03):24-42.
[14]孙雪娇,翟淑萍,于苏.柔性税收征管能否缓解企业融资约束——来自纳税信用评级披露自然实验的证据[J].中国工业经济,2019(03):81-99.
[15]吴晓晖,郭晓冬,乔政.机构投资者抱团与股价崩盘风险[J].中国工业经济,2019(02):117-135.
[16]贾俊雪,李紫霄,秦聪.社会保障与经济增长:基于拟自然实验的分析[J].中国工业经济,2018(11):42-60.
[17]刘友金,曾小明.房产税对产业转移的影响:来自重庆和上海的经验证据[J].中国工业经济,2018(11):98-116.
[18]蒋灵多,陆毅.市场竞争加剧是否助推国有企业加杠杆[J].中国工业经济,2018(11):155-173.
[19]钱雪松,康瑾,唐英伦,曹夏平.产业政策、资本配置效率与企业全要素生产率——基于中国2009年十大产业振兴规划自然实验的经验研究[J].中国工业经济,2018(08):42-59.
[20]诸竹君,黄先海,余骁.进口中间品质量、自主创新与企业出口国内增加值率[J].中国工业经济,2018(08):116-134.
[21]李蕾蕾,盛丹.地方环境立法与中国制造业的行业资源配置效率优化[J].中国工业经济,2018(07):136-154.
[22]李贲,吴利华.开发区设立与企业成长:异质性与机制研究[J].中国工业经济,2018(04):79-97.
[23]龙小宁,林菡馨.专利执行保险的创新激励效应[J].中国工业经济,2018(03):116-135.
[24]周茂,陆毅,杜艳,姚星.开发区设立与地区制造业升级[J].中国工业经济,2018(03):62-79.
[25]余静文.企业国有化中的*角色[J].中国工业经济,2018(03):155-173.
[26]刘瑞明,李林,亢延锟,赵勇.景点评选、*公共服务供给与地区旅游经济发展[J].中国工业经济,2018(02):118-136.
[27]王永进,冯笑.行政审批制度改革与企业创新[J].中国工业经济,2018(02):24-42.
[28]史贝贝,冯晨,张妍,杨菲.环境规制红利的边际递增效应[J].中国工业经济,2017(12):40-58.
[29]蒋灵多,陆毅.最低工资标准能否抑制新僵尸企业的形成[J].中国工业经济,2017(11):118-136.
[30]张小茜,孙璐佳.抵押品清单扩大、过度杠杆化与企业破产风险——动产抵押法律改革的“双刃剑”效应[J].中国工业经济,2017(07):175-192.
[31]龙小宁,万威.环境规制、企业利润率与合规成本规模异质性[J].中国工业经济,2017(06):155-174.
[32]简泽,谭利萍,吕大国,符通.市场竞争的创造性、破坏性与技术升级[J].中国工业经济,2017(05):16-34.
[33]王兵,聂欣.产业集聚与环境治理:助力还是阻力——来自开发区设立准自然实验的证据[J].中国工业经济,2016(12):75-89.
[34]林乐,郑登津.退市监管与股价崩盘风险[J].中国工业经济,2016(12):58-74.
[35]何靖.延付高管薪酬对银行风险承担的政策效应——基于银行盈余管理动机视角的PSM-DID分析[J].中国工业经济,2016(11):126-143.
[36]龙小宁,张训常,杨进.转轨背景下官员兼职规制的经济效应[J].中国工业经济,2016(07):40-56.
[37]罗知,赵奇伟,严兵.约束机制和激励机制对国有企业长期投资的影响[J].中国工业经济,2015(10):69-84.
[38]赵晶,张书博,祝丽敏.传承人合法性对家族企业战略变革的影响[J].中国工业经济,2015(08):130-144.
[39]吴海民,吴淑娟,陈辉.城市文明、交易成本与企业“第四利润源”——基于全国文明城市与民营上市公司核匹配倍差法的证据[J].中国工业经济,2015(07):114-129.
[40]范子英.土地财政的根源:财政压力还是投资冲动[J].中国工业经济,2015(06):18-31.
[41]韩超,胡浩然.清洁生产标准规制如何动态影响全要素生产率——剔除其他政策干扰的准自然实验分析[J].中国工业经济,2015(05):70-82.
[42]唐明哲,刘丰波,林平.价格检验在相关市场界定中的实证运用——对茅台、五粮液垄断案的再思考[J].中国工业经济,2015(04):135-148.
会计研究
[1]朱焱,王玉丹.卖空机制与企业社会责任承担——基于中国融资融券制度的准自然实验研究[J].会计研究,2019(12):58-64.
[2]刘行,赵健宇.税收激励与企业创新——基于增值税转型改革的“准自然实验”[J].会计研究,2019(09):43-49.
[3]崔学刚,邓衢,邝文俊.卖空交易、市场行情与股价崩盘风险[J].会计研究,2019(06):43-50.
[4]张金丹,路军,李连华.审计报告中披露关键审计事项信息有助于提高审计质量吗?——报表盈余和市场感知双维度的经验证据[J].会计研究,2019(06):85-91.
[5]陈运森,黄健峤,韩慧云.股票市场开放提高现金股利水平了吗?——基于“沪港通”的准自然实验[J].会计研究,2019(03):55-62.
[6]钱雪松,代禹斌,陈琳琳,方胜.担保物权制度改革、融资约束与企业现金持有——基于中国《物权法》自然实验的经验证据[J].会计研究,2019(01):72-78.
[7]王仲兵,王攀娜.放松卖空管制与企业投资效率——来自中国资本市场的经验证据[J].会计研究,2018(09):80-87.
[8]郝颖,谢光华,石锐.外部监管、在职消费与企业绩效[J].会计研究,2018(08):42-48.
[9]吴战篪,陈相伊,吴伟立.融资融券制度与资产增长效应[J].会计研究,2017(06):89-95+97.
[10]李丹,袁淳,廖冠民.卖空机制与分析师乐观性偏差——基于双重差分模型的检验[J].会计研究,2016(09):25-31.
[11]刘运国,刘梦宁.雾霾影响了重污染企业的盈余管理吗?——基于政治成本假说的考察[J].会计研究,2015(03):26-33+94.
[12]王春飞,陆正飞.事务所“改制”、保险价值与投资者保护[J].会计研究,2014(05):81-87+95.
[13]陈运森,郑登津,李路.民营企业发审委社会关系、IPO资格与上市后表现[J].会计研究,2014(02):12-19+94.
[14]曾建光,伍利娜,谌家兰,王立彦.XBRL、代理成本与绩效水平——基于中国开放式基金市场的证据[J].会计研究,2013(11):88-94+96.
世界经济文汇
[1]蓝嘉俊,方颖,魏下海.性别比失衡下的婚姻匹配与劳动力市场表现——基于独生子女政策准自然实验的实证分析[J].世界经济文汇,2019(04):67-84.
[2]赵琳,唐珏,陈诗一.环保管理*垂直化改革的环境治理效应[J].世界经济文汇,2019(02):100-120.
[3]周梦天,王之.空气质量信息公开会影响城市房价吗?——基于我国各城市公开PM2.5监测数据的自然实验[J].世界经济文汇,2018(03):20-42.
[4]傅家范,刘冲.*注资、存款优势与国有银行反危机信贷投放[J].世界经济文汇,2017(05):75-90.
[5]刘金山,*.对口支援政策有效吗?——来自19省市对口援疆自然实验的证据[J].世界经济文汇,2017(04):43-61.
[6]陈怡安.父母政治身份、职位背景与子女创业[J].世界经济文汇,2017(01):26-50.
[7]范子英.为买房而离婚——基于住房限购政策的研究[J].世界经济文汇,2016(04):1-17.
中国人口、资源与环境
[1]王为东,王冬,卢娜.中国碳排放权交易促进低碳技术创新机制的研究[J].中国人口·资源与环境,2020,30(02):41-48.
[2]胡江峰,黄庆华,潘欣欣.碳排放交易制度与企业创新质量:抑制还是促进[J].中国人口·资源与环境,2020,30(02):49-59.
[3]张晖,吴霜,张燕媛,虞祎.流域生态补偿政策对受偿地区经济增长的影响研究——以安徽省黄山市为例[J].长江流域资源与环境,2019,28(12):2848-2856.
[4]刘常建,许为宾,蔡兰,张孝静.环保压力与重污染企业的银行贷款契约——基于“PM_(2.5)爆表”事件的经验证据[J].中国人口·资源与环境,2019,29(12):121-130.
[5]龚梦琪,刘海云,姜旭.中国低碳试点政策对外商直接投资的影响研究[J].中国人口·资源与环境,2019,29(06):50-57.
[6]尤济红,陈喜强.区域一体化合作是否导致污染转移——来自长三角城市群扩容的证据[J].中国人口·资源与环境,2019,29(06):118-129.
[7]翟华云,刘亚伟.环境司法专门化促进了企业环境治理吗?——来自专门环境法庭设置的准自然实验[J].中国人口·资源与环境,2019,29(06):138-147.
[8]张楠,卢洪友,黄健.资源枯竭城市转移支付对经济增长的影响[J].中国人口·资源与环境,2019,29(04):147-156.
[9]赵领娣,徐乐.基于长三角扩容准自然实验的区域一体化水污染效应研究[J].中国人口·资源与环境,2019,29(03):50-61.
[10]温湖炜,周凤秀.环境规制与中国省域绿色全要素生产率——兼论对《环境保护税法》实施的启示[J].干旱区资源与环境,2019,33(02):9-15.
[11]景守武,张捷.新安江流域横向生态补偿降低水污染强度了吗?[J].中国人口·资源与环境,2018,28(10):152-159.
[12]黄志平.碳排放权交易有利于碳减排吗?——基于双重差分法的研究[J].干旱区资源与环境,2018,32(09):32-36.
[13]雷平,曹黎明,赵连荣.乡土官员对区域经济与环境发展路径的影响[J].中国人口·资源与环境,2018,28(04):163-176.
[14]何文剑,徐静文,张红霄.森林采伐限额管理制度能否起到保护森林资源的作用[J].中国人口·资源与环境,2016,26(07):128-136.
[15]何浩然,陈安来.中国限制塑料袋使用的政策效果及国际经验借鉴[J].中国人口·资源与环境,2010,20(11):167-174.
中国农村经济
[1]罗斯炫,何可,张俊飚.增产加剧污染?——基于粮食主产区政策的经验研究[J].中国农村经济,2020(01):108-131.
[2]丁从明,吴羽佳,秦姝媛,梁甄桥.社会信任与公共政策的实施效率——基于农村居民新农保参与的微观证据[J].中国农村经济,2019(05):109-123.
[3]胡新艳,陈小知,米运生.农地整合确权政策对农业规模经营发展的影响评估——来自准自然实验的证据[J].中国农村经济,2018(12):83-102.
[4]周振,张琛,彭超,孔祥智.农业机械化与农民收入:来自农机具购置补贴政策的证据[J].中国农村经济,2016(02):68-82.
国际贸易问题
[1]曾守桢,余官胜.行政审批简化与我国对外直接投资增长——基于核准权下放试点的准自然实验实证研究[J].国际贸易问题,2020(04):19-34.
[2]刘冲,张辉,吴群锋.进口竞争与企业产品专业化——基于中国多产品企业的研究[J].国际贸易问题,2020(03):22-39.
[3]高翔,袁凯华.清洁生产环境规制与企业出口技术复杂度——微观证据与影响机制[J].国际贸易问题,2020(02):93-109.
[4]吴嵩博,崔凡.融资约束与中国企业出口市场偏好——基于开发区准自然实验的实证分析[J].国际贸易问题,2020(02):157-174.
[5]杨珍增,杨宏.美国“301调查”征税清单调整的政治经济学分析[J].国际贸易问题,2020(01):82-93.
[6]张彩云.科技标准型环境规制与企业出口动态——基于清洁生产标准的一次自然实验[J].国际贸易问题,2019(12):32-45.
[7]王毅,黄先海,余骁.环境规制是否降低了中国企业出口国内附加值率[J].国际贸易问题,2019(10):117-131.
[8]兰健,张洪胜.集群商业信用与出口产品质量——来自中国企业层面的证据[J].国际贸易问题,2019(09):12-25.
[9]黄先海,王煌,陈航宇.人口集聚如何影响出口企业加成率:理论机制与经验证据[J].国际贸易问题,2019(07):1-18.
[10]张鹏杨,李众宜,毛海涛.产业政策如何影响企业出口二元边际[J].国际贸易问题,2019(07):47-62.
[11]孙林,胡玲菲,方巧云.中国*贸易区战略提升中国进口食品质量了吗——基于双重差分模型[J].国际贸易问题,2019(05):54-68.
[12]胡浩然.产业政策如何影响出口企业绩效——基于出口加工区企业样本的准自然实验[J].国际贸易问题,2018(12):27-38.
[13]章韬,戚人杰.集聚-出口双促进政策的溢出效应——来自出口加工区的微观企业证据[J].国际贸易问题,2017(03):26-38.
[14]彭冬冬,杜运苏.中间品贸易*化、融资约束与贸易方式转型[J].国际贸易问题,2016(12):52-63.
[15]杜艳,周茂,李雨浓.贸易*化能否提高中国制造业企业资源再配置效率——基于中国加入WTO的倍差法分析[J].国际贸易问题,2016(09):38-49.
[16]项后军,何康.自贸区的影响与资本流动——以上海为例的自然实验研究[J].国际贸易问题,2016(08):3-15.
[17]刘啟仁,黄建忠.贸易*化、企业动态与行业生产率变化——基于我国加入WTO的自然实验[J].国际贸易问题,2016(01):27-37.
[18]申萌,曾燕萍,曲如晓.环境规制与企业出口:来自千家企业节能行动的微观证据[J].国际贸易问题,2015(08):43-50.
南开管理评论
[1]田利辉,王可第.腐败惩治的正外部性和企业创新行为[J].南开管理评论,2020,23(02):121-131+154.
[2]胡宁,王雪方,孙莲珂,靳庆鲁.房产限购政策有助于实体企业“脱虚返实”吗——基于双重差分研究设计[J].南开管理评论,2019,22(04):20-31.
[3]马惠娴,佟爱琴.卖空机制对高管薪酬契约的治理效应——来自融资融券制度的准自然实验[J].南开管理评论,2019,22(02):61-74.
[4]何威风,陈莉萍,刘巍.业绩考核制度会影响企业盈余管理行为吗[J].南开管理评论,2019,22(01):17-30.
[5]田轩,孟清扬.股权激励计划能促进企业创新吗[J].南开管理评论,2018,21(03):176-190.
[6]陈怡欣,张俊瑞,汪方军.卖空机制对上市公司创新的影响研究——基于我国融资融券制度的自然实验[J].南开管理评论,2018,21(02):62-74.
[7]黄俊,黄超,位豪强,王敏.卖空机制提高了分析师盈余预测质量吗——基于融资融券制度的经验证据[J].南开管理评论,2018,21(02):135-148.
[8]孙光国,孙瑞琦.控股股东委派执行董事能否提升公司治理水平[J].南开管理评论,2018,21(01):88-98+108.
[9]沈洪涛,周艳坤.环境执法监督与企业环境绩效:来自环保约谈的准自然实验证据[J].南开管理评论,2017,20(06):73-82.
[10]李茫茫,黎文靖.审计具有保险功能吗——基于*官员变更的自然实验[J].南开管理评论,2017,20(04):93-104.
[11]陈运森,郑登津.董事网络关系、信息桥与投资趋同[J].南开管理评论,2017,20(03):159-171.
[12]贾凡胜,吴昱,廉柯赟.股利税差别化、现金分红与代理问题——基于财税[2012]85号文件的研究[J].南开管理评论,2016,19(01):142-154.
[13]徐莉萍,辛宇.媒体治理与中小投资者保护[J].南开管理评论,2011,14(06):36-47+94.
管理科学学报
[1]李沁洋,许年行.资本市场对外开放与股价崩盘风险——来自沪港通的证据[J].管理科学学报,2019,22(08):108-126.
[2]张岩,吴芳,吴晓晖.IPO募资双重管制与资源配置——基于自然实验的经验证据[J].管理科学学报,2018,21(11):76-91.
[3]刘志红,王艺明.“省直管县”改革能否提升县级财力水平?[J].管理科学学报,2018,21(10):1-13.
[4]陈胜蓝,卢锐.卖空压力与控股股东私利侵占——来自卖空管制放松的准自然实验证据[J].管理科学学报,2018,21(04):67-85.
[5]金宇超,靳庆鲁,严青蕾.合谋与胁迫:作为经济主体的媒体行为——基于新闻敲诈曝光的事件研究[J].管理科学学报,2018,21(03):1-22.
[6]才静涵,夏乐.卖空制度、流动性与信息不对称问题研究——香港市场的个案[J].管理科学学报,2011,14(02):71-85.
[7]王志强,吴世农.我国股票市场透明度变革效应研究[J].管理科学学报,2008,11(05):110-119.
社会学研究
[1]哈巍,赵颖.教学相“涨”:高校学生成绩和评教分数双重膨胀研究[J].社会学研究,2019,34(01):84-105+243-244.
[2]程诚.同伴社会资本与学业成就——基于随机分配自然实验的案例分析[J].社会学研究,2017,32(06):141-164+245.
中国的准自然实验真多!
-
35 岁实现财务*,腾讯程序员手握2300万提前退休?-1000万房产、1000万腾讯股票、加上300万的现金,一共2300万的财产。有网友算了一笔账,假设1000万的房产用于自住,剩下1300万资产按照平均税后20-50万不等进行计算,大约花上26-60年左右的时间才能赚到这笔钱。也就是说,普通人可能奋斗一辈子,才能赚到这笔钱。在很多人还在为中年危机而惶惶不可终日的时候,有的人的35岁,就已经安全着陆,试问哪个打工人不羡慕?但问题是有这样财富积累必然有像样的实力做靠山。没有人可以不劳而获。
看到这里,肯定有人说,那么对于普通人来说,卷可能真就成了唯一的出路。但是卷也有轻松的卷,“偷懒”的卷法,对于程序员而言,刨除掉一时无法改掉的开会传统占用的大部分时间,如何把有限的时间和精力放在真正重要的架构设计、需求设计上,而不是重复的造*,编码、改bug、手动测试。因此在科技改变生活的今天,学会使用AI工具成为程序员们的必备技能。
以全栈式全自动的软件开发工具飞算SoFlu软件机器人为例,作为全球首款面向微服务架构设计和最佳实践的软件机器人,SoFlu软件机器人改变了原来手工编码的作业模式,通过可视化拖拽方式以及参数配置就能实现等同于编写复杂代码的业务逻辑,在设计业务逻辑时就完成了微服务应用开发,做到“业务即图,图即代码”,实现“软件开发,十倍提效”。
而作为飞算SoFlu软件机器人的一个重要组成部分,FuncGPT(慧函数)支持所有类型函数创建。通过自然语言描述Java函数需求,实时生成高质量、高可读性的Java函数代码。生成代码可直接复制到IDEA,或一键导入Java全自动开发工具函数库。
FuncGPT(慧函数)具有五大核心能力:
● 自然语言:通过自然语言即可生成函数,降低软件开发门槛。
● 秒级函数开发:全自动秒级开发函数,秒级完成,效率千倍提升。
● 一站式函数开发应用:函数生成即可直接应用,效率、安全有保障。
● 质量可靠:生成的函数代码符合业界规范、具备良好的可读性,符合最优解。
● 灵活生成:可以根据开发人员的具体需求生成并支持调整和修改。
以“将文件流转换为File对象”这个需求为例,以下是FuncGPT(慧函数)秒级生成的代码:
/ 类名:FileConverter
// 函数名:convertStreamToFile
// 函数功能:将文件流转换为File对象
// POM依赖包:无
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
public class FileConverter {
/**
* 将文件流转换为File对象
* @param inputStream 文件流
* @param filePath 文件路径
* @param fileName 文件名
* @return 转换后的File对象
* @throws IOException 如果发生I/O异常
*/
public static File convertStreamToFile(InputStream inputStream, String filePath, String fileName) throws IOException {
File file = new File(filePath + File.separator + fileName); // 创建File对象
try (FileOutputStream outputStream = new FileOutputStream(file)) { // 创建文件输出流
byte buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) { // 从文件流读取数据并写入文件
outputStream.write(buffer, 0, bytesRead);
}
}
return file; // 返回转换后的File对象
}
}
// 函数示例
// 将文件流转换为File对象示例
// 入参:inputStream,文件流
// 入参:filePath,文件路径
// 入参:fileName,文件名
// 出参:file,转换后的File对象
// 调用示例:
// InputStream inputStream = new FileInputStream("example.txt");
// String filePath = "C:\\Users\\User\\Documents";
// String fileName = "example.txt";
// File file = FileConverter.convertStreamToFile(inputStream, filePath, fileName);
// System.out.println(file.getAbsolutePath);
// 输出结果:例如,将文件流转换为File对象后,文件的绝对路径为:C:\Users\User\Documents\example.txt
// 则输出结果为:C:\Users\User\Documents\example.txt
通过分析,不难发现以上代码:
-
广联达:"数字建筑 "将推动建筑业向现代工业化水平迈进--一是全过程、全要素、全参与方的数字化。"数字建筑 "整合了人员、流程、数据、技术和业务系统,对建筑从规划设计到施工建设、运营维护的全生命周期进行管理。
二是数字化、在线化、智能化。这也是数字化建筑的三大典型特征。其中,数字化是基础,在线化是关键,智能化是目标。
三是新设计、新建设、新运维。试想,未来通过全数字化样板设计实现个性化最优方案,通过工业化施工提高效率精益求精,通过智能化运维提升建筑品质低碳宜居,将推动建筑业向现代工业化水平迈进。
广联达的一批标杆项目和应用案例备受关注。
-
openEuler郑州用户组成立!openEuler与hyperfusion携手共建河南地区用户生态 - 开幕致辞
超融合操作系统业务总经理、openEuler委员会成员蒋振华先生为本次活动致辞。
在本次活动的致辞中,他提到,作为openEuler社区早期的成员,超融合见证了openEuler从成立到在各行业商业落地,再到跨越生态拐点的过程,感谢openEuler提供了一个全产业链共同创新的平台,共同推动创新技术的商业落地。
同时,本次活动得到了郑州市郑东新区大数据管理局、郑州中原科技城投资服务局的大力支持。
郑东新区大数据管理局曹光远
在活动致辞中表示,openEuler的应用和*应用设施的深度优化,为郑东新区数字化转型提供了安全、可靠、高性能的技术基础;郑州中原科技城招商服务局王林表示,郑东新区欢迎所有openEuler生态相关企业扎根当地,围绕openEuler社区共同发展,形成合力。
openEuler社区及运维功能介绍
openEuler技术委员会委员胡峰
openEuler技术委员会委员胡峰先生在本次活动中介绍了openEuler社区目前发展的整体情况,并重点从技术层面介绍了openEuler的运维功能。
openEuler 晚会
胡峰先生介绍智能运维工具 A-Ops 和 openEuler gala、
阿波罗
Apollo、智能漏洞管理解决方案等新功能,以及涵盖各种运维场景的精品运维组件。在*交流环节,许多用户就目前使用的
openEuler
在*交流环节,许多用户就自己在使用openEuler过程中遇到的一些问题与胡峰先生进行了进一步的交流。
软硬结合,构建多样化算力操作系统
Hyperfusion 基于
openEuler
的基础上,结合自身软硬件技术积累,推出了富讯服务器操作系统
FusionOS
FusionOS.
FusionOS 首席架构师张海亮
分享了
FusionOS
FusionOS首席架构师张海亮分享了FusionOS的软硬件协同优势、卓越的性能和可靠性,以及FusionOS在金融、运营商、*、互联网等行业的实践案例,引起了众多用户的兴趣,分享结束后,不少参会者就FusionOS的特点向讲师提问并进行了交流。