The 3BV score is essentially counting the number of clicks required to reveal all non-mine squares.
A Minesweeper board is essentially an m*n array. To calculate the 3BV, you will need to process the cells in this array in a particular order, so you will need to be able to mark each cell after you process it (so you don't process it multiple times). Then, use the following two procedures:
Count3BV:
For each empty ("0") cell C:
If C has already been marked, continue.
Mark C. Add 1 to your 3BV count.
Call FloodFillMark(C).
For each non-marked, non-mine cell:
Add 1 to your 3BV count.
FloodFillMark(C):
For every non-marked neighbor N of C (diagonal and orthogonal):
Mark N.
If N is an empty cell, call FloodFillMark(N).
(EDIT: There was a small typo above.)
(EDIT: Added pseudo-function indentation.)
As for 3BV/s, that is just the 3BV score divided by the time the player used to solve the puzzle. Since each 3BV point represents a separate action, higher scores are better (you perform more actions per second).
EDIT: As an example, I'm going to use the one from Wikipedia, which looks like this:
0000002M
0000013M
110113M3
M101M3M2
11011222
0000001M
00122222
001MM2M1
The algorithm works by marking cells after they have been processed. To visualize that, I will be using a * to indicate a processed cell, and a . to indicate a non-processed cell. Hence, we start with these markings:
........
........
........
........
........
........
........
........
We're going to start by processing the top-left cell. This is an empty (blank or 0) cell, so we start a flood fill marking all blank cells connected to this one, as well as all non-blank cells directly adjacent to these. We start by marking the cell we're processing:
*.......
........
........
........
........
........
........
........
The flood fill takes many steps, and exactly how the intermediate steps look depend on exactly how you implement the flood fill. Ultimately, however, it ends up looking like this:
*******.
*******.
******..
.***....
*******.
*******.
*******.
***.....
That's all one big region, so that just adds 1 to our 3BV calculation.
Since there are no blank cells left, all we need to do is count the number of non-marked, non-mine cells. Those cells are placed at the locations marked #:
*******.
*******.
******.#
.***.#.#
*******#
*******.
*******#
***..#.#
There are 7 such cells, so we add a total of 7 to the count, leaving a result of 8.
Now, you've mentioned that your representation only contains 0 and 9 (where 9 is a mine). That is, however, just going to change how you determine whether or not a cell is empty - the algorithm is the same. In your case, a cell is empty if the cell and all of its neighbors are all 0.