First, consider group extensions with non-abelian kernel
$$1\to K\to G \to Q \to 1$$
It is well-known that these are classified by certain cohomological objects, specifically: Any such extension induces an outer action, i.e. a group homomorphism $\omega: Q\to\operatorname{Out}(K)$ (which turns $Z(K)$ into a $\mathbb{Z}Q$-module) and to any outer action we can associate an obstruction in $H^3(Q,Z(K))$ that vanishes iff any extension with the given outer action exists. And if they exist, they are in bijection with the non-abelian cohomology $H^2(Q,K,\omega)$.


Second, consider $Q$-graded, crossed $k$-algebras, i.e. $k$-algebras with a decomposition $A=\bigoplus\_{q\in Q} A\_q$ such that $1\in A\_1$, $A\_{q\_1} \cdot A\_{q\_2} \subseteq A\_{q\_1 q\_2}$, and all $A\_q$ contain a unit. Again, this situation induces an outer action $\omega: Q\to\operatorname{Out}(A\_1)$ (and $Z(A\_1)$ becomes a $kQ$-module), for any such outer action there is an obstruction in $H^3(Q,Z(A\_1)^\times)$ that vanishes iff any $Q$-graded, crossed $k$-algebra with the given outer action exists. And if they exists, they are classified by non-abelian cohomology $H^2(Q,A\_1^\times,\omega)$.


These statements are so similar that it is natural to ask:


**Question**: What is a natural, common generalization of both statements?


There are natural constructions relating the two: Given a group extension, $A:=k[G]$ is $Q$-graded and crossed with $A\_q:=k[qK]$. Conversely, given a crossed algebra, the group of homogeneous units fits into a natural extension $1\to A\_1^\times \to (A^\times)\_{homog.} \to Q\to 1$


But these constructions do not immediately give implications from one theorem to the other: The group extension version does not give you the algebra version, because $\operatorname{Out}(A\_1)$ may be different from $\operatorname{Out}(A\_1^\times)$ and $Z(A\_1)^\times$ may have little to do with $Z(A\_1^\times)$.


Conversely, the algebra version does not give you the group version, $A\_1=k[K]$, again because $\operatorname{Out}(K)$ and $\operatorname{Out}(k[K])$ can be very different.



Connection between the classifications of group extensions and group-graded algebras in terms of non-abelian cohomology
In the meantime I found the right nlab pages to read... The answer seems to be [2-groups](https://ncatlab.org/nlab/show/2-group)! Specifically [automorphism 2-groups](https://ncatlab.org/nlab/show/2-group#automorphism_2groups). I will write up what I have come to understand so far (though I have not checked every last detail of this):


1. What's a 2-group? Like an ordinary group is a category with 1 object in which every morphism is invertible, a (coherent) 2-group is a 2-category with only one object in which every 1- and 2-morphism is invertible (and we have picked a weak inverse of every 1-morphism).


	* Generic Example: For every 2-category $\mathscr{C}$ and every object $\mathcal{C}\in\mathscr{C}$ there is a automorphism-2-group $\operatorname{AUT}\_\mathscr{C}(\mathcal{C})$ which has the self-equivalences $\mathcal{C}\to\mathcal{C}$ as 1-morphisms and natural isomorphisms between those as 2-morphisms.
	* This includes both the case of groups by letting $\mathscr{C}$ be the 2-category of categories and the case of $k$-algebra by letting $\mathscr{C}$ be the 2-category of $k$-linear categories.
	
	
	A group $K$ is a category with one object and $\operatorname{AUT}\_\mathsf{cat}(K)$ is a 2-group with $\operatorname{Aut}\_{\mathsf{Grp}}(K)$ as its set of 1-morphisms and for every $h\in K$ a 2-morphism $\alpha \to \kappa\_h\circ\alpha$ where $\kappa\_h$ is the conjugation with $h$.
	
	
	A $k$-algebra is a $k$-linear category with one object and we get its automorphism-2-group $\operatorname{AUT}\_{k\mathsf{-cat}}(A)$ which similary consists of $\operatorname{Aut}\_{k\mathsf{-Alg}}(A)$ and $A^\times$ as its sets of 1- and 2-morphisms respectively.
	* Other example: Any ordinary group $Q$ can "upgraded" to a 2-group $\mathscr{Q}$ by letting 1-morphisms be elements of $Q$ just as usual and letting 2-morphisms be only identities.
2. Conversely, any 2-group $\mathscr{G}$ naturally defines an ordinary group $\pi\_1(\mathscr{G})$ by considering 1-morphisms up to equivalence.


In our examples


	* $\pi\_1(\operatorname{AUT}\_{\mathsf{cat}}(K)) = \operatorname{Out}(K)$,
	* $\pi\_1(\operatorname{AUT}\_{k\mathsf{-cat}}(A)) = \operatorname{Out}(A)$,
	* $\pi\_1(\mathscr{Q}) = Q$
	I will write $\operatorname{Out}\_\mathscr{C}(\mathcal{C})$ as shorthand for $\pi\_1(\operatorname{AUT}\_\mathscr{C}(\mathcal{C}))$
3. In addition, any 2-group $\mathscr{G}$ also defines an abelian group $\pi\_2(\mathscr{G})$ consisting of the 2-isomorphisms of the identity 1-morphism (which is abelian by an Eckmann-Hilton argument) and $\pi\_1$ naturally acts on $\pi\_2$ by conjugation.


	* In the generic example, $\pi\_2(\operatorname{AUT}\_\mathscr{C}(\mathcal{C})))$ is the unit group of the commutative monoid $Z(\mathcal{C})$ on which $\operatorname{Out}\_\mathscr{C}(\mathcal{C})$ acts by "conjugation"
	* $\pi\_2(\operatorname{AUT}\_\mathsf{cat}(K)) = Z(K)$ with the natural action by $\operatorname{Out}(K)$.
	* Similary, $\pi\_2(\operatorname{AUT}\_{k\mathsf{-cat}}(A)) = Z(A)^\times$ with the natural action by $\operatorname{Out}(A)$.
	* And trivially $\pi\_2(\mathscr{Q}) = 1$
4. Where do extensions and gradings come in? A common generalisation of both theorem in my question is the following:



> 
> Let $Q$ be a group,$(\mathcal{V},\oplus,\otimes)$ be a [bimonoidal category](https://ncatlab.org/nlab/show/rig+category) and $\mathscr{C}:=\mathcal{V}\mathsf{-cat}$ be the 2-category of categories enriched in $(\mathcal{V},\otimes)$.
> 
> 
> Then: For every group homomorphism $\omega: Q\to\operatorname{Out}\_\mathscr{C}(\mathcal{C}\_1)$, the non-abelian cohomology $H^2(Q,\operatorname{AUT}\_\mathscr{C}(\mathcal{C}\_1),\omega)$ is in canonical bijection with "crossed, $Q$-graded categories" $\mathcal{C}$ that have $\mathcal{C}\_1$ as their degree-1-part and induced outer action $\omega$.
> 
> 
> Furthermore: These two sets are non-empty iff a certain obstruction $o(\omega)\in H^3(Q,Z(\mathcal{C}\_1)^\times)$ vanishes.
> 
> 
> 


5. This begs the question: What's a "graded category"? A *graded category* is a category $\mathcal{C}$ enriched in $(\mathcal{V},\otimes)$ that is equipped with a decomposition $\mathcal{C}(x,y) = \bigoplus\_{q\in Q} \mathcal{C}\_q(x,y)$ such that $\operatorname{id}\_x \in \mathcal{C}\_1(x,x)$ and composition of morphisms decomposes accordingly as $\circ: \mathcal{C}\_p \otimes \mathcal{C}\_q \to \mathcal{C}\_{pq}$.


In particular: Considering only the morphisms in $\mathcal{C}\_1$ gives us another category (with the same set of objects).


A graded category is *crossed* if every $\mathcal{C}\_q(x,x)$ contains an isomorphism.


	* Every group extension $1\to K\to G\to Q\to 1$ gives a $Q$-grading on the one-object category $G$ if we let $(\mathcal{V},\oplus,\otimes)$ be $(\mathsf{Set},\sqcup,\times)$, namely the decomposition into cosets of $K$. These gradings are always crossed.
	* A graded $k$-algebra $A=\bigoplus\_{q\in Q}$ gives a $Q$-grading on the one-object category $A$ if we let $(\mathcal{V},\oplus,\otimes)$ be $(k\mathsf{-mod},\oplus,\otimes)$. These gradings are crossed iff they are crossed in the usual sense, i.e. if all $A\_q$ contain at least one unit.A crossed $Q$-graded category induces an outer action $Q\to\operatorname{Out}\_{\mathcal{V}\mathsf{-cat}}(\mathcal{C}\_1)$ by choosing 1-isomorphisms $u\_{q,x}\in \mathcal{C}\_q(x,x)$ for every $x\in Ob(\mathcal{C})$ and $q\in Q$ and mapping $q$ to the equivalence class $[\alpha\_q]\in\operatorname{Out}(\mathcal{C}\_1)$ of the "conjugation"-functor $\alpha\_q: \mathcal{C}\_1\to\mathcal{C}\_1, (x\xleftarrow{f}y) \mapsto (x \xleftarrow{u\_{q,x} \circ f \circ u\_{q,y}^{-1}} y)$.


	* For group extensions $1\to K\to G\to Q\to 1$ this is exactly the outer action $Q\to\operatorname{Out}(K)$ induced by conjugation.
	* For crossed, $Q$-graded algebras this is also the outer action $Q\to\operatorname{Out}(A\_1)$ induced by conjugation.
6. Now, what precisely does the theorem do? For every fixed group homomorphism $\omega: Q \to \pi\_1(\operatorname{AUT}\_\mathscr{C}(\mathcal{C}\_1))$ it establishes really two pairs bijection between the following three sets:


	* $Q$-graded, crossed categories extending $\mathcal{C}\_1$ that induce $\omega$
	
	
	$$\uparrow \downarrow$$
	* 2-group morphisms $\mathscr{Q}\to\operatorname{AUT}\_\mathscr{C}(\mathcal{C}\_1)$ up to equivalence that induce $\omega$ on the $\pi\_1$-groups, where $\mathscr{Q}$ is the 2-group upgrade of $Q$.
	
	
	$$\uparrow \downarrow$$
	* non-abelian cohomology $H^2(Q,\operatorname{AUT}\_\mathscr{C}(\mathcal{C}\_1),\omega)$, i.e. 2-cocycles $(\alpha,\chi)$ up to 2-coboundaries
	
	
		+ $(\alpha,\chi)$ being a 2-cocycle means $\alpha: Q \to \{1\text{-morphisms}\}, \chi: Q^2 \to \{2\text{-morphisms}\}$ with $\chi\_{p,q}: \alpha\_{p} \alpha\_{q} \Rightarrow \alpha\_{pq}$, $\alpha\_q$ is in the equivalence class $\omega(q)$, and the 2-coycle condition holds: $\chi\_{xy,z}\circ\chi\_{x,y} = \chi\_{x,yz}\circ(\alpha\_x(\chi\_{y,z}))\circ\text{associator}$ as 2-morphisms $(\alpha\_x\circ\alpha\_y)\circ\alpha\_z \Rightarrow \alpha\_{xyz}$
		+ A 2-coboundary $(\alpha,\chi) \to (\alpha',\chi')$ is map $\lambda: Q\to\{2\text{-morphisms}\}$ such that $\lambda\_x: \alpha\_x \Rightarrow \alpha'\_x$ with $\lambda\_{xy}\circ\chi\_{x,y} = \chi'\_{x,y}\circ(\lambda\_x\lambda\_y)$ as 2-morphism $\alpha\_x \circ \alpha\_x \Rightarrow \alpha'\_{xy}$.
7. And finally: How does one prove all of that? If I have not made any huge mistakes, the classical proofs from Schreier theory all carry over if one replaces all equations by the appropriate commutative diagrams.


There is even a regular action of the group $H^2(Q,Z(\mathcal{C}\_1)^\times)$ on the set $H^2(Q,\operatorname{AUT}\_\mathscr{C}(\mathcal{C}\_1),\omega)$ if it is non-empty given by $[\zeta] . [\alpha,\chi] := [\alpha, \zeta.\!\chi]$ where $\zeta.\!\chi$ means the 2-morphism $\alpha\_p\circ\alpha\_q \overset{\chi\_{p,q}}{\Longrightarrow} \alpha\_{pq} \overset{1\_{\alpha\_{pq}} \ast \zeta\_{p,q}}{\Longrightarrow} \alpha\_{pq}$


